diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 86f0d8d410e8..7c1fa1e23353 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -145,12 +145,6 @@ "Documentation: Cwiki" ] }, - { - "input": "dart-flutter-petstore.sh", - "matches": [ - "Client: Dart" - ] - }, { "input": "dart-jaguar-petstore.sh", "matches": [ diff --git a/.gitignore b/.gitignore index 56cc80cae68e..18d2a7a10270 100644 --- a/.gitignore +++ b/.gitignore @@ -174,6 +174,7 @@ samples/client/petstore/python-tornado/.venv/ samples/client/petstore/typescript-angular2/npm/npm-debug.log samples/client/petstore/typescript-node/npm/npm-debug.log samples/client/petstore/typescript-angular/tsd-debug.log +samples/client/petstore/typescript-fetch/tests/**/dist/ # aspnetcore samples/server/petstore/aspnetcore/.vs/ @@ -186,6 +187,7 @@ samples/client/petstore/kotlin-string/build samples/openapi3/client/petstore/kotlin/build samples/server/petstore/kotlin-server/ktor/build samples/server/petstore/kotlin-springboot/build +samples/client/petstore/kotlin-multiplatform/build/ \? # haskell diff --git a/.travis.yml b/.travis.yml index b4bd3d852f76..8f0ffe389d61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,6 +94,8 @@ before_install: # - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18). # - . ~/otp/18.2.1/activate && erl -version #- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH" + # install valgrind for C++ memory test + - sudo apt-get install valgrind # install Qt 5.10 - sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty - sudo apt-get update -qq diff --git a/CI/.drone.yml b/CI/.drone.yml index 5480eb2a9a66..cd195bb8c8de 100644 --- a/CI/.drone.yml +++ b/CI/.drone.yml @@ -2,12 +2,32 @@ kind: pipeline name: default steps: +# test haskell client +- name: haskell-client-test + image: haskell:8.6.5 + commands: + - (cd samples/client/petstore/haskell-http-client/ && stack --install-ghc --no-haddock-deps haddock --fast && stack test --fast) +# test Dart 2.x petstore client +- name: dart2x-test + image: google/dart + commands: + - (cd samples/client/petstore/dart-jaguar/openapi && pub get && pub run build_runner build --delete-conflicting-outputs) + - (cd samples/client/petstore/dart-jaguar/flutter_petstore/openapi && pub get && pub run build_runner build --delete-conflicting-outputs) + - (cd samples/client/petstore/dart2/openapi && pub get && pub run test) # test Java 11 HTTP client - name: java11-test - image: hirokimatsumoto/alpine-openjdk-11 + image: openjdk:11.0 commands: - ./mvnw clean install - ./mvnw --quiet verify -Psamples.droneio + # test all generators with fake petstore spec (2.0, 3.0) + - /bin/bash bin/utils/test-fake-petstore-for-all.sh + # generate test scripts + - /bin/bash bin/tests/run-all-test + # generate all petstore samples (client, servers, doc) + - /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 diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 98052b055f5d..83d26c3eeaec 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -14,14 +14,6 @@ if [ "$NODE_INDEX" = "1" ]; then mvn --quiet verify -Psamples.circleci mvn --quiet javadoc:javadoc -Psamples.circleci - # generate all petstore samples (client, servers, doc) - ./bin/run-all-petstore - # generate all petstore samples (openapi3) - ./bin/openapi3/run-all-petstore - # generate test scripts - ./bin/tests/run-all-test - # test all generators with fake petstore spec (2.0, 3.0) - ./bin/utils/test-fake-petstore-for-all.sh elif [ "$NODE_INDEX" = "2" ]; then # run ensure-up-to-date sample script on SNAPSHOT version only project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout` @@ -29,12 +21,6 @@ elif [ "$NODE_INDEX" = "2" ]; then echo "Running node $NODE_INDEX to test ensure-up-to-date" java -version - # install elm-format for formatting elm code - npm install -g elm-format - - # symlink elm-format - sudo ln -s /opt/circleci/.nvm/versions/node/v12.1.0/bin/elm-format /usr/local/bin/elm-format - ./bin/utils/ensure-up-to-date fi #elif [ "$NODE_INDEX" = "3" ]; then diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java index 73f0b3c6f5c3..27121aec515e 100644 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/ArrayOfArrayOfNumberOnlyTest.java @@ -53,6 +53,7 @@ public void arrayArrayNumberTest() { List arrayArrayNumber = new ArrayList(); arrayArrayNumber.add(b1); arrayArrayNumber.add(b2); + model.setArrayArrayNumber(new ArrayList>()); model.getArrayArrayNumber().add(arrayArrayNumber); // create another instance for comparison @@ -62,6 +63,7 @@ public void arrayArrayNumberTest() { List arrayArrayNumber2 = new ArrayList(); arrayArrayNumber2.add(b1); arrayArrayNumber2.add(b2); + model2.setArrayArrayNumber(new ArrayList>()); model2.getArrayArrayNumber().add(arrayArrayNumber2); Assert.assertTrue(model2.equals(model)); diff --git a/CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml b/CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml new file mode 100644 index 000000000000..35c073c7dcaf --- /dev/null +++ b/CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + org.openapitools + TypeScriptFetchBuildPrefixParameterInterfacesPestoreClientTests + pom + 1.0-SNAPSHOT + TS Fetch Petstore Client (with namespacing for parameter interfaces) + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + integration-test + + exec + + + npm + + install + + + + + npm-build + integration-test + + exec + + + npm + + run + build + + + + + npm-test + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/README.md b/README.md index ec68b1d25ffb..cadce426d48f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.1.0`): [![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.1.3-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) @@ -65,11 +65,11 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | |-|-| -**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) -**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) -**API documentation generators** | **HTML**, **Confluence Wiki** +**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) +**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) +**API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc** **Configuration files** | [**Apache2**](https://httpd.apache.org/) -**Others** | **GraphQL**, **JMeter**, **MySQL Schema** +**Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer** ## Table of contents @@ -108,8 +108,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.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.0-SNAPSHOT/)| 09.10.2019 | Minor release (breaking changes with fallbacks) -4.1.1 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.1-SNAPSHOT/)| 23.08.2019 | Patch release (bug fixes, enhancements) -[4.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.0) (latest stable release) | 09.08.2019 | Minor release (breaking changes with fallbacks) +4.1.3 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.3-SNAPSHOT/)| 30.09.2019 | Patch release (bug fixes, enhancements) +[4.1.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.2) (latest stable release) | 12.09.2019 | Patch release (bug fixes, enhancements) OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -165,16 +165,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.1.0/openapi-generator-cli-4.1.0.jar` +JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.2/openapi-generator-cli-4.1.2.jar` For **Mac/Linux** users: ```sh -wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar -O openapi-generator-cli.jar +wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.2/openapi-generator-cli-4.1.2.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.1.0/openapi-generator-cli-4.1.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.2/openapi-generator-cli-4.1.2.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -389,10 +389,10 @@ openapi-generator version ``` -Or install a particular OpenAPI Generator version (e.g. v4.1.0): +Or install a particular OpenAPI Generator version (e.g. v4.1.2): ```sh -npm install @openapitools/openapi-generator-cli@cli-4.1.0 -g +npm install @openapitools/openapi-generator-cli@cli-4.1.2 -g ``` Or install it as dev-dependency: @@ -416,7 +416,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar) +You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.2/openapi-generator-cli-4.1.2.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` @@ -560,15 +560,20 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Commencis](https://www.commencis.com/) - [Cupix](https://www.cupix.com/) - [DB Systel](https://www.dbsystel.de) +- [Element AI](https://www.elementai.com/) - [FormAPI](https://formapi.io/) - [Fuse](https://www.fuse.no/) +- [Gantner](https://www.gantner.com) - [GenFlow](https://github.com/RepreZen/GenFlow) - [GMO Pepabo](https://pepabo.com/en/) - [GoDaddy](https://godaddy.com) - [JustStar](https://www.juststarinfo.com) - [Klarna](https://www.klarna.com/) +- [Médiavision](https://www.mediavision.fr/) - [Metaswitch](https://www.metaswitch.com/) - [Myworkout](https://myworkout.com) +- [Paxos](https://www.paxos.com) +- [Pricefx](https://www.pricefx.com/) - [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager) - [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch) - [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development) @@ -626,6 +631,20 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2019-07-08 - [OpenAPI Generator にコントリビュートしたら社名が載った話。(CAM) - CAM TECH BLOG](https://tech.cam-inc.co.jp/entry/2019/07/08/140000) by [CAM, Inc.](https://www.cam-inc.co.jp/) - 2019-07-14 - [OpenAPI GeneratorでPythonのクライアントライブラリを作成した](https://qiita.com/yuji38kwmt/items/dfb929316a1335a161c0) by [yuji38kwmt](https://qiita.com/yuji38kwmt) - 2019-07-19 - [Developer Experience (DX) for Open-Source Projects: How to Engage Developers and Build a Growing Developer Community](https://speakerdeck.com/wing328/developer-experience-dx-for-open-source-projects-english-japanese) by [William Cheng](https://twitter.com/wing328), [中野暁人](https://github.com/ackintosh) at [Open Source Summit Japan 2019](https://events.linuxfoundation.org/events/open-source-summit-japan-2019/) +- 2019-08-14 - [Our OpenAPI journey with Standardizing SDKs](https://bitmovin.com/our-openapi-journey-with-standardizing-sdks/) by [Sebastian Burgstaller](https://bitmovin.com/author/sburgstaller/) at [Bitmovin](https://www.bitmovin.com) +- 2019-08-15 - [APIのコードを自動生成させたいだけならgRPCでなくてもよくない?](https://www.m3tech.blog/entry/2019/08/15/110000) by [M3, Inc.](https://corporate.m3.com/) +- 2019-08-22 - [マイクロサービスにおけるWeb APIスキーマの管理─ GraphQL、gRPC、OpenAPIの特徴と使いどころ](https://employment.en-japan.com/engineerhub/entry/2019/08/22/103000) by [@ota42y](https://twitter.com/ota42y) +- 2019-08-24 - [SwaggerドキュメントからOpenAPI Generatorを使ってモックサーバー作成](https://qiita.com/masayoshi0222/items/4845e4c715d04587c104) by [坂本正義](https://qiita.com/masayoshi0222) +- 2019-08-29 - [OpenAPI初探](https://cloud.tencent.com/developer/article/1495986) by [peakxie](https://cloud.tencent.com/developer/user/1113152) at [腾讯云社区](https://cloud.tencent.com/developer) +- 2019-08-29 - [全面进化:Kubernetes CRD 1.16 GA前瞻](https://www.servicemesher.com/blog/kubernetes-1.16-crd-ga-preview/) by [Min Kim](https://github.com/yue9944882) at [ServiceMesher Blog](https://www.servicemesher.com/blog/) +- 2019-09-01 - [Creating a PHP-Slim server using OpenAPI (Youtube video)](https://www.youtube.com/watch?v=5cJtbIrsYkg) by [Daniel Persson](https://www.youtube.com/channel/UCnG-TN23lswO6QbvWhMtxpA) +- 2019-09-14 - [Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/generating-and-configuring-a-mastercard-api-client/) at [Mastercard Developers Platform](https://developer.mastercard.com/platform/documentation/) +- 2019-09-15 - [OpenAPI(Swagger)導入下調べ](https://qiita.com/ShoichiKuraoka/items/f1f7a3c2376f7cd9c56a) by [Shoichi Kuraoka](https://qiita.com/ShoichiKuraoka) +- 2019-09-22 - [OpenAPI 3を完全に理解できる本](https://booth.pm/ja/items/1571902) by [@ota42y](https://twitter.com/ota42y) +- 2019-09-22 - [RESTful APIs: Tutorial of OpenAPI Specification](https://medium.com/@amirm.lavasani/restful-apis-tutorial-of-openapi-specification-eeada0e3901d) by [Amir Lavasani](https://medium.com/@amirm.lavasani) +- 2019-09-22 - [Redefining SDKs as software diversity kits](https://devrel.net/dev-rel/redefining-sdks-as-software-diversity-kits) by [Sid Maestre (Xero)](https://twitter.com/sidneyallen) at [DevRelCon San Francisco 2019](https://sf2019.devrel.net/) +- 2019-09-23 - [swaggerからOpenApi GeneratorでSpringのコードを自動生成](https://qiita.com/littleFeet/items/492df2ad68a0799a5e5e) by [@littleFeet](https://qiita.com/littleFeet) at [Qiita](https://qiita.com/) + ## [6 - About Us](#table-of-contents) @@ -688,7 +707,9 @@ Here is a list of template creators: * Javascript (Flow types) @jaypea * JMeter: @davidkiss * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) + * Kotlin (MultiPlatform): @andrewemery * Lua: @daurnimator + * Nim: @hokamoto * OCaml: @cgensoul * Perl: @wing328 [:heart:](https://www.patreon.com/wing328) * PHP (Guzzle): @baartosz @@ -737,6 +758,7 @@ Here is a list of template creators: * JAX-RS RestEasy (JBoss EAP): @jfiala * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Kotlin (Spring Boot): @dr4ke616 + * Kotlin (Vertx): @Wooyme * NodeJS Express: @YishTish * PHP Laravel: @renepardon * PHP Lumen: @abcsun @@ -750,13 +772,16 @@ Here is a list of template creators: * Scala Lagom: @gmkumar2005 * Scala Play: @adigerber * Documentation + * AsciiDoc: @man-at-home * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock * Configuration * Apache2: @stkrwork * Schema + * Avro: @sgadouar * GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328) * MySQL: @ybelenko + * Protocol Buffer: @wing328 :heart: = Link to support the contributor directly @@ -797,10 +822,10 @@ If you want to join the committee, please kindly apply by sending an email to te | Apex | | | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C | @zhemant (2018/11) | -| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) | +| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) | | C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) | | Clojure | | -| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) | +| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) | | Eiffel | @jvelilla (2017/09) | | Elixir | @mrmstn (2018/12) | | Elm | @eriktim (2018/09) | @@ -813,6 +838,7 @@ If you want to join the committee, please kindly apply by sending an email to te | 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) | | Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) | | Lua | @daurnimator (2017/08) | +| Nim | | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | | OCaml | @cgensoul (2019/08) | diff --git a/bin/asciidoc-documentation-petstore.sh b/bin/asciidoc-documentation-petstore.sh new file mode 100755 index 000000000000..2d3d4adb40a4 --- /dev/null +++ b/bin/asciidoc-documentation-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# 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/asciidoc-documentation --additional-properties=specDir=modules/openapi-generator/src/main/resources/asciidoc-documentation,snippetDir=. -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g asciidoc -o samples/documentation/asciidoc" + +java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/cpp-pistache-server-petstore.sh b/bin/cpp-pistache-server-petstore.sh index d0273a9d76c0..7f2c734b6894 100755 --- a/bin/cpp-pistache-server-petstore.sh +++ b/bin/cpp-pistache-server-petstore.sh @@ -27,6 +27,6 @@ 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 -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties addExternalLibs=true -o samples/server/petstore/cpp-pistache $@" +ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties addExternalLibs=true --additional-properties useStructModel=false -o samples/server/petstore/cpp-pistache $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/dart-flutter-petstore.sh b/bin/dart-flutter-petstore.sh deleted file mode 100755 index af3aaca2bec8..000000000000 --- a/bin/dart-flutter-petstore.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -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" - -## Generate non-browserClient -#ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/swagger --additional-properties hideGenerationTimestamp=true,browserClient=false $@" -# -## then options to generate the library for vm would be: -##ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/swagger_vm --additional-properties browserClient=false,pubName=swagger_vm $@" -#java $JAVA_OPTS -jar $executable $ags -# -## Generate browserClient -#ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/swagger-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true $@" -#java $JAVA_OPTS -jar $executable $ags - -# Generate non-browserClient and put it to the flutter sample app -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart/flutter_petstore/swagger --additional-properties hideGenerationTimestamp=true,browserClient=false $@" -java $JAVA_OPTS -jar $executable $ags - -# There is a proposal to allow importing different libraries depending on the environment: -# https://github.com/munificent/dep-interface-libraries -# When this is implemented there will only be one library. - -# The current petstore test will then work for both: the browser library and the vm library. - diff --git a/bin/dart2-petstore.sh b/bin/dart2-petstore.sh index e8a57ffca7e3..e089c52abbb0 100755 --- a/bin/dart2-petstore.sh +++ b/bin/dart2-petstore.sh @@ -28,23 +28,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -# Generate non-browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false $@" - -# then options to generate the library for vm would be: -#ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi_vm --additional-properties browserClient=false,pubName=openapi_vm $@" -java $JAVA_OPTS -jar $executable $ags - -# Generate browserClient -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true $@" +# Generate client +ags="generate -t modules/openapi-generator/src/main/resources/dart2 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi --additional-properties hideGenerationTimestamp=true $@" java $JAVA_OPTS -jar $executable $ags - -# Generate non-browserClient and put it to the flutter sample app -ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/flutter_petstore/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false $@" -java $JAVA_OPTS -jar $executable $ags - -# There is a proposal to allow importing different libraries depending on the environment: -# https://github.com/munificent/dep-interface-libraries -# When this is implemented there will only be one library. - -# The current petstore test will then work for both: the browser library and the vm library. diff --git a/bin/fsharp-functions-server-petstore.sh b/bin/fsharp-functions-server-petstore.sh new file mode 100644 index 000000000000..23cce9c0e71c --- /dev/null +++ b/bin/fsharp-functions-server-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g fsharp-functions -o samples/server/petstore/fsharp-functions" + +java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/rust-reqwest-petstore.sh b/bin/kotlin-client-petstore-multiplatform.sh similarity index 71% rename from bin/rust-reqwest-petstore.sh rename to bin/kotlin-client-petstore-multiplatform.sh index 7a5fc8d8cdd7..a0b5de50b53d 100755 --- a/bin/rust-reqwest-petstore.sh +++ b/bin/kotlin-client-petstore-multiplatform.sh @@ -27,6 +27,6 @@ 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/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust -o samples/client/petstore/rust-reqwest --additional-properties packageName=petstore_client --library=reqwest $@" +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-client-petstore-multiplatform --library multiplatform -o samples/client/petstore/kotlin-multiplatform $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-vertx-server-petstore.sh b/bin/kotlin-vertx-server-petstore.sh new file mode 100755 index 000000000000..73d0d087f3bd --- /dev/null +++ b/bin/kotlin-vertx-server-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# 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 kotlin-vertx -o samples/server/petstore/kotlin/vertx" + +java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/meta-codegen.sh b/bin/meta-codegen.sh index 1a4a8bfe735c..2c36acc14009 100755 --- a/bin/meta-codegen.sh +++ b/bin/meta-codegen.sh @@ -22,7 +22,7 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" if [ ! -f "$executable" ] then - mvn -B clean package + ./mvnw -B clean package fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" @@ -30,7 +30,7 @@ ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o sampl java $JAVA_OPTS -jar $executable $ags -mvn clean package -f samples/meta-codegen/pom.xml +./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 $@" diff --git a/bin/nim-client-petstore.sh b/bin/nim-client-petstore.sh new file mode 100755 index 000000000000..43eb2f3e3a59 --- /dev/null +++ b/bin/nim-client-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# 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/nim-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties packageName=petstore -g nim -o samples/client/petstore/nim" + +java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/openapi3/avro-petstore.sh b/bin/openapi3/avro-petstore.sh new file mode 100755 index 000000000000..0098368e067e --- /dev/null +++ b/bin/openapi3/avro-petstore.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 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/avro-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g avro-schema -o samples/openapi3/schema/petstore/avro-schema $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-multiplatform.sh b/bin/openapi3/kotlin-client-petstore-multiplatform.sh new file mode 100755 index 000000000000..913f73ef1d85 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-multiplatform.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 clean package +fi + +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/openapi3/client/petstore/kotlin-multiplatform $@" + +echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-multiplatform" +rm -rf samples/openapi3/client/petstore/kotlin-multiplatform + +echo "Generating Kotling client..." +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore.sh b/bin/openapi3/kotlin-client-petstore.sh index 5ffd829b05d4..f426dba223b8 100755 --- a/bin/openapi3/kotlin-client-petstore.sh +++ b/bin/openapi3/kotlin-client-petstore.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@" echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" rm -rf samples/openapi3/client/petstore/kotlin diff --git a/bin/openapi3/typescript-fetch-petstore-all.sh b/bin/openapi3/typescript-fetch-petstore-all.sh index 0c6dd48b503e..c052045b1068 100755 --- a/bin/openapi3/typescript-fetch-petstore-all.sh +++ b/bin/openapi3/typescript-fetch-petstore-all.sh @@ -4,3 +4,4 @@ ./bin/openapi3/typescript-fetch-petstore-with-npm-version.sh ./bin/openapi3/typescript-fetch-petstore-interfaces.sh ./bin/openapi3/typescript-fetch-petstore.sh +./bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh diff --git a/bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh b/bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.sh new file mode 100755 index 000000000000..b4f24da65321 --- /dev/null +++ b/bin/openapi3/typescript-fetch-petstore-prefix-parameter-interfaces.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 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/3_0/petstore.yaml -g typescript-fetch -o samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/openapi3/kotlin-springboot-petstore-server.bat b/bin/openapi3/windows/kotlin-springboot-petstore-server.bat similarity index 100% rename from bin/windows/openapi3/kotlin-springboot-petstore-server.bat rename to bin/openapi3/windows/kotlin-springboot-petstore-server.bat diff --git a/bin/openapi3/windows/nodejs-express-server-petstore.bat b/bin/openapi3/windows/nodejs-express-server-petstore.bat new file mode 100755 index 000000000000..73cf61835f07 --- /dev/null +++ b/bin/openapi3/windows/nodejs-express-server-petstore.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\3_0\petstore.yaml -g nodejs-express-server -o samples\openapi3\server\petstore\nodejs-express-server + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/openapi3/r-petstore.bat b/bin/openapi3/windows/r-petstore.bat similarity index 100% rename from bin/windows/openapi3/r-petstore.bat rename to bin/openapi3/windows/r-petstore.bat diff --git a/bin/protobuf-schema-petstore.sh b/bin/protobuf-schema-petstore.sh new file mode 100755 index 000000000000..3c79de0a907e --- /dev/null +++ b/bin/protobuf-schema-petstore.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/protobuf-schema -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g protobuf-schema -o samples/config/petstore/protobuf-schema --additional-properties packageName=petstore $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/python-experimental-petstore.sh b/bin/python-experimental-petstore.sh index ab01d44cc539..531cf295d64e 100755 --- a/bin/python-experimental-petstore.sh +++ b/bin/python-experimental-petstore.sh @@ -27,6 +27,6 @@ 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/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental -DpackageName=petstore_api $@" +ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental --additional-properties packageName=petstore_api $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-petstore-faraday.json b/bin/ruby-petstore-faraday.json index 21974c307f26..25c48b7aa628 100644 --- a/bin/ruby-petstore-faraday.json +++ b/bin/ruby-petstore-faraday.json @@ -2,5 +2,6 @@ "gemName": "petstore", "moduleName": "Petstore", "library": "faraday", - "gemVersion": "1.0.0" + "gemVersion": "1.0.0", + "strictSpecBehavior": false } diff --git a/bin/ruby-petstore.json b/bin/ruby-petstore.json index 47842a6be7a9..8e597283f8ba 100644 --- a/bin/ruby-petstore.json +++ b/bin/ruby-petstore.json @@ -2,5 +2,6 @@ "gemName": "petstore", "library": "typhoeus", "moduleName": "Petstore", - "gemVersion": "1.0.0" + "gemVersion": "1.0.0", + "strictSpecBehavior": false } diff --git a/bin/rust-petstore.sh b/bin/rust-petstore.sh index f80029512085..d5aceb82af66 100755 --- a/bin/rust-petstore.sh +++ b/bin/rust-petstore.sh @@ -27,6 +27,21 @@ 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/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust -o samples/client/petstore/rust --additional-properties packageName=petstore_client --library=hyper $@" -java ${JAVA_OPTS} -jar ${executable} ${ags} +for spec_path in \ + modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ + modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml \ + modules/openapi-generator/src/test/resources/2_0/fileResponseTest.json\ + ; do + spec=$(basename "$spec_path" | sed 's/.yaml//' | sed 's/.json//' ) + + for library in hyper reqwest; do + args="generate --template-dir modules/openapi-generator/src/main/resources/rust + --input-spec $spec_path + --generator-name rust + --output samples/client/petstore/rust/$library/$spec + --additional-properties packageName=${spec}-${library} + --library=$library $@" + java ${JAVA_OPTS} -jar ${executable} ${args} || exit 1 + done +done diff --git a/bin/rust-server-petstore.sh b/bin/rust-server-petstore.sh index e0a459d59e72..80893bd3eb82 100755 --- a/bin/rust-server-petstore.sh +++ b/bin/rust-server-petstore.sh @@ -38,4 +38,8 @@ for spec_path in modules/openapi-generator/src/test/resources/*/rust-server/* ; $@" java $JAVA_OPTS -jar $executable $args + + if [ $? -ne 0 ]; then + exit $? + fi done diff --git a/bin/typescript-angular-petstore-all.sh b/bin/typescript-angular-petstore-all.sh index fa1feb9f7246..327c9f79119b 100755 --- a/bin/typescript-angular-petstore-all.sh +++ b/bin/typescript-angular-petstore-all.sh @@ -13,3 +13,4 @@ ./bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.sh ./bin/typescript-angular-v7-petstore-provided-in-root.sh ./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh +./bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh diff --git a/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json b/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json new file mode 100644 index 000000000000..11141667cfe4 --- /dev/null +++ b/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json @@ -0,0 +1,7 @@ +{ + "npmName": "@openapitools/typescript-angular-petstore", + "npmVersion": "1.0.0", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false, + "ngVersion": "8.0.0" +} diff --git a/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh b/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh new file mode 100755 index 000000000000..c34db65d2d05 --- /dev/null +++ b/bin/typescript-angular-v8-petstore-provided-in-root-with-npm.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/with-npm --additional-properties ngVersion=8.0.0 $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-all.sh b/bin/typescript-fetch-petstore-all.sh index 5611d4c6eb40..7258b830a72d 100755 --- a/bin/typescript-fetch-petstore-all.sh +++ b/bin/typescript-fetch-petstore-all.sh @@ -4,4 +4,6 @@ ./bin/typescript-fetch-petstore-with-npm-version.sh ./bin/typescript-fetch-petstore-interfaces.sh ./bin/typescript-fetch-petstore.sh -./bin/typescript-fetch-petstore-multiple-parameters.sh \ No newline at end of file +./bin/typescript-fetch-petstore-multiple-parameters.sh +./bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh +./bin/typescript-fetch-petstore-typescript-three-plus.sh diff --git a/bin/typescript-fetch-petstore-prefix-parameter-interfaces.json b/bin/typescript-fetch-petstore-prefix-parameter-interfaces.json new file mode 100644 index 000000000000..5694785550cc --- /dev/null +++ b/bin/typescript-fetch-petstore-prefix-parameter-interfaces.json @@ -0,0 +1,7 @@ +{ + "npmName": "@openapitools/typescript-fetch-petstore", + "npmVersion": "1.0.0", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false, + "prefixParameterInterfaces": true +} diff --git a/bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh b/bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh new file mode 100755 index 000000000000..9ba84b2cc47d --- /dev/null +++ b/bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-prefix-parameter-interfaces.json -o samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces $@" + +java $JAVA_OPTS -jar $executable $ags + +cp CI/samples.ci/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml diff --git a/bin/typescript-fetch-petstore-typescript-three-plus.json b/bin/typescript-fetch-petstore-typescript-three-plus.json new file mode 100644 index 000000000000..b8952aa6e8bb --- /dev/null +++ b/bin/typescript-fetch-petstore-typescript-three-plus.json @@ -0,0 +1,7 @@ +{ + "npmName": "@openapitools/typescript-fetch-petstore", + "npmVersion": "1.0.0", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false, + "typescriptThreePlus": true +} diff --git a/bin/typescript-fetch-petstore-typescript-three-plus.sh b/bin/typescript-fetch-petstore-typescript-three-plus.sh new file mode 100755 index 000000000000..91776dd94f09 --- /dev/null +++ b/bin/typescript-fetch-petstore-typescript-three-plus.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-fetch -c bin/typescript-fetch-petstore-typescript-three-plus.json -o samples/client/petstore/typescript-fetch/builds/typescript-three-plus $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 799e7dc2005f..9a55f9e0c08f 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -12,6 +12,7 @@ sleep 5 # LIST OF SCRIPTS: declare -a scripts=( # SAMPLES +"./bin/ruby-client-petstore.sh" "./bin/openapi3/ruby-client-petstore.sh" "./bin/openapi3/ruby-client-faraday-petstore.sh" "./bin/java-petstore-all.sh" @@ -20,6 +21,7 @@ declare -a scripts=( "./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" @@ -27,6 +29,7 @@ declare -a scripts=( "./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" @@ -51,17 +54,21 @@ declare -a scripts=( "./bin/csharp-petstore.sh" "./bin/csharp-netcore-petstore-all.sh" "./bin/elixir-petstore.sh" +"./bin/openapi3/go-petstore.sh" "./bin/go-petstore.sh" "./bin/go-petstore-withxml.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-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/export_generators_docusaurus_index.sh" "./bin/utils/copy-to-website.sh" "./bin/utils/export_generators_readme.sh") diff --git a/bin/utils/export_docs_generators.sh b/bin/utils/export_docs_generators.sh index 0e1b50998c42..4f211dfa4a87 100755 --- a/bin/utils/export_docs_generators.sh +++ b/bin/utils/export_docs_generators.sh @@ -5,7 +5,7 @@ echo "# START SCRIPT: ${SCRIPT}" executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" -for GENERATOR in $(java -jar ${executable} list --short | sed -e 's/,/\'$'\n''/g') +for GENERATOR in $(java -jar ${executable} list --short --include all | sed -e 's/,/\'$'\n''/g') do ./bin/utils/export_generator.sh ${GENERATOR} done diff --git a/bin/utils/export_generators_docusaurus_index.sh b/bin/utils/export_generators_docusaurus_index.sh deleted file mode 100755 index 769e0a98db5c..000000000000 --- a/bin/utils/export_generators_docusaurus_index.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -\rm -rf docs/generators.md - -cat > docs/generators.md << EOF ---- -id: generators -title: Generators List ---- - -EOF - -java -jar $executable list --docsite >> docs/generators.md - -echo "Wrote $(pwd)/docs/generators.md" diff --git a/bin/utils/export_generators_readme.sh b/bin/utils/export_generators_readme.sh index ba1d043432b9..524b62f3d216 100755 --- a/bin/utils/export_generators_readme.sh +++ b/bin/utils/export_generators_readme.sh @@ -15,6 +15,6 @@ title: Generators List EOF -java -jar $executable list | sed -e 's/\([A-Z]*\) generators:/* \1 generators:/g' -e 's/- \([a-z0-9\-]*\)/- [\1]\(generators\/\1.md\)/g' >> docs/generators.md +java -jar $executable list --docsite --include all >> docs/generators.md echo "Wrote $(pwd)/docs/generators.md" diff --git a/bin/utils/openapi-generator-cli.sh b/bin/utils/openapi-generator-cli.sh index ad95cd28e64e..fcca6b35ec76 100644 --- a/bin/utils/openapi-generator-cli.sh +++ b/bin/utils/openapi-generator-cli.sh @@ -42,7 +42,7 @@ artifactid=openapi-generator-cli ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)} jar=${artifactid}-${ver}.jar -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR=${OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"} if [ ! -f ${DIR}/${jar} ]; then repo="central::default::https://repo1.maven.org/maven2/" diff --git a/bin/windows/asciidoc-documentation-petstore.bat b/bin/windows/asciidoc-documentation-petstore.bat new file mode 100644 index 000000000000..1cf9fddb696d --- /dev/null +++ b/bin/windows/asciidoc-documentation-petstore.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 "asciidoc-petstore-documentation" -t modules\openapi-generator\src\main\resources\asciidoc-documentation --additional-properties=specDir=modules\openapi-generator\src\main\resources\asciidoc-documentation,snippetDir=. -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g asciidoc -o samples\documentation\asciidoc + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/fsharp-functions-server-petstore.bat b/bin/windows/fsharp-functions-server-petstore.bat new file mode 100644 index 000000000000..560697ffe1bf --- /dev/null +++ b/bin/windows/fsharp-functions-server-petstore.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 "fsharp-functions-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g fsharp-functions -o samples\server\petstore\fsharp-functions + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-client-petstore-multiplatform.bat b/bin/windows/kotlin-client-petstore-multiplatform.bat new file mode 100644 index 000000000000..628170d6007b --- /dev/null +++ b/bin/windows/kotlin-client-petstore-multiplatform.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-client-petstore-multiplatform" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --library multiplatform -o samples\client\petstore\kotlin-multiplatform + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/kotlin-vertx-server-petstore.bat b/bin/windows/kotlin-vertx-server-petstore.bat new file mode 100644 index 000000000000..6fd12f43d82c --- /dev/null +++ b/bin/windows/kotlin-vertx-server-petstore.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-vertx-petstore-server" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin-vertx -o samples\server\petstore\kotlin\vertx + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/nim-client-petstore.bat b/bin/windows/nim-client-petstore.bat new file mode 100644 index 000000000000..875bff9fe8b8 --- /dev/null +++ b/bin/windows/nim-client-petstore.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 "nim-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml --additional-properties packageName=petstore -g nim -o samples\client\petstore\nim + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/protobuf-schema-petstore.bat b/bin/windows/protobuf-schema-petstore.bat new file mode 100755 index 000000000000..089b714681e8 --- /dev/null +++ b/bin/windows/protobuf-schema-petstore.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 +set ags=generate -t modules\openapi-generator\src\main\resources\protobuf-schema -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g protobuf-schema -o samples\config\petstore\protobuf-schema + +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 614ad0fe1044..8f3abe5afc4f 100644 --- a/bin/windows/typescript-angular-petstore-all.bat +++ b/bin/windows/typescript-angular-petstore-all.bat @@ -11,4 +11,4 @@ call .\bin\windows\typescript-angular-v7-provided-in-root.bat call .\bin\windows\typescript-angular-v7-provided-in-root-with-npm.bat call .\bin\windows\typescript-angular-v7-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 diff --git a/bin/windows/typescript-angular-v8-provided-in-root-with-npm.bat b/bin/windows/typescript-angular-v8-provided-in-root-with-npm.bat new file mode 100644 index 000000000000..142c2ac85e7d --- /dev/null +++ b/bin/windows/typescript-angular-v8-provided-in-root-with-npm.bat @@ -0,0 +1,9 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\with-npm --additional-properties ngVersion=8.0.0 + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-all.bat b/bin/windows/typescript-fetch-petstore-all.bat index c07605f175b9..d525bc0559fb 100644 --- a/bin/windows/typescript-fetch-petstore-all.bat +++ b/bin/windows/typescript-fetch-petstore-all.bat @@ -5,3 +5,5 @@ call bin\windows\typescript-fetch-petstore-target-es6.bat call bin\windows\typescript-fetch-petstore-with-npm-version.bat call bin\windows\typescript-fetch-petstore-interfaces.bat call bin\windows\typescript-fetch-petstore-multiple-parameters.bat +call bin\windows\typescript-fetch-petstore-prefix-parameter-interfaces.bat +call bin\windows\typescript-fetch-petstore-typescript-three-plus.bat \ No newline at end of file diff --git a/bin/windows/typescript-fetch-petstore-prefix-parameter-interfaces.bat b/bin/windows/typescript-fetch-petstore-prefix-parameter-interfaces.bat new file mode 100644 index 000000000000..2b271e1a2a5a --- /dev/null +++ b/bin/windows/typescript-fetch-petstore-prefix-parameter-interfaces.bat @@ -0,0 +1,12 @@ +@ECHO OFF + +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-typescript-three-plus.bat b/bin/windows/typescript-fetch-petstore-typescript-three-plus.bat new file mode 100644 index 000000000000..001a75f2986b --- /dev/null +++ b/bin/windows/typescript-fetch-petstore-typescript-three-plus.bat @@ -0,0 +1,12 @@ +@ECHO OFF + +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin/typescript-fetch-petstore-typescript-three-plus.json -o samples\client\petstore\typescript-fetch\builds\typescript-three-plus + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/faq.md b/docs/faq.md index 3e6ce24e19bc..7ccb70bdf9e3 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -5,7 +5,7 @@ title: FAQ: General ## Do you have a chat room? -[![Gitter](https://img.shields.io/gitter/room/:user/:repo.svg?style=for-the-badge)](https://gitter.im/OpenAPITools/openapi-generator) +[![Jion the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) ## What is the governance structure of the OpenAPI Generator project? diff --git a/docs/generators.md b/docs/generators.md index 77f0a887afb2..1e53c61e0ff1 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -5,132 +5,138 @@ title: Generators List The following generators are available: -* CLIENT generators: - - [ada](generators/ada.md) - - [android](generators/android.md) - - [apex](generators/apex.md) - - [bash](generators/bash.md) - - [c](generators/c.md) - - [clojure](generators/clojure.md) - - [cpp-qt5-client](generators/cpp-qt5-client.md) - - [cpp-restsdk](generators/cpp-restsdk.md) - - [cpp-tizen](generators/cpp-tizen.md) - - [csharp](generators/csharp.md) - - [csharp-dotnet2](generators/csharp-dotnet2.md) (deprecated) - - [csharp-netcore](generators/csharp-netcore.md) - - [dart](generators/dart.md) - - [dart-jaguar](generators/dart-jaguar.md) - - [eiffel](generators/eiffel.md) - - [elixir](generators/elixir.md) - - [elm](generators/elm.md) - - [erlang-client](generators/erlang-client.md) - - [erlang-proper](generators/erlang-proper.md) - - [flash](generators/flash.md) - - [go](generators/go.md) - - [go-experimental](generators/go-experimental.md) - - [groovy](generators/groovy.md) - - [haskell-http-client](generators/haskell-http-client.md) - - [java](generators/java.md) - - [javascript](generators/javascript.md) - - [javascript-closure-angular](generators/javascript-closure-angular.md) - - [javascript-flowtyped](generators/javascript-flowtyped.md) - - [jaxrs-cxf-client](generators/jaxrs-cxf-client.md) - - [jmeter](generators/jmeter.md) - - [kotlin](generators/kotlin.md) - - [lua](generators/lua.md) - - [objc](generators/objc.md) - - [ocaml](generators/ocaml.md) - - [perl](generators/perl.md) - - [php](generators/php.md) - - [powershell](generators/powershell.md) - - [python](generators/python.md) - - [python-experimental](generators/python-experimental.md) - - [r](generators/r.md) - - [ruby](generators/ruby.md) - - [rust](generators/rust.md) - - [scala-akka](generators/scala-akka.md) - - [scala-gatling](generators/scala-gatling.md) - - [scala-httpclient-deprecated](generators/scala-httpclient-deprecated.md) (deprecated) - - [scalaz](generators/scalaz.md) - - [swift2-deprecated](generators/swift2-deprecated.md) (deprecated) - - [swift3-deprecated](generators/swift3-deprecated.md) (deprecated) - - [swift4](generators/swift4.md) - - [typescript-angular](generators/typescript-angular.md) - - [typescript-angularjs](generators/typescript-angularjs.md) - - [typescript-aurelia](generators/typescript-aurelia.md) - - [typescript-axios](generators/typescript-axios.md) - - [typescript-fetch](generators/typescript-fetch.md) - - [typescript-inversify](generators/typescript-inversify.md) - - [typescript-jquery](generators/typescript-jquery.md) - - [typescript-node](generators/typescript-node.md) - - [typescript-rxjs](generators/typescript-rxjs.md) +## CLIENT generators +* [ada](generators/ada) +* [android](generators/android) +* [apex](generators/apex) +* [bash](generators/bash) +* [c](generators/c) +* [clojure](generators/clojure) +* [cpp-qt5-client](generators/cpp-qt5-client) +* [cpp-restsdk](generators/cpp-restsdk) +* [cpp-tizen](generators/cpp-tizen) +* [csharp](generators/csharp) +* [csharp-dotnet2 (deprecated)](generators/csharp-dotnet2) +* [csharp-netcore](generators/csharp-netcore) +* [dart](generators/dart) +* [dart-jaguar](generators/dart-jaguar) +* [eiffel](generators/eiffel) +* [elixir](generators/elixir) +* [elm](generators/elm) +* [erlang-client](generators/erlang-client) +* [erlang-proper](generators/erlang-proper) +* [flash](generators/flash) +* [go](generators/go) +* [go-experimental (experimental)](generators/go-experimental) +* [groovy](generators/groovy) +* [haskell-http-client](generators/haskell-http-client) +* [java](generators/java) +* [javascript](generators/javascript) +* [javascript-closure-angular](generators/javascript-closure-angular) +* [javascript-flowtyped](generators/javascript-flowtyped) +* [jaxrs-cxf-client](generators/jaxrs-cxf-client) +* [jmeter](generators/jmeter) +* [kotlin](generators/kotlin) +* [lua](generators/lua) +* [nim (beta)](generators/nim) +* [objc](generators/objc) +* [ocaml](generators/ocaml) +* [perl](generators/perl) +* [php](generators/php) +* [powershell](generators/powershell) +* [python](generators/python) +* [python-experimental (experimental)](generators/python-experimental) +* [r](generators/r) +* [ruby](generators/ruby) +* [rust](generators/rust) +* [scala-akka](generators/scala-akka) +* [scala-gatling](generators/scala-gatling) +* [scala-httpclient-deprecated (deprecated)](generators/scala-httpclient-deprecated) +* [scalaz](generators/scalaz) +* [swift2-deprecated (deprecated)](generators/swift2-deprecated) +* [swift3-deprecated (deprecated)](generators/swift3-deprecated) +* [swift4](generators/swift4) +* [typescript-angular](generators/typescript-angular) +* [typescript-angularjs](generators/typescript-angularjs) +* [typescript-aurelia](generators/typescript-aurelia) +* [typescript-axios](generators/typescript-axios) +* [typescript-fetch](generators/typescript-fetch) +* [typescript-inversify](generators/typescript-inversify) +* [typescript-jquery](generators/typescript-jquery) +* [typescript-node](generators/typescript-node) +* [typescript-rxjs](generators/typescript-rxjs) -* SERVER generators: - - [ada-server](generators/ada-server.md) - - [aspnetcore](generators/aspnetcore.md) - - [cpp-pistache-server](generators/cpp-pistache-server.md) - - [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server.md) - - [cpp-restbed-server](generators/cpp-restbed-server.md) - - [csharp-nancyfx](generators/csharp-nancyfx.md) - - [erlang-server](generators/erlang-server.md) - - [fsharp-giraffe-server](generators/fsharp-giraffe-server.md) - - [go-gin-server](generators/go-gin-server.md) - - [go-server](generators/go-server.md) - - [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md) - - [haskell](generators/haskell.md) - - [java-inflector](generators/java-inflector.md) - - [java-msf4j](generators/java-msf4j.md) - - [java-pkmst](generators/java-pkmst.md) - - [java-play-framework](generators/java-play-framework.md) - - [java-undertow-server](generators/java-undertow-server.md) - - [java-vertx](generators/java-vertx.md) - - [jaxrs-cxf](generators/jaxrs-cxf.md) - - [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi.md) - - [jaxrs-cxf-extended](generators/jaxrs-cxf-extended.md) - - [jaxrs-jersey](generators/jaxrs-jersey.md) - - [jaxrs-resteasy](generators/jaxrs-resteasy.md) - - [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap.md) - - [jaxrs-spec](generators/jaxrs-spec.md) - - [kotlin-server](generators/kotlin-server.md) - - [kotlin-spring](generators/kotlin-spring.md) - - [nodejs-express-server](generators/nodejs-express-server.md) (beta) - - [nodejs-server-deprecated](generators/nodejs-server-deprecated.md) (deprecated) - - [php-laravel](generators/php-laravel.md) - - [php-lumen](generators/php-lumen.md) - - [php-silex](generators/php-silex.md) - - [php-slim](generators/php-slim.md) - - [php-symfony](generators/php-symfony.md) - - [php-ze-ph](generators/php-ze-ph.md) - - [python-aiohttp](generators/python-aiohttp.md) - - [python-blueplanet](generators/python-blueplanet.md) - - [python-flask](generators/python-flask.md) - - [ruby-on-rails](generators/ruby-on-rails.md) - - [ruby-sinatra](generators/ruby-sinatra.md) - - [rust-server](generators/rust-server.md) - - [scala-finch](generators/scala-finch.md) - - [scala-lagom-server](generators/scala-lagom-server.md) - - [scala-play-server](generators/scala-play-server.md) - - [scalatra](generators/scalatra.md) - - [spring](generators/spring.md) +## SERVER generators +* [ada-server](generators/ada-server) +* [aspnetcore](generators/aspnetcore) +* [cpp-pistache-server](generators/cpp-pistache-server) +* [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server) +* [cpp-restbed-server](generators/cpp-restbed-server) +* [csharp-nancyfx](generators/csharp-nancyfx) +* [erlang-server](generators/erlang-server) +* [fsharp-functions](generators/fsharp-functions) +* [fsharp-giraffe-server](generators/fsharp-giraffe-server) +* [go-gin-server](generators/go-gin-server) +* [go-server](generators/go-server) +* [graphql-nodejs-express-server](generators/graphql-nodejs-express-server) +* [haskell](generators/haskell) +* [java-inflector](generators/java-inflector) +* [java-msf4j](generators/java-msf4j) +* [java-pkmst](generators/java-pkmst) +* [java-play-framework](generators/java-play-framework) +* [java-undertow-server](generators/java-undertow-server) +* [java-vertx](generators/java-vertx) +* [jaxrs-cxf](generators/jaxrs-cxf) +* [jaxrs-cxf-cdi](generators/jaxrs-cxf-cdi) +* [jaxrs-cxf-extended](generators/jaxrs-cxf-extended) +* [jaxrs-jersey](generators/jaxrs-jersey) +* [jaxrs-resteasy](generators/jaxrs-resteasy) +* [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap) +* [jaxrs-spec](generators/jaxrs-spec) +* [kotlin-server](generators/kotlin-server) +* [kotlin-spring](generators/kotlin-spring) +* [kotlin-vertx (beta)](generators/kotlin-vertx) +* [nodejs-express-server (beta)](generators/nodejs-express-server) +* [nodejs-server-deprecated (deprecated)](generators/nodejs-server-deprecated) +* [php-laravel](generators/php-laravel) +* [php-lumen](generators/php-lumen) +* [php-silex](generators/php-silex) +* [php-slim](generators/php-slim) +* [php-symfony](generators/php-symfony) +* [php-ze-ph](generators/php-ze-ph) +* [python-aiohttp](generators/python-aiohttp) +* [python-blueplanet](generators/python-blueplanet) +* [python-flask](generators/python-flask) +* [ruby-on-rails](generators/ruby-on-rails) +* [ruby-sinatra](generators/ruby-sinatra) +* [rust-server](generators/rust-server) +* [scala-finch](generators/scala-finch) +* [scala-lagom-server](generators/scala-lagom-server) +* [scala-play-server](generators/scala-play-server) +* [scalatra](generators/scalatra) +* [spring](generators/spring) -* DOCUMENTATION generators: - - [cwiki](generators/cwiki.md) - - [dynamic-html](generators/dynamic-html.md) - - [html](generators/html.md) - - [html2](generators/html2.md) - - [openapi](generators/openapi.md) - - [openapi-yaml](generators/openapi-yaml.md) +## DOCUMENTATION generators +* [asciidoc](generators/asciidoc) +* [cwiki](generators/cwiki) +* [dynamic-html](generators/dynamic-html) +* [html](generators/html) +* [html2](generators/html2) +* [openapi](generators/openapi) +* [openapi-yaml](generators/openapi-yaml) -* SCHEMA generators: - - [mysql-schema](generators/mysql-schema.md) +## SCHEMA generators +* [avro-schema (beta)](generators/avro-schema) +* [mysql-schema](generators/mysql-schema) -* CONFIG generators: - - [apache2](generators/apache2.md) - - [graphql-schema](generators/graphql-schema.md) +## CONFIG generators +* [apache2](generators/apache2) +* [graphql-schema](generators/graphql-schema) +* [protobuf-schema (beta)](generators/protobuf-schema) diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md new file mode 100644 index 000000000000..d33cab1f7eb2 --- /dev/null +++ b/docs/generators/asciidoc.md @@ -0,0 +1,25 @@ + +--- +id: generator-opts-documentation-asciidoc +title: Config Options for asciidoc +sidebar_label: asciidoc +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|appName|short name of the application| |null| +|appDescription|description of the application| |null| +|infoUrl|a URL where users can get more information about the application| |null| +|infoEmail|an email address to contact for inquiries about the application| |null| +|licenseInfo|a short description of the license| |null| +|licenseUrl|a URL pointing to the full license| |null| +|invokerPackage|root package for generated code| |null| +|groupId|groupId in generated pom.xml| |null| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|snippetDir|path with includable markup snippets (e.g. test output generated by restdoc, default: .| |.| +|specDir|path with includable markup spec files (e.g. handwritten additional docs, default: .| |..| diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md new file mode 100644 index 000000000000..9b06b1c6d4dc --- /dev/null +++ b/docs/generators/avro-schema.md @@ -0,0 +1,14 @@ + +--- +id: generator-opts-schema-avro-schema +title: Config Options for avro-schema +sidebar_label: avro-schema +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|packageName|package for generated classes (where supported)| |null| diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index ac4abee691e6..2ffeb59cc7db 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -9,3 +9,4 @@ sidebar_label: cpp-pistache-server | ------ | ----------- | ------ | ------- | |addExternalLibs|Add the Possibility to fetch and compile external Libraries needed by this Framework.| |true| |helpersPackage|Specify the package name to be used for the helpers (e.g. org.openapitools.server.helpers).| |org.openapitools.server.helpers| +|useStructModel|Use struct-based model template instead of get/set-based model template| |false| diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 128765650769..405630750054 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -12,7 +12,7 @@ sidebar_label: csharp-netcore |sourceFolder|source folder for generated code| |src| |packageGuid|The GUID that will be associated with the C# project| |null| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| -|targetFramework|The target .NET framework version.|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
|v4.6.1| +|targetFramework|The target .NET framework version.|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
|netstandard2.0| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| @@ -26,3 +26,4 @@ sidebar_label: csharp-netcore |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| |validatable|Generates self-validatable models.| |true| +|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 90b3f191f485..f5f4a62e4482 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -11,12 +11,12 @@ sidebar_label: dart-jaguar |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|browserClient|Is the client browser based| |null| +|browserClient|Is the client browser based (for Dart 1.x only)| |null| |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| |pubDescription|Description in generated pubspec| |null| |useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| -|sourceFolder|source folder for generated code| |null| -|supportDart2|support dart2| |true| +|sourceFolder|Source folder for generated code| |null| +|supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| |nullableFields|Is the null fields should be in the JSON payload| |null| |serialization|Choose serialization format JSON or PROTO is supported| |null| diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 52e6bd7e73b0..b66afda1c5fb 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -11,10 +11,10 @@ sidebar_label: dart |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|browserClient|Is the client browser based| |null| +|browserClient|Is the client browser based (for Dart 1.x only)| |null| |pubName|Name in generated pubspec| |null| |pubVersion|Version in generated pubspec| |null| |pubDescription|Description in generated pubspec| |null| |useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| -|sourceFolder|source folder for generated code| |null| -|supportDart2|support dart2| |true| +|sourceFolder|Source folder for generated code| |null| +|supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md new file mode 100644 index 000000000000..b7a8ee78257b --- /dev/null +++ b/docs/generators/fsharp-functions.md @@ -0,0 +1,22 @@ + +--- +id: generator-opts-server-fsharp-functions +title: Config Options for fsharp-functions +sidebar_label: fsharp-functions +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|licenseUrl|The URL of the license| |http://localhost| +|licenseName|The name of the license| |NoLicense| +|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| +|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| +|packageName|F# module name (convention: Title.Case).| |OpenAPI| +|packageVersion|F# package version.| |1.0.0| +|packageGuid|The GUID that will be associated with the C# project| |null| +|sourceFolder|source folder for generated code| |OpenAPI/src| diff --git a/docs/generators/go-experimental.md b/docs/generators/go-experimental.md index 23670cfd7b0a..dc84d5336f87 100644 --- a/docs/generators/go-experimental.md +++ b/docs/generators/go-experimental.md @@ -13,4 +13,5 @@ sidebar_label: go-experimental |isGoSubmodule|whether the generated Go module is a submodule| |false| |withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| +|enumClassPrefix|Prefix enum with class name| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/go.md b/docs/generators/go.md index ec1ecbebeeb1..4fc2af486dca 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -13,4 +13,5 @@ sidebar_label: go |isGoSubmodule|whether the generated Go module is a submodule| |false| |withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| +|enumClassPrefix|Prefix enum with class name| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/grpc-schema.md b/docs/generators/grpc-schema.md new file mode 100644 index 000000000000..17a765fbbcfa --- /dev/null +++ b/docs/generators/grpc-schema.md @@ -0,0 +1,9 @@ + +--- +id: generator-opts-config-grpc-schema +title: Config Options for grpc-schema +sidebar_label: grpc-schema +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | diff --git a/docs/generators/java.md b/docs/generators/java.md index 84b9056b7a0f..6637e95eed1b 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -55,4 +55,5 @@ sidebar_label: java |feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false| |useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false| |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| -|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.8.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.8.x
**feign**
HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.8.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit**
HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.8.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.8.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.8.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.8.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x. Only for Java8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
|okhttp-gson| +|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**feign**
HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.9.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit**
HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
|okhttp-gson| +|serializationLibrary|Serialization library, default depends from the library|
**jackson**
Use Jackson as serialization library
**gson**
Use Gson as serialization library
|null| diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 161ca6d0a967..4c18a6165c9d 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -14,6 +14,7 @@ sidebar_label: kotlin-server |artifactId|Generated artifact id (name of jar).| |kotlin-server| |artifactVersion|Generated artifact's package version.| |1.0.0| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |library|library template (sub-template)|
**ktor**
ktor framework
|ktor| |featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index c194143dbfab..9b690b12da5a 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -14,6 +14,7 @@ sidebar_label: kotlin-spring |artifactId|Generated artifact id (name of jar).| |openapi-spring| |artifactVersion|Generated artifact's package version.| |1.0.0| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |title|server title name or client service name| |OpenAPI Kotlin Spring| |basePackage|base package (invokerPackage) for generated code| |org.openapitools| diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md new file mode 100644 index 000000000000..9677fe623926 --- /dev/null +++ b/docs/generators/kotlin-vertx.md @@ -0,0 +1,18 @@ + +--- +id: generator-opts-server-kotlin-vertx +title: Config Options for kotlin-vertx +sidebar_label: kotlin-vertx +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sourceFolder|source folder for generated code| |src/main/kotlin| +|packageName|Generated artifact package name.| |org.openapitools| +|apiSuffix|suffix for api classes| |Api| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|artifactId|Generated artifact id (name of jar).| |null| +|artifactVersion|Generated artifact's package version.| |1.0.0| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|parcelizeModels|toggle "@Parcelize" for generated models| |null| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 008cf3ccce91..264842d4bb20 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -14,6 +14,8 @@ sidebar_label: kotlin |artifactId|Generated artifact id (name of jar).| |kotlin-client| |artifactVersion|Generated artifact's package version.| |1.0.0| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |parcelizeModels|toggle "@Parcelize" for generated models| |null| -|dateLibrary|Option. Date library to use|
**string**
String
**java8**
Java 8 native JSR310
**threetenbp**
Threetenbp
|java8| +|dateLibrary|Option. Date library to use|
**string**
String
**java8**
Java 8 native JSR310 (jvm only)
**threetenbp**
Threetenbp (jvm only)
|java8| |collectionType|Option. Collection type to use|
**array**
kotlin.Array
**list**
kotlin.collections.List
|array| +|library|Library template (sub-template) to use|
**jvm**
Platform: Java Virtual Machine. HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.
|jvm| diff --git a/docs/generators/nim.md b/docs/generators/nim.md new file mode 100644 index 000000000000..228226876af6 --- /dev/null +++ b/docs/generators/nim.md @@ -0,0 +1,13 @@ + +--- +id: generator-opts-client-nim +title: Config Options for nim +sidebar_label: nim +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md new file mode 100644 index 000000000000..87507ed7c8f2 --- /dev/null +++ b/docs/generators/protobuf-schema.md @@ -0,0 +1,9 @@ + +--- +id: generator-opts-config-protobuf-schema +title: Config Options for protobuf-schema +sidebar_label: protobuf-schema +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index af45a951615e..ecac8db58980 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -19,3 +19,5 @@ sidebar_label: typescript-fetch |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.| |true| +|prefixParameterInterfaces|Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.| |false| +|typescriptThreePlus|Setting this property to true will generate TypeScript 3.6+ compatible code.| |false| diff --git a/docs/migration-from-swagger-codegen.md b/docs/migration-from-swagger-codegen.md index dc5ddacfe8e6..d2c57b7d8df0 100644 --- a/docs/migration-from-swagger-codegen.md +++ b/docs/migration-from-swagger-codegen.md @@ -3,7 +3,7 @@ id: swagger-codegen-migration title: Migrating from Swagger Codegen --- -OpenAPI Generator is a fork of `swagger-codegen` between version `2.3.1` and `2.4.0`. +OpenAPI Generator is a fork of `swagger-codegen` between version `2.3.1` and `2.4.0`. For the reasons behind the fork, please refer to the [Q&A](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/qna.md). This community-driven version called "OpenAPI Generator" provides similar functionalities and can be used as drop-in replacement. This guide explains the major differences in order to help you with the migration. @@ -22,6 +22,7 @@ This guide explains the major differences in order to help you with the migratio - [New fully qualified name for the classes](#new-fully-qualified-name-for-the-classes) - [Body parameter name](#body-parameter-name) - [Default basePath](#default-basepath) + - [Nullable](#nullable) ## New docker images @@ -250,3 +251,7 @@ If your API client is using named parameters in the function call (e.g. Perl req ## Default basePath The default `basePath` has been changed from `https://localhost` to `http://localhost` (http without s) + +## Nullable + +OpenAPI spec v3 has better support for `nullable`. If you're still using OpenAPI/Swagger spec v2, please use `x-nullable: true` instead. diff --git a/docs/usage.md b/docs/usage.md index 3881595d4626..3ee12db6824a 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -38,9 +38,15 @@ NAME openapi-generator-cli list - Lists the available generators SYNOPSIS - openapi-generator-cli list [(-s | --short)] + openapi-generator-cli list [(-i | --include )] + [(-s | --short)] OPTIONS + -i , --include + comma-separated list of stability indexes to include (value: + all,beta,stable,experimental,deprecated). Excludes deprecated by + default. + -s, --short shortened output (suitable for scripting) @@ -210,13 +216,14 @@ This command takes one or more parameters representing the args list you would o ```bash openapi-generator completion config-help ---named-header -o --output +--named-header -g --generator-name --l ---lang +-f +--format +--markdown-header ``` An example bash completion script can be found in the repo at [scripts/openapi-generator-cli-completion.bash](https://github.com/OpenAPITools/openapi-generator/blob/master/scripts/openapi-generator-cli-completion.bash). diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 380bfee8f3d4..5ff19ccd73fc 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT ../.. diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java index 929a1334141d..16d8125b46c8 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java @@ -178,6 +178,10 @@ public class Generate implements Runnable { @Option(name = {"--library"}, title = "library", description = CodegenConstants.LIBRARY_DESC) private String library; + @Option(name = {"--git-host"}, title = "git host", + description = CodegenConstants.GIT_HOST_DESC) + private String gitHost; + @Option(name = {"--git-user-id"}, title = "git user id", description = CodegenConstants.GIT_USER_ID_DESC) private String gitUserId; @@ -343,6 +347,10 @@ public void run() { configurator.setLibrary(library); } + if (isNotEmpty(gitHost)) { + configurator.setGitHost(gitHost); + } + if (isNotEmpty(gitUserId)) { configurator.setGitUserId(gitUserId); } diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java index afffaae90f51..340afe93395a 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java @@ -5,15 +5,14 @@ import io.airlift.airline.Command; import io.airlift.airline.Option; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConfigLoader; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; +import java.util.*; import java.util.stream.Collectors; // NOTE: List can later have subcommands such as list languages, list types, list frameworks, etc. @@ -26,9 +25,31 @@ public class ListGenerators implements Runnable { @Option(name = {"-d", "--docsite" }, description = "format for docusaurus site output", hidden = true) private Boolean docusaurus = false; + @Option(name = {"-i", "--include" }, + description = "comma-separated list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.", + allowedValues = { "all", "beta", "stable", "experimental", "deprecated" }) + private String include = "stable,beta,experimental"; + @Override public void run() { - List generators = CodegenConfigLoader.getAll(); + List generators = new ArrayList<>(); + List stabilities = Arrays.asList(Stability.values()); + + if (!StringUtils.isEmpty(include)) { + List includes = Arrays.asList(include.split(",")); + if (includes.size() != 0 && !includes.contains("all")) { + stabilities = includes.stream() + .map(Stability::forDescription) + .collect(Collectors.toList()); + } + } + + for (CodegenConfig codegenConfig : CodegenConfigLoader.getAll()) { + GeneratorMetadata meta = codegenConfig.getGeneratorMetadata(); + if (meta != null && stabilities.contains(meta.getStability())) { + generators.add(codegenConfig); + } + } StringBuilder sb = new StringBuilder(); diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 930400f3b2c0..ce75ae358ee9 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT ../.. diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java index 37d99044ba58..099df0a5fd3b 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java @@ -30,6 +30,7 @@ public final class GeneratorSettings implements Serializable { private static final Logger LOGGER = LoggerFactory.getLogger(GeneratorSettings.class); + private static String DEFAULT_GIT_HOST = "github.com"; private static String DEFAULT_GIT_USER_ID = "GIT_USER_ID"; private static String DEFAULT_GIT_REPO_ID = "GIT_REPO_ID"; private static String DEFAULT_RELEASE_NOTE = "Minor update"; @@ -54,6 +55,7 @@ public final class GeneratorSettings implements Serializable { private ImmutableMap reservedWordMappings; private ImmutableMap serverVariables; + private String gitHost; private String gitUserId; private String gitRepoId; private String releaseNote; @@ -256,6 +258,17 @@ public Map getServerVariables() { return serverVariables; } + /** + * Gets git host. e.g. gitlab.com. + *

+ * Generally used by git_push.sh in generated sources which support it. + * This value may also be used by templates in maven style references, READMEs, or other documentation. + * + * @return the git host + */ + public String getGitHost() { + return gitHost; + } /** * Gets git user id. e.g. openapitools. @@ -324,6 +337,7 @@ private GeneratorSettings(Builder builder) { languageSpecificPrimitives = ImmutableSet.copyOf(builder.languageSpecificPrimitives); reservedWordMappings = ImmutableMap.copyOf(builder.reservedWordMappings); serverVariables = ImmutableMap.copyOf(builder.serverVariables); + gitHost = builder.gitHost; gitUserId = builder.gitUserId; gitRepoId = builder.gitRepoId; releaseNote = builder.releaseNote; @@ -358,6 +372,9 @@ private GeneratorSettings(Builder builder) { if (isNotEmpty(modelNameSuffix)) { additional.put("modelNameSuffix", modelNameSuffix); } + if (isNotEmpty(gitHost)) { + additional.put("gitHost", gitHost); + } if (isNotEmpty(gitUserId)) { additional.put("gitUserId", gitUserId); } @@ -390,6 +407,7 @@ public GeneratorSettings() { } private void setDefaults() { + gitHost = DEFAULT_GIT_HOST; gitUserId = DEFAULT_GIT_USER_ID; gitRepoId = DEFAULT_GIT_REPO_ID; releaseNote = DEFAULT_RELEASE_NOTE; @@ -421,13 +439,28 @@ public static Builder newBuilder(GeneratorSettings copy) { builder.artifactId = copy.getArtifactId(); builder.artifactVersion = copy.getArtifactVersion(); builder.library = copy.getLibrary(); - builder.instantiationTypes = new HashMap<>(copy.getInstantiationTypes()); - builder.typeMappings = new HashMap<>(copy.getTypeMappings()); - builder.additionalProperties = new HashMap<>(copy.getAdditionalProperties()); - builder.importMappings = new HashMap<>(copy.getImportMappings()); - builder.languageSpecificPrimitives = new HashSet<>(copy.getLanguageSpecificPrimitives()); - builder.reservedWordMappings = new HashMap<>(copy.getReservedWordMappings()); - builder.serverVariables = new HashMap<>(copy.getServerVariables()); + if (copy.getInstantiationTypes() != null) { + builder.instantiationTypes.putAll(copy.getInstantiationTypes()); + } + if (copy.getTypeMappings() != null) { + builder.typeMappings.putAll(copy.getTypeMappings()); + } + if (copy.getAdditionalProperties() != null) { + builder.additionalProperties.putAll(copy.getAdditionalProperties()); + } + if (copy.getImportMappings() != null) { + builder.importMappings.putAll(copy.getImportMappings()); + } + if (copy.getLanguageSpecificPrimitives() != null) { + builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives()); + } + if (copy.getReservedWordMappings() != null) { + builder.reservedWordMappings.putAll(copy.getReservedWordMappings()); + } + if (copy.getServerVariables() != null) { + builder.serverVariables.putAll(copy.getServerVariables()); + } + builder.gitHost = copy.getGitHost(); builder.gitUserId = copy.getGitUserId(); builder.gitRepoId = copy.getGitRepoId(); builder.releaseNote = copy.getReleaseNote(); @@ -459,6 +492,7 @@ public static final class Builder { private Set languageSpecificPrimitives; private Map reservedWordMappings; private Map serverVariables; + private String gitHost; private String gitUserId; private String gitRepoId; private String releaseNote; @@ -476,6 +510,7 @@ public Builder() { reservedWordMappings = new HashMap<>(); serverVariables = new HashMap<>(); + gitHost = DEFAULT_GIT_HOST; gitUserId = DEFAULT_GIT_USER_ID; gitRepoId = DEFAULT_GIT_REPO_ID; releaseNote = DEFAULT_RELEASE_NOTE; @@ -769,6 +804,17 @@ public Builder withServerVariable(String key, String value) { return this; } + /** + * Sets the {@code gitHost} and returns a reference to this Builder so that the methods can be chained together. + * + * @param gitHost the {@code gitHost} to set + * @return a reference to this Builder + */ + public Builder withGitHost(String gitHost) { + this.gitHost = gitHost; + return this; + } + /** * Sets the {@code gitUserId} and returns a reference to this Builder so that the methods can be chained together. * @@ -846,6 +892,7 @@ public String toString() { ", importMappings=" + importMappings + ", languageSpecificPrimitives=" + languageSpecificPrimitives + ", reservedWordMappings=" + reservedWordMappings + + ", gitHost='" + gitHost + '\'' + ", gitUserId='" + gitUserId + '\'' + ", gitRepoId='" + gitRepoId + '\'' + ", releaseNote='" + releaseNote + '\'' + @@ -875,6 +922,7 @@ public boolean equals(Object o) { Objects.equals(getImportMappings(), that.getImportMappings()) && Objects.equals(getLanguageSpecificPrimitives(), that.getLanguageSpecificPrimitives()) && Objects.equals(getReservedWordMappings(), that.getReservedWordMappings()) && + Objects.equals(getGitHost(), that.getGitHost()) && Objects.equals(getGitUserId(), that.getGitUserId()) && Objects.equals(getGitRepoId(), that.getGitRepoId()) && Objects.equals(getReleaseNote(), that.getReleaseNote()) && @@ -901,6 +949,7 @@ public int hashCode() { getImportMappings(), getLanguageSpecificPrimitives(), getReservedWordMappings(), + getGitHost(), getGitUserId(), getGitRepoId(), getReleaseNote(), 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 2f506ac15ff2..bf13cacf7b21 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 @@ -33,38 +33,48 @@ public class WorkflowSettings { private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowSettings.class); + public static final String DEFAULT_OUTPUT_DIR = "."; + public static final boolean DEFAULT_VERBOSE = false; + public static final boolean DEFAULT_SKIP_OVERWRITE = false; + public static final boolean DEFAULT_REMOVE_OPERATION_ID_PREFIX = false; + public static final boolean DEFAULT_LOG_TO_STDERR = false; + public static final boolean DEFAULT_VALIDATE_SPEC = true; + public static final boolean DEFAULT_ENABLE_POST_PROCESS_FILE = false; + public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false; + public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true; + public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; + public static final ImmutableMap DEFAULT_SYSTEM_PROPERTIES = ImmutableMap.of(); private String inputSpec; - private String outputDir; - private boolean verbose; - private boolean skipOverwrite; - private boolean removeOperationIdPrefix; - private boolean logToStderr; - private boolean validateSpec; - private boolean enablePostProcessFile; - private boolean enableMinimalUpdate; - private boolean strictSpecBehavior; + private String outputDir = DEFAULT_OUTPUT_DIR; + private boolean verbose = DEFAULT_VERBOSE; + private boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE; + private boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX; + private boolean logToStderr = DEFAULT_LOG_TO_STDERR; + private boolean validateSpec = DEFAULT_VALIDATE_SPEC; + private boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; + private boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; + private boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; private String templateDir; - private String templatingEngineName; + private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; - private ImmutableMap systemProperties; + private ImmutableMap systemProperties = DEFAULT_SYSTEM_PROPERTIES; private WorkflowSettings(Builder builder) { - setDefaults(); - inputSpec = builder.inputSpec; - outputDir = builder.outputDir; - verbose = builder.verbose; - skipOverwrite = builder.skipOverwrite; - removeOperationIdPrefix = builder.removeOperationIdPrefix; - logToStderr = builder.logToStderr; - validateSpec = builder.validateSpec; - enablePostProcessFile = builder.enablePostProcessFile; - enableMinimalUpdate = builder.enableMinimalUpdate; - strictSpecBehavior = builder.strictSpecBehavior; - templateDir = builder.templateDir; - templatingEngineName = builder.templatingEngineName; - ignoreFileOverride = builder.ignoreFileOverride; - systemProperties = ImmutableMap.copyOf(builder.systemProperties); + this.inputSpec = builder.inputSpec; + this.outputDir = builder.outputDir; + this.verbose = builder.verbose; + this.skipOverwrite = builder.skipOverwrite; + this.removeOperationIdPrefix = builder.removeOperationIdPrefix; + this.logToStderr = builder.logToStderr; + this.validateSpec = builder.validateSpec; + this.enablePostProcessFile = builder.enablePostProcessFile; + this.enableMinimalUpdate = builder.enableMinimalUpdate; + this.strictSpecBehavior = builder.strictSpecBehavior; + this.templateDir = builder.templateDir; + this.templatingEngineName = builder.templatingEngineName; + this.ignoreFileOverride = builder.ignoreFileOverride; + this.systemProperties = ImmutableMap.copyOf(builder.systemProperties); } /** @@ -72,14 +82,7 @@ private WorkflowSettings(Builder builder) { */ @SuppressWarnings("unused") public WorkflowSettings() { - setDefaults(); - systemProperties = ImmutableMap.of(); - } - private void setDefaults(){ - validateSpec = true; - strictSpecBehavior = true; - outputDir = "."; } public static Builder newBuilder() { @@ -87,7 +90,7 @@ public static Builder newBuilder() { } public static Builder newBuilder(WorkflowSettings copy) { - Builder builder = new Builder(); + Builder builder = newBuilder(); builder.inputSpec = copy.getInputSpec(); builder.outputDir = copy.getOutputDir(); builder.verbose = copy.isVerbose(); @@ -257,24 +260,24 @@ public Map getSystemProperties() { @SuppressWarnings("unused") public static final class Builder { private String inputSpec; - private String outputDir; - private boolean verbose; - private boolean skipOverwrite; - private boolean removeOperationIdPrefix; - private boolean logToStderr; - private boolean validateSpec; - private boolean enablePostProcessFile; - private boolean enableMinimalUpdate; - private boolean strictSpecBehavior; + private String outputDir = DEFAULT_OUTPUT_DIR; + private Boolean verbose = DEFAULT_VERBOSE; + private Boolean skipOverwrite = DEFAULT_SKIP_OVERWRITE; + private Boolean removeOperationIdPrefix = DEFAULT_REMOVE_OPERATION_ID_PREFIX; + private Boolean logToStderr = DEFAULT_LOG_TO_STDERR; + private Boolean validateSpec = DEFAULT_VALIDATE_SPEC; + private Boolean enablePostProcessFile = DEFAULT_ENABLE_POST_PROCESS_FILE; + private Boolean enableMinimalUpdate = DEFAULT_ENABLE_MINIMAL_UPDATE; + private Boolean strictSpecBehavior = DEFAULT_STRICT_SPEC_BEHAVIOR; private String templateDir; - private String templatingEngineName; + private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; - private Map systemProperties; + private Map systemProperties = new HashMap<>();; private Builder() { - systemProperties = new HashMap<>(); } + /** * Sets the {@code inputSpec} and returns a reference to this Builder so that the methods can be chained together. * @@ -282,7 +285,9 @@ private Builder() { * @return a reference to this Builder */ public Builder withInputSpec(String inputSpec) { - this.inputSpec = inputSpec; + if (inputSpec != null) { + this.inputSpec = inputSpec; + } return this; } @@ -293,7 +298,11 @@ public Builder withInputSpec(String inputSpec) { * @return a reference to this Builder */ public Builder withOutputDir(String outputDir) { - this.outputDir = Paths.get(outputDir).toAbsolutePath().toString();; + if (outputDir != null ) { + this.outputDir = Paths.get(outputDir).toAbsolutePath().toString(); + } else { + this.outputDir = DEFAULT_OUTPUT_DIR; + } return this; } @@ -303,8 +312,8 @@ public Builder withOutputDir(String outputDir) { * @param verbose the {@code verbose} to set * @return a reference to this Builder */ - public Builder withVerbose(boolean verbose) { - this.verbose = verbose; + public Builder withVerbose(Boolean verbose) { + this.verbose = verbose != null ? verbose : Boolean.valueOf(DEFAULT_VERBOSE); return this; } @@ -314,8 +323,8 @@ public Builder withVerbose(boolean verbose) { * @param skipOverwrite the {@code skipOverwrite} to set * @return a reference to this Builder */ - public Builder withSkipOverwrite(boolean skipOverwrite) { - this.skipOverwrite = skipOverwrite; + public Builder withSkipOverwrite(Boolean skipOverwrite) { + this.skipOverwrite = skipOverwrite != null ? skipOverwrite : Boolean.valueOf(DEFAULT_SKIP_OVERWRITE); return this; } @@ -325,8 +334,8 @@ public Builder withSkipOverwrite(boolean skipOverwrite) { * @param removeOperationIdPrefix the {@code removeOperationIdPrefix} to set * @return a reference to this Builder */ - public Builder withRemoveOperationIdPrefix(boolean removeOperationIdPrefix) { - this.removeOperationIdPrefix = removeOperationIdPrefix; + public Builder withRemoveOperationIdPrefix(Boolean removeOperationIdPrefix) { + this.removeOperationIdPrefix = removeOperationIdPrefix != null ? removeOperationIdPrefix : Boolean.valueOf(DEFAULT_REMOVE_OPERATION_ID_PREFIX); return this; } @@ -336,8 +345,8 @@ public Builder withRemoveOperationIdPrefix(boolean removeOperationIdPrefix) { * @param logToStderr the {@code logToStderr} to set * @return a reference to this Builder */ - public Builder withLogToStderr(boolean logToStderr) { - this.logToStderr = logToStderr; + public Builder withLogToStderr(Boolean logToStderr) { + this.logToStderr = logToStderr != null ? logToStderr : Boolean.valueOf(DEFAULT_LOG_TO_STDERR); return this; } @@ -347,8 +356,8 @@ public Builder withLogToStderr(boolean logToStderr) { * @param validateSpec the {@code validateSpec} to set * @return a reference to this Builder */ - public Builder withValidateSpec(boolean validateSpec) { - this.validateSpec = validateSpec; + public Builder withValidateSpec(Boolean validateSpec) { + this.validateSpec = validateSpec != null ? validateSpec : Boolean.valueOf(DEFAULT_VALIDATE_SPEC); return this; } @@ -358,8 +367,8 @@ public Builder withValidateSpec(boolean validateSpec) { * @param enablePostProcessFile the {@code enablePostProcessFile} to set * @return a reference to this Builder */ - public Builder withEnablePostProcessFile(boolean enablePostProcessFile) { - this.enablePostProcessFile = enablePostProcessFile; + public Builder withEnablePostProcessFile(Boolean enablePostProcessFile) { + this.enablePostProcessFile = enablePostProcessFile != null ? enablePostProcessFile : Boolean.valueOf(DEFAULT_ENABLE_POST_PROCESS_FILE); return this; } @@ -369,8 +378,8 @@ public Builder withEnablePostProcessFile(boolean enablePostProcessFile) { * @param enableMinimalUpdate the {@code enableMinimalUpdate} to set * @return a reference to this Builder */ - public Builder withEnableMinimalUpdate(boolean enableMinimalUpdate) { - this.enableMinimalUpdate = enableMinimalUpdate; + public Builder withEnableMinimalUpdate(Boolean enableMinimalUpdate) { + this.enableMinimalUpdate = enableMinimalUpdate != null ? enableMinimalUpdate : Boolean.valueOf(DEFAULT_ENABLE_MINIMAL_UPDATE); return this; } @@ -380,8 +389,8 @@ public Builder withEnableMinimalUpdate(boolean enableMinimalUpdate) { * @param strictSpecBehavior the {@code strictSpecBehavior} to set * @return a reference to this Builder */ - public Builder withStrictSpecBehavior(boolean strictSpecBehavior) { - this.strictSpecBehavior = strictSpecBehavior; + public Builder withStrictSpecBehavior(Boolean strictSpecBehavior) { + this.strictSpecBehavior = strictSpecBehavior != null ? strictSpecBehavior : Boolean.valueOf(DEFAULT_STRICT_SPEC_BEHAVIOR); return this; } @@ -392,9 +401,7 @@ public Builder withStrictSpecBehavior(boolean strictSpecBehavior) { * @return a reference to this Builder */ public Builder withTemplateDir(String templateDir) { - if (templateDir == null) { - this.templateDir = null; - } else { + if (templateDir != null) { File f = new File(templateDir); // check to see if the folder exists @@ -416,7 +423,7 @@ public Builder withTemplateDir(String templateDir) { * @return a reference to this Builder */ public Builder withTemplatingEngineName(String templatingEngineName) { - this.templatingEngineName = templatingEngineName; + this.templatingEngineName = templatingEngineName != null ? templatingEngineName : DEFAULT_TEMPLATING_ENGINE_NAME; return this; } @@ -438,7 +445,9 @@ public Builder withIgnoreFileOverride(String ignoreFileOverride) { * @return a reference to this Builder */ public Builder withSystemProperties(Map systemProperties) { - this.systemProperties = systemProperties; + if (systemProperties != null) { + this.systemProperties = systemProperties; + } return this; } diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java index 8547ea9b10d0..00c672284e22 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/Stability.java @@ -50,4 +50,14 @@ public enum Stability { * @return The descriptive value of this enum. */ public String value() { return description; } + + public static Stability forDescription(String description) { + for (Stability value: values()) { + if (value.description.equals(description)) { + return value; + } + } + + throw new IllegalArgumentException("description not found in the available values."); + } } 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 new file mode 100644 index 000000000000..b958c9decf4a --- /dev/null +++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.config; + +import org.testng.annotations.Test; + +import java.nio.file.Paths; + +import static org.testng.Assert.*; + +public class WorkflowSettingsTest { + @Test + public void defaultValuesNotOverriddenByNulls(){ + WorkflowSettings settings = WorkflowSettings.newBuilder() + .withOutputDir(null) + .withVerbose(null) + .withSkipOverwrite(null) + .withRemoveOperationIdPrefix(null) + .withLogToStderr(null) + .withValidateSpec(null) + .withEnablePostProcessFile(null) + .withEnableMinimalUpdate(null) + .withStrictSpecBehavior(null) + .build(); + + assertEquals(settings.getOutputDir(), "."); + assertFalse(settings.isVerbose()); + assertFalse(settings.isSkipOverwrite()); + assertFalse(settings.isRemoveOperationIdPrefix()); + assertFalse(settings.isLogToStderr()); + assertTrue(settings.isValidateSpec()); + assertFalse(settings.isEnablePostProcessFile()); + assertFalse(settings.isEnableMinimalUpdate()); + assertTrue(settings.isStrictSpecBehavior()); + } + + private void assertOnChangesToDefaults(WorkflowSettings defaults) { + WorkflowSettings settings = WorkflowSettings.newBuilder() + .withOutputDir("output") + .withVerbose(true) + .withSkipOverwrite(true) + .withRemoveOperationIdPrefix(true) + .withLogToStderr(true) + .withValidateSpec(false) + .withEnablePostProcessFile(true) + .withEnableMinimalUpdate(true) + .withStrictSpecBehavior(false) + .build(); + + assertNotEquals(defaults.getOutputDir(), settings.getOutputDir()); + assertEquals(settings.getOutputDir(), Paths.get("output").toAbsolutePath().toString()); + + assertNotEquals(defaults.isVerbose(), settings.isVerbose()); + assertTrue(settings.isVerbose()); + + assertNotEquals(defaults.isSkipOverwrite(), settings.isSkipOverwrite()); + assertTrue(settings.isSkipOverwrite()); + + assertNotEquals(defaults.isRemoveOperationIdPrefix(), settings.isRemoveOperationIdPrefix()); + assertTrue(settings.isRemoveOperationIdPrefix()); + + assertNotEquals(defaults.isLogToStderr(), settings.isLogToStderr()); + assertTrue(settings.isLogToStderr()); + + assertNotEquals(defaults.isValidateSpec(), settings.isValidateSpec()); + assertFalse(settings.isValidateSpec()); + + assertNotEquals(defaults.isEnablePostProcessFile(), settings.isEnablePostProcessFile()); + assertTrue(settings.isEnablePostProcessFile()); + + assertNotEquals(defaults.isEnableMinimalUpdate(), settings.isEnableMinimalUpdate()); + assertTrue(settings.isEnableMinimalUpdate()); + + assertNotEquals(defaults.isStrictSpecBehavior(), settings.isStrictSpecBehavior()); + assertFalse(settings.isStrictSpecBehavior()); + } + + @Test + public void defaultValuesCanBeChangedClassConstructor(){ + WorkflowSettings defaults = new WorkflowSettings(); + assertOnChangesToDefaults(defaults); + } + + @Test + public void defaultValuesCanBeChangedBuilder(){ + WorkflowSettings defaults = WorkflowSettings.newBuilder().build(); + assertOnChangesToDefaults(defaults); + } +} \ No newline at end of file diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index d35c7240ed8e..68d9947f4d31 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.1.0" + id "org.openapi.generator" version "4.1.1" } ---- @@ -61,7 +61,7 @@ buildscript { // url "https://plugins.gradle.org/m2/" } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.0" + classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.1" } } @@ -202,6 +202,11 @@ apply plugin: 'org.openapi.generator' |None |Reference the library template (sub-template) of a generator. +|gitHost +|String +|github.com +|Git user ID, e.g. gitlab.com. + |gitUserId |String |None @@ -374,6 +379,18 @@ openApiGenerate { |=== +=== openApiGenerators + +.Options +|=== +|Key |Data Type |Default |Description + +|include +|String[] +|None +|A list of stability indexes to include (values: all,beta,stable,experimental,deprecated). Excludes deprecated by default. + +|=== == Examples @@ -609,7 +626,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' - classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.0') { + classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.1') { exclude group: 'com.google.guava' } } diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index a4deb47d1ae7..e6f608dc78bc 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.1.1-SNAPSHOT +openApiGeneratorVersion=4.1.3-SNAPSHOT # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index e2448112d5f0..42ddf2e6f3c8 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT ../.. @@ -20,6 +20,20 @@ 4.10.2 + + + Gradle Releases + Gradle Releases repository + https://repo.gradle.org/gradle/libs-releases-local/ + + true + + + false + + + + org.openapitools 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 33dc25912293..ea472e09a496 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md @@ -17,5 +17,5 @@ gradle generateGoWithInvalidSpec The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: ```bash -gradle -PopenApiGeneratorVersion=4.1.0 openApiValidate +gradle -PopenApiGeneratorVersion=4.1.1 openApiValidate ``` 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 149e1997c3db..464b884ea309 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.0 +openApiGeneratorVersion=4.1.1 # /RELEASE_VERSION diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt index 21514aa25939..07afe14b5e96 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt @@ -19,6 +19,7 @@ package org.openapitools.generator.gradle.plugin import org.gradle.api.Plugin import org.gradle.api.Project import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGenerateExtension +import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGeneratorsExtension import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorMetaExtension import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorValidateExtension import org.openapitools.generator.gradle.plugin.tasks.GenerateTask @@ -53,12 +54,20 @@ class OpenApiGeneratorPlugin : Plugin { project ) + val generators = extensions.create( + "openApiGenerators", + OpenApiGeneratorGeneratorsExtension::class.java, + project + ) + generate.outputDir.set("$buildDir/generate-resources/main") tasks.apply { create("openApiGenerators", GeneratorsTask::class.java) { group = pluginGroup description = "Lists generators available via Open API Generators." + + include.set(generators.include) } create("openApiMeta", MetaTask::class.java) { @@ -107,6 +116,7 @@ class OpenApiGeneratorPlugin : Plugin { id.set(generate.id) version.set(generate.version) library.set(generate.library) + gitHost.set(generate.gitHost) gitUserId.set(generate.gitUserId) gitRepoId.set(generate.gitRepoId) releaseNote.set(generate.releaseNote) diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt index fe44ddaf26de..01e959447fff 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt @@ -160,6 +160,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) { */ val library = project.objects.property() + /** + * Git host, e.g. gitlab.com. + */ + val gitHost = project.objects.property() + /** * Git user ID, e.g. openapitools. */ diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGeneratorsExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGeneratorsExtension.kt new file mode 100644 index 000000000000..53de4c037e9f --- /dev/null +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGeneratorsExtension.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.generator.gradle.plugin.extensions + +import org.gradle.api.Project +import org.gradle.api.tasks.Internal +import org.gradle.kotlin.dsl.listProperty +import org.openapitools.codegen.meta.Stability + +/** + * Gradle project level extension object definition for the generators task + * + * @author Jim Schubert + */ +open class OpenApiGeneratorGeneratorsExtension(project: Project) { + /** + * A list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default. + */ + val include = project.objects.listProperty() + + init { + applyDefaults() + } + + @Suppress("MemberVisibilityCanBePrivate") + fun applyDefaults(){ + include.set(Stability.values().map { s -> s.value() }.filterNot { it == Stability.DEPRECATED.value() }) + } +} diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt index 7f6be14382fa..83f206fd491d 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt @@ -204,6 +204,12 @@ open class GenerateTask : DefaultTask() { @get:Internal val library = project.objects.property() + /** + * Git host, e.g. gitlab.com. + */ + @get:Internal + val gitHost = project.objects.property() + /** * Git user ID, e.g. openapitools. */ @@ -510,6 +516,10 @@ open class GenerateTask : DefaultTask() { configurator.setLibrary(value) } + gitHost.ifNotEmpty { value -> + configurator.setGitHost(value) + } + gitUserId.ifNotEmpty { value -> configurator.setGitUserId(value) } diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GeneratorsTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GeneratorsTask.kt index f0a8963059bd..b32a1c1e9bc9 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GeneratorsTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GeneratorsTask.kt @@ -17,9 +17,11 @@ package org.openapitools.generator.gradle.plugin.tasks import org.gradle.api.DefaultTask +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.internal.logging.text.StyledTextOutput import org.gradle.internal.logging.text.StyledTextOutputFactory +import org.gradle.kotlin.dsl.listProperty import org.openapitools.codegen.CodegenConfigLoader import org.openapitools.codegen.CodegenType import org.openapitools.codegen.meta.GeneratorMetadata @@ -35,6 +37,12 @@ import org.openapitools.codegen.meta.Stability * @author Jim Schubert */ open class GeneratorsTask : DefaultTask() { + /** + * A list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default. + */ + @get:Internal + val include = project.objects.listProperty() + @Suppress("unused") @TaskAction fun doWork() { @@ -45,6 +53,15 @@ open class GeneratorsTask : DefaultTask() { StringBuilder().apply { val types = CodegenType.values() + val stabilities = if (include.isPresent) { + when { + include.get().contains("all") -> Stability.values().toList() + else -> include.get().map { Stability.forDescription(it) } + } + } else { + Stability.values().filterNot { it == Stability.DEPRECATED } + } + append("The following generators are available:") append(System.lineSeparator()) @@ -56,21 +73,23 @@ open class GeneratorsTask : DefaultTask() { generators.filter { it.tag == type } .sortedBy { it.name } - .forEach({ generator -> + .forEach { generator -> val meta: GeneratorMetadata? = generator.generatorMetadata + val include = stabilities.contains(meta?.stability) + if (include) { + append(" - ") + append(generator.name) - append(" - ") - append(generator.name) - - meta?.stability?.let { - if (it != Stability.STABLE) { - append(" (${it.value()})") + meta?.stability?.let { + if (it != Stability.STABLE) { + append(" (${it.value()})") + } } - } - append(System.lineSeparator()) - }) + append(System.lineSeparator()) + } + } append(System.lineSeparator()) append(System.lineSeparator()) diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index 2161502a97b3..2d02194aab30 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.1.0 + 4.1.1 @@ -91,6 +91,7 @@ mvn clean compile | `reservedWordsMappings` | `openapi.generator.maven.plugin.reservedWordsMappings` | specifies how a reserved name should be escaped to. Otherwise, the default `_` is used. For example `id=identifier`. You can also have multiple occurrences of this option | `skipIfSpecIsUnchanged` | `codegen.skipIfSpecIsUnchanged` | Skip the execution if the source file is older than the output folder (`false` by default. Can also be set globally through the `codegen.skipIfSpecIsUnchanged` property) | `engine` | `openapi.generator.maven.plugin.engine` | The name of templating engine to use, "mustache" (default) or "handlebars" (beta) +| `httpUserAgent` | `openapi.generator.maven.plugin.httpUserAgent` | Sets custom User-Agent header value ### Custom Generator diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index f7f5df89de08..b19be19ac1f8 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,10 +13,11 @@ org.openapitools openapi-generator-maven-plugin - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT + default generate @@ -39,16 +40,46 @@ jersey2 + + remote + generate-sources + + generate + + + + https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml + + + java + + + + + + joda + + + + jersey2 + + ${project.build.directory}/generated-sources/remote-openapi + remote.org.openapitools.client.api + remote.org.openapitools.client.model + remote.org.openapitools.client + + org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.8.1 - 1.7 - 1.7 - none + 1.7 + 1.7 + none @@ -120,7 +151,12 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} - + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + @@ -146,6 +182,7 @@ 1.5.8 2.27 2.8.9 + 0.2.0 2.7 1.0.0 4.8.1 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index 6652de2d2658..ffbf4f24cd8d 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT @@ -57,11 +57,11 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.8.1 - 1.7 - 1.7 - none + 1.7 + 1.7 + none @@ -133,7 +133,12 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} - + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml index 944377917ece..5e4a60c7f1c9 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml @@ -16,6 +16,7 @@ 1.5.8 2.27 2.8.9 + 0.2.0 2.7 1.0.0 4.8.1 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 95dc5c71679b..9155e3e00489 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.0 + 4.1.1 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index df0297f8149d..6c559f97c45d 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.0 + 4.1.1 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 9fc0a05b107c..17338fba42f4 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT ../.. @@ -66,7 +66,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.5.2 + 3.6.0 true diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 552a44f25630..6a709267e407 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -20,7 +20,18 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty; import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*; +import io.swagger.v3.parser.core.models.AuthorizationValue; import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.nio.channels.ReadableByteChannel; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -42,6 +53,7 @@ import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.auth.AuthParser; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; import org.sonatype.plexus.build.incremental.BuildContext; @@ -97,6 +109,12 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "inputSpec", property = "openapi.generator.maven.plugin.inputSpec", required = true) private String inputSpec; + /** + * Git host, e.g. gitlab.com. + */ + @Parameter(name = "gitHost", property = "openapi.generator.maven.plugin.gitHost", required = false) + private String gitHost; + /** * Git user ID, e.g. swagger-api. */ @@ -206,6 +224,12 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "ignoreFileOverride", property = "openapi.generator.maven.plugin.ignoreFileOverride", required = false) private String ignoreFileOverride; + /** + * Sets custom User-Agent header value + */ + @Parameter(name = "httpUserAgent", property = "openapi.generator.maven.plugin.httpUserAgent", required = false) + private String httpUserAgent; + /** * To remove operationId prefix (e.g. user_getName => getName) */ @@ -417,7 +441,7 @@ public void execute() throws MojoExecutionException { if (inputSpecFile.exists()) { File storedInputSpecHashFile = getHashFile(inputSpecFile); if(storedInputSpecHashFile.exists()) { - String inputSpecHash = Files.asByteSource(inputSpecFile).hash(Hashing.sha256()).toString(); + String inputSpecHash = calculateInputSpecHash(inputSpecFile); String storedInputSpecHash = Files.asCharSource(storedInputSpecHashFile, Charsets.UTF_8).read(); if (inputSpecHash.equals(storedInputSpecHash)) { getLog().info( @@ -450,6 +474,10 @@ public void execute() throws MojoExecutionException { configurator.setInputSpec(inputSpec); } + if (isNotEmpty(gitHost)) { + configurator.setGitHost(gitHost); + } + if (isNotEmpty(gitUserId)) { configurator.setGitUserId(gitUserId); } @@ -462,6 +490,10 @@ public void execute() throws MojoExecutionException { configurator.setIgnoreFileOverride(ignoreFileOverride); } + if (isNotEmpty(httpUserAgent)) { + configurator.setHttpUserAgent(httpUserAgent); + } + if (skipValidateSpec != null) { configurator.setValidateSpec(!skipValidateSpec); } @@ -700,12 +732,7 @@ public void execute() throws MojoExecutionException { // Store a checksum of the input spec File storedInputSpecHashFile = getHashFile(inputSpecFile); - ByteSource inputSpecByteSource = - inputSpecFile.exists() - ? Files.asByteSource(inputSpecFile) - : CharSource.wrap(ClasspathHelper.loadFileFromClasspath(inputSpecFile.toString().replaceAll("\\\\","/"))) - .asByteSource(Charsets.UTF_8); - String inputSpecHash =inputSpecByteSource.hash(Hashing.sha256()).toString(); + String inputSpecHash = calculateInputSpecHash(inputSpecFile); if (storedInputSpecHashFile.getParent() != null && !new File(storedInputSpecHashFile.getParent()).exists()) { File parent = new File(storedInputSpecHashFile.getParent()); @@ -726,8 +753,75 @@ public void execute() throws MojoExecutionException { } } + /** + * Calculate openapi specification file hash. If specification is hosted on remote resource it is downloaded first + * + * @param inputSpecFile - Openapi specification input file to calculate it's hash. + * Does not taken into account if input spec is hosted on remote resource + * @return openapi specification file hash + * @throws IOException + */ + private String calculateInputSpecHash(File inputSpecFile) throws IOException { + + URL inputSpecRemoteUrl = inputSpecRemoteUrl(); + + File inputSpecTempFile = inputSpecFile; + + if (inputSpecRemoteUrl != null) { + inputSpecTempFile = File.createTempFile("openapi-spec", ".tmp"); + + URLConnection conn = inputSpecRemoteUrl.openConnection(); + if (isNotEmpty(auth)) { + List authList = AuthParser.parse(auth); + for (AuthorizationValue auth : authList) { + conn.setRequestProperty(auth.getKeyName(), auth.getValue()); + } + } + ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream()); + + FileOutputStream fileOutputStream = new FileOutputStream(inputSpecTempFile); + FileChannel fileChannel = fileOutputStream.getChannel(); + + fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE); + } + + ByteSource inputSpecByteSource = + inputSpecTempFile.exists() + ? Files.asByteSource(inputSpecTempFile) + : CharSource.wrap(ClasspathHelper.loadFileFromClasspath(inputSpecTempFile.toString().replaceAll("\\\\","/"))) + .asByteSource(Charsets.UTF_8); + + return inputSpecByteSource.hash(Hashing.sha256()).toString(); + } + + /** + * Try to parse inputSpec setting string into URL + * @return A valid URL or null if inputSpec is not a valid URL + */ + private URL inputSpecRemoteUrl(){ + try { + return new URI(inputSpec).toURL(); + } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) { + return null; + } + } + + /** + * Get specification hash file + * @param inputSpecFile - Openapi specification input file to calculate it's hash. + * Does not taken into account if input spec is hosted on remote resource + * @return a file with previously calculated hash + */ private File getHashFile(File inputSpecFile) { - return new File(output.getPath() + File.separator + ".openapi-generator" + File.separator + inputSpecFile.getName() + ".sha256"); + String name = inputSpecFile.getName(); + + URL url = inputSpecRemoteUrl(); + if (url != null) { + String[] segments = url.getPath().split("/"); + name = Files.getNameWithoutExtension(segments[segments.length - 1]); + } + + return new File(output.getPath() + File.separator + ".openapi-generator" + File.separator + name + ".sha256"); } private String getCompileSourceRoot() { @@ -737,8 +831,7 @@ private String getCompileSourceRoot() { final String sourceFolder = sourceFolderObject == null ? "src/main/java" : sourceFolderObject.toString(); - String sourceJavaFolder = output.toString() + "/" + sourceFolder; - return sourceJavaFolder; + return output.toString() + "/" + sourceFolder; } private void addCompileSourceRootIfConfigured() { @@ -783,4 +876,4 @@ private void adjustAdditionalProperties(final CodegenConfig config) { } } } -} +} \ No newline at end of file diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 391574c24d78..ccfde22b3121 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index e417dad64cd3..24dc11130edb 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT ../.. @@ -74,7 +74,7 @@ maven-compiler-plugin - 3.5.1 + 3.8.1 1.8 1.8 @@ -268,6 +268,12 @@ test + + com.github.javaparser + javaparser-core + 3.14.11 + test + org.reflections reflections @@ -294,7 +300,7 @@ org.mockito mockito-core - 2.23.0 + 3.0.0 test diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java index 47117826b990..5b587db411a5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java @@ -223,6 +223,10 @@ public interface CodegenConfig { */ String getLibrary(); + void setGitHost(String gitHost); + + String getGitHost(); + void setGitUserId(String gitUserId); String getGitUserId(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 50f35eff4b60..ef235748f261 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -202,12 +202,19 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String ENUM_PROPERTY_NAMING = "enumPropertyNaming"; public static final String ENUM_PROPERTY_NAMING_DESC = "Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'"; + // Allow different language generators to offer an option of serialization library. Each language specific + // Codegen constants should define a description and provide proper input validation for the value of serializationLibrary + public static final String SERIALIZATION_LIBRARY = "serializationLibrary"; + public static final String MODEL_NAME_PREFIX = "modelNamePrefix"; public static final String MODEL_NAME_PREFIX_DESC = "Prefix that will be prepended to all model names."; public static final String MODEL_NAME_SUFFIX = "modelNameSuffix"; public static final String MODEL_NAME_SUFFIX_DESC = "Suffix that will be appended to all model names."; + public static final String GIT_HOST = "gitHost"; + public static final String GIT_HOST_DESC = "Git host, e.g. gitlab.com."; + public static final String GIT_USER_ID = "gitUserId"; public static final String GIT_USER_ID_DESC = "Git user ID, e.g. openapitools."; @@ -308,4 +315,7 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String EXCEPTION_ON_FAILURE = "returnExceptionOnFailure"; public static final String EXCEPTION_ON_FAILURE_DESC = "Throw an exception on non success response codes"; + + public static final String ENUM_CLASS_PREFIX = "enumClassPrefix"; + public static final String ENUM_CLASS_PREFIX_DESC = "Prefix enum with class name"; } 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 e260972bd804..5efdbc6f10c1 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 @@ -161,7 +161,7 @@ public class DefaultCodegen implements CodegenConfig { protected Boolean sortParamsByRequiredFlag = true; protected Boolean ensureUniqueParams = true; protected Boolean allowUnicodeIdentifiers = false; - protected String gitUserId, gitRepoId, releaseNote; + protected String gitHost, gitUserId, gitRepoId, releaseNote; protected String httpUserAgent; protected Boolean hideGenerationTimestamp = true; // How to encode special characters like $ @@ -1118,7 +1118,7 @@ public DefaultCodegen() { typeMapping.put("file", "File"); typeMapping.put("UUID", "UUID"); typeMapping.put("URI", "URI"); - //typeMapping.put("BigDecimal", "BigDecimal"); //TODO need the mapping? + typeMapping.put("BigDecimal", "BigDecimal"); //TODO need the mapping? instantiationTypes = new HashMap(); @@ -1297,7 +1297,7 @@ public String toInstantiationType(Schema schema) { return instantiationTypes.get("map") + ""; } else if (ModelUtils.isArraySchema(schema)) { ArraySchema arraySchema = (ArraySchema) schema; - String inner = getSchemaType(arraySchema.getItems()); + String inner = getSchemaType(getSchemaItems(arraySchema)); return instantiationTypes.get("array") + "<" + inner + ">"; } else { return null; @@ -1512,6 +1512,15 @@ public String getSchemaType(Schema schema) { } + protected Schema getSchemaItems(ArraySchema schema) { + if (schema.getItems() != null) { + return schema.getItems(); + } else { + LOGGER.error("Undefined array inner type for `{}`. Default to String.", schema.getName()); + return new StringSchema().description("TODO default missing array inner type to string"); + } + } + /** * Return the name of the allOf schema * @@ -1877,6 +1886,7 @@ public CodegenModel fromModel(String name, Schema schema) { } else { // composition addProperties(properties, required, refSchema); + addProperties(allProperties, allRequired, refSchema); } } @@ -2229,11 +2239,10 @@ public CodegenProperty fromProperty(String name, Schema p) { property.isFreeFormObject = true; } else if (ModelUtils.isArraySchema(p)) { // default to string if inner item is undefined - Schema innerSchema = ModelUtils.unaliasSchema(this.openAPI, ((ArraySchema) p).getItems()); - if (innerSchema == null) { - LOGGER.error("Undefined array inner type for `{}`. Default to String.", p.getName()); - innerSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type"); - ((ArraySchema) p).setItems(innerSchema); + ArraySchema arraySchema = (ArraySchema) p; + Schema innerSchema = ModelUtils.unaliasSchema(this.openAPI, getSchemaItems(arraySchema)); + if (arraySchema.getItems() == null) { + arraySchema.setItems(innerSchema); } } else if (ModelUtils.isMapSchema(p)) { Schema innerSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getAdditionalProperties(p)); @@ -2311,11 +2320,10 @@ public CodegenProperty fromProperty(String name, Schema p) { if (itemName == null) { itemName = property.name; } - Schema innerSchema = ModelUtils.unaliasSchema(this.openAPI, ((ArraySchema) p).getItems()); - if (innerSchema == null) { - LOGGER.error("Undefined array inner type for `{}`. Default to String.", p.getName()); - innerSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type"); - ((ArraySchema) p).setItems(innerSchema); + ArraySchema arraySchema = (ArraySchema) p; + Schema innerSchema = ModelUtils.unaliasSchema(this.openAPI, getSchemaItems(arraySchema)); + if (arraySchema.getItems() == null) { + arraySchema.setItems(innerSchema); } CodegenProperty cp = fromProperty(itemName, innerSchema); updatePropertyForArray(property, cp); @@ -2345,8 +2353,9 @@ public CodegenProperty fromProperty(String name, Schema p) { // property.baseType = getSimpleRef(p.get$ref()); //} // --END of revision - property.isModel = ModelUtils.isModel(p); setNonArrayMapProperty(property, type); + Schema refOrCurrent = ModelUtils.getReferencedSchema(this.openAPI, p); + property.isModel = (ModelUtils.isComposedSchema(refOrCurrent) || ModelUtils.isObjectSchema(refOrCurrent)) && ModelUtils.isModel(refOrCurrent); } LOGGER.debug("debugging from property return: " + property); @@ -2534,6 +2543,76 @@ protected ApiResponse findMethodResponse(ApiResponses responses) { return responses.get(code); } + /** + * Set op's returnBaseType, returnType, examples etc. + * + * @param operation endpoint Operation + * @param schemas a map of the schemas in the openapi spec + * @param op endpoint CodegenOperation + * @param methodResponse the default ApiResponse for the endpoint + */ + protected void handleMethodResponse(Operation operation, + Map schemas, + CodegenOperation op, + ApiResponse methodResponse) { + Schema responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(methodResponse)); + + if (responseSchema != null) { + CodegenProperty cm = fromProperty("response", responseSchema); + + if (ModelUtils.isArraySchema(responseSchema)) { + ArraySchema as = (ArraySchema) responseSchema; + CodegenProperty innerProperty = fromProperty("response", getSchemaItems(as)); + op.returnBaseType = innerProperty.baseType; + } else if (ModelUtils.isMapSchema(responseSchema)) { + CodegenProperty innerProperty = fromProperty("response", ModelUtils.getAdditionalProperties(responseSchema)); + op.returnBaseType = innerProperty.baseType; + } else { + if (cm.complexType != null) { + op.returnBaseType = cm.complexType; + } else { + op.returnBaseType = cm.baseType; + } + } + + // generate examples + String exampleStatusCode = "200"; + for (String key : operation.getResponses().keySet()) { + if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) { + exampleStatusCode = key; + } + } + op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation)); + op.defaultResponse = toDefaultValue(responseSchema); + op.returnType = cm.dataType; + op.hasReference = schemas.containsKey(op.returnBaseType); + + // lookup discriminator + Schema schema = schemas.get(op.returnBaseType); + if (schema != null) { + CodegenModel cmod = fromModel(op.returnBaseType, schema); + op.discriminator = cmod.discriminator; + } + + if (cm.isContainer) { + op.returnContainer = cm.containerType; + if ("map".equals(cm.containerType)) { + op.isMapContainer = true; + } else if ("list".equalsIgnoreCase(cm.containerType)) { + op.isListContainer = true; + } else if ("array".equalsIgnoreCase(cm.containerType)) { + op.isListContainer = true; + } + } else { + op.returnSimpleType = true; + } + if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) { + op.returnTypeIsPrimitive = true; + } + } + addHeaders(methodResponse, op.responseHeaders); + } + /** * Convert OAS Operation object to Codegen Operation object * @@ -2626,62 +2705,7 @@ public CodegenOperation fromOperation(String path, op.responses.get(op.responses.size() - 1).hasMore = false; if (methodResponse != null) { - Schema responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(methodResponse)); - - if (responseSchema != null) { - CodegenProperty cm = fromProperty("response", responseSchema); - - if (ModelUtils.isArraySchema(responseSchema)) { - ArraySchema as = (ArraySchema) responseSchema; - CodegenProperty innerProperty = fromProperty("response", as.getItems()); - op.returnBaseType = innerProperty.baseType; - } else if (ModelUtils.isMapSchema(responseSchema)) { - CodegenProperty innerProperty = fromProperty("response", ModelUtils.getAdditionalProperties(responseSchema)); - op.returnBaseType = innerProperty.baseType; - } else { - if (cm.complexType != null) { - op.returnBaseType = cm.complexType; - } else { - op.returnBaseType = cm.baseType; - } - } - - // generate examples - String exampleStatusCode = "200"; - for (String key : operation.getResponses().keySet()) { - if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) { - exampleStatusCode = key; - } - } - op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation)); - op.defaultResponse = toDefaultValue(responseSchema); - op.returnType = cm.dataType; - op.hasReference = schemas.containsKey(op.returnBaseType); - - // lookup discriminator - Schema schema = schemas.get(op.returnBaseType); - if (schema != null) { - CodegenModel cmod = fromModel(op.returnBaseType, schema); - op.discriminator = cmod.discriminator; - } - - if (cm.isContainer) { - op.returnContainer = cm.containerType; - if ("map".equals(cm.containerType)) { - op.isMapContainer = true; - } else if ("list".equalsIgnoreCase(cm.containerType)) { - op.isListContainer = true; - } else if ("array".equalsIgnoreCase(cm.containerType)) { - op.isListContainer = true; - } - } else { - op.returnSimpleType = true; - } - if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) { - op.returnTypeIsPrimitive = true; - } - } - addHeaders(methodResponse, op.responseHeaders); + handleMethodResponse(operation, schemas, op, methodResponse); } } @@ -2708,11 +2732,13 @@ public CodegenOperation fromOperation(String path, CodegenParameter bodyParam = null; RequestBody requestBody = operation.getRequestBody(); if (requestBody != null) { - if (getContentType(requestBody) != null && - (getContentType(requestBody).toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || - getContentType(requestBody).toLowerCase(Locale.ROOT).startsWith("multipart/form-data"))) { + String contentType = getContentType(requestBody); + if (contentType != null && + (contentType.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || + contentType.toLowerCase(Locale.ROOT).startsWith("multipart"))) { // process form parameters formParams = fromRequestBodyToFormParameters(requestBody, imports); + op.isMultipart = contentType.toLowerCase(Locale.ROOT).startsWith("multipart"); for (CodegenParameter cp : formParams) { postProcessParameter(cp); } @@ -2901,7 +2927,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { if (ModelUtils.isArraySchema(responseSchema)) { ArraySchema as = (ArraySchema) responseSchema; - CodegenProperty innerProperty = fromProperty("response", as.getItems()); + CodegenProperty innerProperty = fromProperty("response", getSchemaItems(as)); CodegenProperty innerCp = innerProperty; while (innerCp != null) { r.baseType = innerCp.baseType; @@ -3109,10 +3135,8 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) String collectionFormat = null; if (ModelUtils.isArraySchema(parameterSchema)) { // for array parameter final ArraySchema arraySchema = (ArraySchema) parameterSchema; - Schema inner = arraySchema.getItems(); - if (inner == null) { - LOGGER.warn("warning! No inner type supplied for array parameter \"" + parameter.getName() + "\", using String"); - inner = new StringSchema().description("//TODO automatically added by openapi-generator due to missing iner type definition in the spec"); + Schema inner = getSchemaItems(arraySchema); + if (arraySchema.getItems() == null) { arraySchema.setItems(inner); } @@ -3552,7 +3576,7 @@ protected List> toExamples(Map examples) { * @param response API response * @param properties list of codegen property */ - private void addHeaders(ApiResponse response, List properties) { + protected void addHeaders(ApiResponse response, List properties) { if (response.getHeaders() != null) { for (Map.Entry headerEntry : response.getHeaders().entrySet()) { String description = headerEntry.getValue().getDescription(); @@ -3948,6 +3972,24 @@ public String getLibrary() { return library; } + /** + * Set Git host. + * + * @param gitHost Git host + */ + public void setGitHost(String gitHost) { + this.gitHost = gitHost; + } + + /** + * Git host. + * + * @return Git host + */ + public String getGitHost() { + return gitHost; + } + /** * Set Git user ID. * @@ -4339,7 +4381,7 @@ public void updateCodegenPropertyEnum(CodegenProperty var) { } } - private void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions) { + protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions) { if (vendorExtensions != null) { updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-varnames", "name"); updateEnumVarsWithExtensions(enumVars, vendorExtensions, "x-enum-descriptions", "enumDescription"); @@ -4512,8 +4554,8 @@ public boolean hasFormParameter(OpenAPI openAPI, Operation operation) { for (String consume : consumesInfo) { if (consume != null && - consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || - consume.toLowerCase(Locale.ROOT).startsWith("multipart/form-data")) { + (consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || + consume.toLowerCase(Locale.ROOT).startsWith("multipart"))) { return true; } } @@ -4645,10 +4687,8 @@ public List fromRequestBodyToFormParameters(RequestBody body, // array of schema if (ModelUtils.isArraySchema(s)) { final ArraySchema arraySchema = (ArraySchema) s; - Schema inner = arraySchema.getItems(); - if (inner == null) { - LOGGER.error("No inner type supplied for array parameter `{}`. Default to type:string", s.getName()); - inner = new StringSchema().description("//TODO automatically added by openapi-generator due to missing inner type definition in the spec"); + Schema inner = getSchemaItems(arraySchema); + if (arraySchema.getItems() == null) { arraySchema.setItems(inner); } @@ -4845,10 +4885,8 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S setParameterNullable(codegenParameter, codegenProperty); } else if (ModelUtils.isArraySchema(schema)) { final ArraySchema arraySchema = (ArraySchema) schema; - Schema inner = arraySchema.getItems(); - if (inner == null) { - LOGGER.error("No inner type supplied for array parameter `{}`. Default to type:string", schema.getName()); - inner = new StringSchema().description("//TODO automatically added by openapi-generator due to undefined type"); + Schema inner = getSchemaItems(arraySchema); + if (arraySchema.getItems() == null) { arraySchema.setItems(inner); } CodegenProperty codegenProperty = fromProperty("property", arraySchema); @@ -4933,41 +4971,54 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S imports.add(codegenParameter.baseType); } else { CodegenProperty codegenProperty = fromProperty("property", schema); - if (ModelUtils.getAdditionalProperties(schema) != null) {// http body is map - LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); - } else if (codegenProperty != null) { - String codegenModelName, codegenModelDescription; - - if (codegenModel != null) { - codegenModelName = codegenModel.classname; - codegenModelDescription = codegenModel.description; - } else { - LOGGER.warn("The following schema has undefined (null) baseType. " + - "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " + - "A correct 'consumes' for form parameters should be " + - "'application/x-www-form-urlencoded' or 'multipart/form-data'"); - LOGGER.warn("schema: " + schema); - LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE"); - codegenModelName = "UNKNOWN_BASE_TYPE"; - codegenModelDescription = "UNKNOWN_DESCRIPTION"; - } - - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModelName; - } else { - codegenParameter.baseName = bodyParameterName; - } + if (codegenProperty != null && codegenProperty.getComplexType() != null && codegenProperty.getComplexType().contains(" | ")) { + List parts = Arrays.asList(codegenProperty.getComplexType().split(" \\| ")); + imports.addAll(parts); + String codegenModelName = codegenProperty.getComplexType(); + codegenParameter.baseName = codegenModelName; codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModelName; + codegenParameter.baseType = codegenParameter.baseName; codegenParameter.dataType = getTypeDeclaration(codegenModelName); - codegenParameter.description = codegenModelDescription; - imports.add(codegenParameter.baseType); + codegenParameter.description = codegenProperty.getDescription(); + } else { + if (ModelUtils.getAdditionalProperties(schema) != null) {// http body is map + LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); + } else if (codegenProperty != null) { + String codegenModelName, codegenModelDescription; + + if (codegenModel != null) { + codegenModelName = codegenModel.classname; + codegenModelDescription = codegenModel.description; + } else { + LOGGER.warn("The following schema has undefined (null) baseType. " + + "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " + + "A correct 'consumes' for form parameters should be " + + "'application/x-www-form-urlencoded' or 'multipart/?'"); + LOGGER.warn("schema: " + schema); + LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE"); + codegenModelName = "UNKNOWN_BASE_TYPE"; + codegenModelDescription = "UNKNOWN_DESCRIPTION"; + } + + if (StringUtils.isEmpty(bodyParameterName)) { + codegenParameter.baseName = codegenModelName; + } else { + codegenParameter.baseName = bodyParameterName; + } + + codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.baseType = codegenModelName; + codegenParameter.dataType = getTypeDeclaration(codegenModelName); + codegenParameter.description = codegenModelDescription; + imports.add(codegenParameter.baseType); - if (codegenProperty.complexType != null) { - imports.add(codegenProperty.complexType); + if (codegenProperty.complexType != null) { + imports.add(codegenProperty.complexType); + } } } + setParameterBooleanFlagWithCodegenProperty(codegenParameter, codegenProperty); // set nullable setParameterNullable(codegenParameter, codegenProperty); @@ -5054,11 +5105,7 @@ protected void addSwitch(String key, String description, Boolean defaultValue) { protected void generateJSONSpecFile(Map objs) { OpenAPI openAPI = (OpenAPI) objs.get("openAPI"); if (openAPI != null) { - try { - objs.put("openapi-json", Json.pretty().writeValueAsString(openAPI).replace("\r\n", "\n")); - } catch (JsonProcessingException e) { - LOGGER.error(e.getMessage(), e); - } + objs.put("openapi-json", SerializerUtils.toJsonString(openAPI)); } } 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 fbe0dbbfeb16..98a0226afa28 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 @@ -35,8 +35,10 @@ import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; +import org.openapitools.codegen.languages.PythonClientExperimentalCodegen; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.serializer.SerializerUtils; import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.openapitools.codegen.utils.ImplementationVersion; import org.openapitools.codegen.utils.ModelUtils; @@ -183,12 +185,12 @@ private void configureGeneratorProperties() { } if (GlobalSettings.getProperty("debugOpenAPI") != null) { - Json.prettyPrint(openAPI); + SerializerUtils.toJsonString(openAPI); } else if (GlobalSettings.getProperty("debugSwagger") != null) { // This exists for backward compatibility // We fall to this block only if debugOpenAPI is null. No need to dump this twice. LOGGER.info("Please use system property 'debugOpenAPI' instead of 'debugSwagger'."); - Json.prettyPrint(openAPI); + SerializerUtils.toJsonString(openAPI); } config.processOpts(); @@ -489,10 +491,11 @@ private Model getParent(Model model) { // TODO revise below as we've already performed unaliasing so that the isAlias check may be removed Map modelTemplate = (Map) ((List) models.get("models")).get(0); - // Special handling of aliases only applies to Java if (modelTemplate != null && modelTemplate.containsKey("model")) { CodegenModel m = (CodegenModel) modelTemplate.get("model"); - if (m.isAlias) { + if (m.isAlias && !(config instanceof PythonClientExperimentalCodegen)) { + // alias to number, string, enum, etc, which should not be generated as model + // for PythonClientExperimentalCodegen, all aliases are generated as models continue; // Don't create user-defined classes for aliases } } @@ -942,7 +945,6 @@ public String getFullTemplateContents(String templateName) { * Returns the path of a template, allowing access to the template where consuming literal contents aren't desirable or possible. * * @param name the template name (e.g. model.mustache) - * * @return The {@link Path} to the template */ @Override @@ -974,6 +976,7 @@ public Map> processPaths(Paths paths) { processOperation(resourcePath, "delete", path.getDelete(), ops, path); processOperation(resourcePath, "patch", path.getPatch(), ops, path); processOperation(resourcePath, "options", path.getOptions(), ops, path); + processOperation(resourcePath, "trace", path.getTrace(), ops, path); } return ops; } @@ -1061,21 +1064,21 @@ private void processOperation(String resourcePath, String httpMethod, Operation if (authMethods != null && !authMethods.isEmpty()) { codegenOperation.authMethods = config.fromSecurity(authMethods); List> scopes = new ArrayList>(); - if (codegenOperation.authMethods != null){ - for (CodegenSecurity security : codegenOperation.authMethods){ + if (codegenOperation.authMethods != null) { + for (CodegenSecurity security : codegenOperation.authMethods) { if (security != null && security.isBasicBearer != null && security.isBasicBearer && - securities != null){ - for (SecurityRequirement req : securities){ + securities != null) { + for (SecurityRequirement req : securities) { if (req == null) continue; - for (String key : req.keySet()){ - if (security.name != null && key.equals(security.name)){ + for (String key : req.keySet()) { + if (security.name != null && key.equals(security.name)) { int count = 0; - for (String sc : req.get(key)){ + 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()){ + if (req.get(key) != null && count < req.get(key).size()) { scope.put("hasMore", "true"); } else { scope.put("hasMore", null); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index 4ed482f4b8fd..8910c16f8a49 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -19,6 +19,7 @@ import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.*; +import io.swagger.v3.oas.models.callbacks.Callback; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; @@ -29,6 +30,7 @@ import org.slf4j.LoggerFactory; import java.util.*; +import java.util.stream.Collectors; public class InlineModelResolver { private OpenAPI openapi; @@ -64,7 +66,20 @@ private void flattenPaths(OpenAPI openAPI) { for (String pathname : paths.keySet()) { PathItem path = paths.get(pathname); + List operations = new ArrayList<>(path.readOperations()); + + // Include callback operation as well for (Operation operation : path.readOperations()) { + Map callbacks = operation.getCallbacks(); + if (callbacks != null) { + operations.addAll(callbacks.values().stream() + .flatMap(callback -> callback.values().stream()) + .flatMap(pathItem -> pathItem.readOperations().stream()) + .collect(Collectors.toList())); + } + } + + for (Operation operation : operations) { flattenRequestBody(openAPI, pathname, operation); flattenParameters(openAPI, pathname, operation); flattenResponses(openAPI, pathname, operation); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 33030a80f199..c2df323731b3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -91,6 +91,7 @@ public static CodegenConfigurator fromFile(String configFile) { DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class); CodegenConfigurator configurator = new CodegenConfigurator(); configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(settings.getGeneratorSettings()); + configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(settings.getWorkflowSettings()); return configurator; } catch (IOException ex) { LOGGER.error("Unable to deserialize config file: " + configFile, ex); @@ -221,6 +222,11 @@ public CodegenConfigurator setGitRepoId(String gitRepoId) { return this; } + public CodegenConfigurator setGitHost(String gitHost) { + generatorSettingsBuilder.withGitHost(gitHost); + return this; + } + public CodegenConfigurator setGitUserId(String gitUserId) { generatorSettingsBuilder.withGitUserId(gitUserId); return this; 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 8bb5401e3c91..c7ca1bc9c1b0 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 @@ -35,6 +35,7 @@ import java.io.File; import java.net.URL; import java.util.Arrays; +import java.util.Map; abstract public class AbstractCppCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractCppCodegen.class); @@ -306,4 +307,9 @@ public void preprocessOpenAPI(OpenAPI openAPI) { this.additionalProperties.put("serverHost", host); } } + + @Override + public Map postProcessModels(Map objs) { + return postProcessModelsEnum(objs); + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java index 04a626eac774..5f79b777370f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java @@ -29,11 +29,13 @@ import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.Exception; import java.io.File; import java.util.*; import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; public abstract class AbstractFSharpCodegen extends DefaultCodegen implements CodegenConfig { @@ -246,11 +248,6 @@ public void processOpts() { additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); } - if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { - LOGGER.warn(String.format(Locale.ROOT, "%s is not used by F# generators. Please use %s", - CodegenConstants.INVOKER_PACKAGE, CodegenConstants.PACKAGE_NAME)); - } - // {{packageTitle}} if (additionalProperties.containsKey(CodegenConstants.PACKAGE_TITLE)) { setPackageTitle((String) additionalProperties.get(CodegenConstants.PACKAGE_TITLE)); @@ -300,32 +297,8 @@ public void processOpts() { additionalProperties.put(CodegenConstants.USE_DATETIME_OFFSET, useDateTimeOffsetFlag); } - if (additionalProperties.containsKey(CodegenConstants.USE_COLLECTION)) { - setUseCollection(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_COLLECTION)); - } else { - additionalProperties.put(CodegenConstants.USE_COLLECTION, useCollection); - } - - if (additionalProperties.containsKey(CodegenConstants.RETURN_ICOLLECTION)) { - setReturnICollection(convertPropertyToBooleanAndWriteBack(CodegenConstants.RETURN_ICOLLECTION)); - } else { - additionalProperties.put(CodegenConstants.RETURN_ICOLLECTION, returnICollection); - } - - if (additionalProperties.containsKey(CodegenConstants.NETCORE_PROJECT_FILE)) { - setNetCoreProjectFileFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.NETCORE_PROJECT_FILE)); - } else { - additionalProperties.put(CodegenConstants.NETCORE_PROJECT_FILE, netCoreProjectFileFlag); - } - - if (additionalProperties.containsKey(CodegenConstants.INTERFACE_PREFIX)) { - String useInterfacePrefix = additionalProperties.get(CodegenConstants.INTERFACE_PREFIX).toString(); - if ("false".equals(useInterfacePrefix.toLowerCase(Locale.ROOT))) { - setInterfacePrefix(""); - } else if (!"true".equals(useInterfacePrefix.toLowerCase(Locale.ROOT))) { - // NOTE: if user passes "true" explicitly, we use the default I- prefix. The other supported case here is a custom prefix. - setInterfacePrefix(sanitizeName(useInterfacePrefix)); - } + if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { + setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); } // This either updates additionalProperties with the above fixes, or sets the default if the option was not specified. @@ -372,65 +345,49 @@ public Map postProcessAllModels(Map objs) { } /* - * F# does not allow forward declarations, so files must be imported in the correct order. - * Output of CodeGen models must therefore bein dependency order (rather than alphabetical order, which seems to be the default). - * We achieve this by creating a comparator to check whether the first model contains any properties of the comparison model's type - * This could probably be made more efficient if absolutely needed. - */ + * F# does not allow forward declarations, so files must be imported in the correct order. + * Output of CodeGen models must therefore bein dependency order (rather than alphabetical order, which seems to be the default). + * This could probably be made more efficient if absolutely needed. + */ @SuppressWarnings({"unchecked"}) - public Map postProcessDependencyOrders(final Map objs) { - Comparator comparator = new Comparator() { - @Override - public int compare(String key1, String key2) { - // Get the corresponding models - CodegenModel model1 = ModelUtils.getModelByName(key1, objs); - CodegenModel model2 = ModelUtils.getModelByName(key2, objs); - - List complexVars1 = new ArrayList(); - List complexVars2 = new ArrayList(); - - for (CodegenProperty prop : model1.vars) { - if (prop.complexType != null) - complexVars1.add(prop.complexType); - } - for (CodegenProperty prop : model2.vars) { - if (prop.complexType != null) - complexVars2.add(prop.complexType); - } - - // if first has complex vars and second has none, first is greater - if (complexVars1.size() > 0 && complexVars2.size() == 0) - return 1; - - // if second has complex vars and first has none, first is lesser - if (complexVars1.size() == 0 && complexVars2.size() > 0) - return -1; - - // if first has complex var that matches the second's key, first is greater - if (complexVars1.contains(key2)) - return 1; - - // if second has complex var that matches the first's key, first is lesser - if (complexVars2.contains(key1)) - return -1; - - // if none of the above, don't care - return 0; - - } - }; - PriorityQueue queue = new PriorityQueue(objs.size(), comparator); - for (Object k : objs.keySet()) { - queue.add(k.toString()); + public Map postProcessDependencyOrders(final Map objs) { + + Map> dependencies = new HashMap>(); + + List classNames = new ArrayList(); + + for(String k : objs.keySet()) { + CodegenModel model = ModelUtils.getModelByName(k, objs); + if(model == null || model.classname == null) { + throw new RuntimeException("Null model encountered"); } - - Map sorted = new LinkedHashMap(); - - while (queue.size() > 0) { - String key = queue.poll(); - sorted.put(key, objs.get(key)); + dependencies.put(model.classname, model.imports); + + classNames.add(model.classname); + } + + Object[] sortedKeys = classNames.toArray(); + + for(int i1 = 0 ; i1 < sortedKeys.length; i1++) { + String k1 = sortedKeys[i1].toString(); + for(int i2 = i1 + 1; i2 < sortedKeys.length; i2++) { + String k2 = sortedKeys[i2].toString(); + if(dependencies.get(k2).contains(k1)) { + sortedKeys[i2] = k1; + sortedKeys[i1] = k2; + i1 = -1; + break; + } } - return sorted; + } + + Map sorted = new LinkedHashMap(); + for(int i = sortedKeys.length - 1; i >= 0; i--) { + Object k = sortedKeys[i]; + sorted.put(k.toString(), objs.get(k)); + } + + return sorted; } /** @@ -684,6 +641,39 @@ public String toOperationId(String operationId) { return camelize(sanitizeName(operationId)); } + public String getModelPropertyNaming() { + return this.modelPropertyNaming; + } + + public void setModelPropertyNaming(String naming) { + if ("original".equals(naming) || "camelCase".equals(naming) || + "PascalCase".equals(naming) || "snake_case".equals(naming)) { + this.modelPropertyNaming = naming; + } else { + throw new IllegalArgumentException("Invalid model property naming '" + + naming + "'. Must be 'original', 'camelCase', " + + "'PascalCase' or 'snake_case'"); + } + } + + + public String getNameUsingModelPropertyNaming(String name) { + switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { + case original: + return name; + case camelCase: + return camelize(name, true); + case PascalCase: + return camelize(name); + case snake_case: + return underscore(name); + default: + throw new IllegalArgumentException("Invalid model property naming '" + + name + "'. Must be 'original', 'camelCase', " + + "'PascalCase' or 'snake_case'"); + } + } + @Override public String toVarName(String name) { // sanitize name @@ -694,9 +684,8 @@ public String toVarName(String name) { return name; } - // camelize the variable name - // pet_id => PetId - name = camelize(name); + name = getNameUsingModelPropertyNaming(name); + // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { name = escapeReservedWord(name); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 4392dcff5df3..70f251d33cf9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -38,6 +38,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege protected boolean withGoCodegenComment = false; protected boolean withXml = false; + protected boolean enumClassPrefix = false; protected String packageName = "openapi"; @@ -373,6 +374,7 @@ public Map postProcessOperationsWithModels(Map o boolean addedOptionalImport = false; boolean addedTimeImport = false; boolean addedOSImport = false; + boolean addedReflectImport = false; for (CodegenOperation operation : operations) { for (CodegenParameter param : operation.allParams) { // import "os" if the operation uses files @@ -389,6 +391,12 @@ public Map postProcessOperationsWithModels(Map o } } + // import "reflect" package if the parameter is collectionFormat=multi + if (!addedReflectImport && param.isCollectionFormatMulti) { + imports.add(createMapping("import", "reflect")); + addedReflectImport = true; + } + // import "optionals" package if the parameter is optional if (!param.required) { if (!addedOptionalImport) { @@ -613,6 +621,10 @@ public void setWithXml(boolean withXml) { this.withXml = withXml; } + public void setEnumClassPrefix(boolean enumClassPrefix) { + this.enumClassPrefix = enumClassPrefix; + } + @Override public String toDefaultValue(Schema schema) { if (schema.getDefault() != null) { 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 2d7f3d2ce6c8..d48702a62af1 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 @@ -43,6 +43,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class); + private static final String ARTIFACT_VERSION_DEFAULT_VALUE = "1.0.0"; + public static final String FULL_JAVA_UTIL = "fullJavaUtil"; public static final String DEFAULT_LIBRARY = ""; public static final String DATE_LIBRARY = "dateLibrary"; @@ -60,7 +62,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected String invokerPackage = "org.openapitools"; protected String groupId = "org.openapitools"; protected String artifactId = "openapi-java"; - protected String artifactVersion = "1.0.0"; + protected String artifactVersion = null; protected String artifactUrl = "https://github.com/openapitools/openapi-generator"; protected String artifactDescription = "OpenAPI Java"; protected String developerName = "OpenAPI-Generator Contributors"; @@ -144,7 +146,7 @@ public AbstractJavaCodegen() { cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC).defaultValue(this.getInvokerPackage())); cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC).defaultValue(this.getGroupId())); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC).defaultValue(this.getArtifactId())); - cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC).defaultValue(this.getArtifactVersion())); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC).defaultValue(ARTIFACT_VERSION_DEFAULT_VALUE)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_URL, CodegenConstants.ARTIFACT_URL_DESC).defaultValue(this.getArtifactUrl())); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_DESCRIPTION, CodegenConstants.ARTIFACT_DESCRIPTION_DESC).defaultValue(this.getArtifactDescription())); cliOptions.add(new CliOption(CodegenConstants.SCM_CONNECTION, CodegenConstants.SCM_CONNECTION_DESC).defaultValue(this.getScmConnection())); @@ -417,6 +419,8 @@ public void processOpts() { importMapping.put("JsonTypeInfo", "com.fasterxml.jackson.annotation.JsonTypeInfo"); importMapping.put("JsonCreator", "com.fasterxml.jackson.annotation.JsonCreator"); importMapping.put("JsonValue", "com.fasterxml.jackson.annotation.JsonValue"); + importMapping.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore"); + importMapping.put("JsonInclude", "com.fasterxml.jackson.annotation.JsonInclude"); importMapping.put("SerializedName", "com.google.gson.annotations.SerializedName"); importMapping.put("TypeAdapter", "com.google.gson.TypeAdapter"); importMapping.put("JsonAdapter", "com.google.gson.annotations.JsonAdapter"); @@ -684,14 +688,8 @@ public String toModelFilename(String name) { @Override public String getTypeDeclaration(Schema p) { if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - if (inner == null) { - LOGGER.error("`{}` (array property) does not have a proper inner type defined. Default to type:string", ap.getName()); - inner = new StringSchema().description("TODO default missing array inner type to string"); - ap.setItems(inner); - } - return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; + Schema items = getSchemaItems((ArraySchema) p); + return getSchemaType(p) + "<" + getTypeDeclaration(items) + ">"; } else if (ModelUtils.isMapSchema(p)) { Schema inner = ModelUtils.getAdditionalProperties(p); if (inner == null) { @@ -716,7 +714,6 @@ public String getAlias(String name) { public String toDefaultValue(Schema p) { p = ModelUtils.getReferencedSchema(this.openAPI, p); if (ModelUtils.isArraySchema(p)) { - final ArraySchema ap = (ArraySchema) p; final String pattern; if (fullJavaUtil) { pattern = "new java.util.ArrayList<%s>()"; @@ -724,13 +721,9 @@ public String toDefaultValue(Schema p) { pattern = "new ArrayList<%s>()"; } - if (ap.getItems() == null) { - LOGGER.error("`{}` (array property) does not have a proper inner type defined. Default to type:string", ap.getName()); - Schema inner = new StringSchema().description("TODO default missing array inner type to string"); - ap.setItems(inner); - } + Schema items = getSchemaItems((ArraySchema) p); - String typeDeclaration = getTypeDeclaration(ap.getItems()); + String typeDeclaration = getTypeDeclaration(items); Object java8obj = additionalProperties.get("java8"); if (java8obj != null) { Boolean java8 = Boolean.valueOf(java8obj.toString()); @@ -800,7 +793,13 @@ public String toDefaultValue(Schema p) { } } return null; + } else if (ModelUtils.isObjectSchema(p)) { + if (p.getDefault() != null) { + return super.toDefaultValue(p); + } + return null; } + return super.toDefaultValue(p); } @@ -1041,12 +1040,18 @@ public void preprocessOpenAPI(OpenAPI openAPI) { } } - // 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)) { - this.setArtifactVersion((String) additionalProperties.get(CodegenConstants.ARTIFACT_VERSION)); - } else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) { - this.setArtifactVersion(openAPI.getInfo().getVersion()); + 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)) { + 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); } if (additionalProperties.containsKey(CodegenConstants.SNAPSHOT_VERSION)) { @@ -1436,7 +1441,10 @@ private String deriveInvokerPackageName(String input) { * @return SNAPSHOT version */ private String buildSnapshotVersion(String version) { - return version + "-" + "SNAPSHOT"; + if(version.endsWith("-SNAPSHOT")) { + return version; + } + return version + "-SNAPSHOT"; } public void setSupportJava6(boolean value) { 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 148cbb547aeb..5351c1fe2d40 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 @@ -35,6 +35,10 @@ import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig { + + public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson'"; + public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson} + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); protected String artifactId; @@ -51,6 +55,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co protected boolean parcelizeModels = false; protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase; + protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; public AbstractKotlinCodegen() { super(); @@ -205,6 +210,10 @@ public AbstractKotlinCodegen() { CliOption enumPropertyNamingOpt = new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC); cliOptions.add(enumPropertyNamingOpt.defaultValue(enumPropertyNaming.name())); + + CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC); + cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name())); + cliOptions.add(new CliOption(CodegenConstants.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC)); } @@ -244,6 +253,10 @@ public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { return this.enumPropertyNaming; } + public SERIALIZATION_LIBRARY_TYPE getSerializationLibrary() { + return this.serializationLibrary; + } + /** * Sets the naming convention for Kotlin enum properties * @@ -261,6 +274,24 @@ public void setEnumPropertyNaming(final String enumPropertyNamingType) { } } + /** + * Sets the serialization engine for Kotlin + * + * @param enumSerializationLibrary The string representation of the serialization library as defined by + * {@link org.openapitools.codegen.languages.AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE} + */ + public void setSerializationLibrary(final String enumSerializationLibrary) { + try { + this.serializationLibrary = SERIALIZATION_LIBRARY_TYPE.valueOf(enumSerializationLibrary); + } catch (IllegalArgumentException ex) { + StringBuilder sb = new StringBuilder(enumSerializationLibrary + " is an invalid enum property naming option. Please choose from:"); + for (SERIALIZATION_LIBRARY_TYPE t : SERIALIZATION_LIBRARY_TYPE.values()) { + sb.append("\n ").append(t.name()); + } + throw new RuntimeException(sb.toString()); + } + } + /** * returns the swagger type for the property * @@ -330,6 +361,14 @@ public void processOpts() { setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING)); } + if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { + setSerializationLibrary((String) additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY)); + additionalProperties.put(this.serializationLibrary.name(), true); + } + else { + additionalProperties.put(this.serializationLibrary.name(), true); + } + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); } else { 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 new file mode 100644 index 000000000000..5e8e788209ad --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -0,0 +1,274 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.*; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.HashSet; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; + +import io.swagger.v3.oas.models.OpenAPI; + +/** + * basic asciidoc markup generator. + * + * @see asciidoctor + */ +public class AsciidocDocumentationCodegen extends DefaultCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(AsciidocDocumentationCodegen.class); + + public static final String SPEC_DIR = "specDir"; + public static final String SNIPPET_DIR = "snippetDir"; + + /** + * Lambda emitting an asciidoc "include::filename.adoc[]" if file is found in + * path. Use: + * + *
+     * {{#includemarkup}}{{name}}/description.adoc{{/includemarkup}}
+     * 
+ */ + public class IncludeMarkupLambda implements Mustache.Lambda { + + private long includeCount = 0; + private long notFoundCount = 0; + private String basePath; + + public IncludeMarkupLambda(final String basePath) { + this.basePath = basePath; + } + + public String resetCounter() { + String msg = "included: " + includeCount + " notFound: " + notFoundCount + " from " + basePath; + includeCount = 0; + notFoundCount = 0; + return msg; + } + + @Override + public void execute(final Template.Fragment frag, final Writer out) throws IOException { + + final String relativeFileName = AsciidocDocumentationCodegen.sanitize(frag.execute()); + final Path filePathToInclude = Paths.get(basePath, relativeFileName).toAbsolutePath(); + + if (Files.isRegularFile(filePathToInclude)) { + LOGGER.debug( + "including " + ++includeCount + ". file into markup from: " + filePathToInclude.toString()); + out.write("\ninclude::" + relativeFileName + "[]\n"); + } else { + LOGGER.debug(++notFoundCount + ". file not found, skip include for: " + filePathToInclude.toString()); + out.write("\n// markup not found, no include ::" + relativeFileName + "[]\n"); + } + } + } + + /** + * Lambda emitting an asciidoc "http link" if file is found in path. Use: + * + *
+     * {{#snippetLink}}markup until koma, /{{name}}.json{{/snippetLink}}
+     * 
+ */ + public class LinkMarkupLambda implements Mustache.Lambda { + + private long linkedCount = 0; + private long notFoundLinkCount = 0; + private String basePath; + + public LinkMarkupLambda(final String basePath) { + this.basePath = basePath; + } + + public String resetCounter() { + String msg = "linked:" + linkedCount + " notFound: " + notFoundLinkCount + " from " + basePath; + linkedCount = 0; + notFoundLinkCount = 0; + return msg; + } + + @Override + public void execute(final Template.Fragment frag, final Writer out) throws IOException { + + final String content = frag.execute(); + final String[] tokens = content.split(",", 2); + + final String linkName = tokens.length > 0 ? tokens[0] : ""; + + final String relativeFileName = AsciidocDocumentationCodegen + .sanitize(tokens.length > 1 ? tokens[1] : linkName); + + final Path filePathToLinkTo = Paths.get(basePath, relativeFileName).toAbsolutePath(); + + if (Files.isRegularFile(filePathToLinkTo)) { + LOGGER.debug("linking " + ++linkedCount + ". file into markup from: " + filePathToLinkTo.toString()); + out.write("\n" + linkName + " link:" + relativeFileName + "[]\n"); + } else { + LOGGER.debug(++notFoundLinkCount + ". file not found, skip link for: " + filePathToLinkTo.toString()); + out.write("\n// file not found, no " + linkName + " link :" + relativeFileName + "[]\n"); + } + } + } + + protected String invokerPackage = "org.openapitools.client"; + protected String groupId = "org.openapitools"; + protected String artifactId = "openapi-client"; + protected String artifactVersion = "1.0.0"; + + private IncludeMarkupLambda includeSpecMarkupLambda; + private IncludeMarkupLambda includeSnippetMarkupLambda; + private LinkMarkupLambda linkSnippetMarkupLambda; + + public CodegenType getTag() { + return CodegenType.DOCUMENTATION; + } + + /** + * extracted filter value should be relative to be of use as link or include + * file. + * + * @param name filename to sanitize + * @return trimmed and striped path part or empty string. + */ + static String sanitize(final String name) { + String sanitized = name == null ? "" : name.trim(); + return sanitized.startsWith(File.separator) || sanitized.startsWith("/") ? sanitized.substring(1) : sanitized; + } + + public String getName() { + return "asciidoc"; + } + + public String getHelp() { + return "Generates asciidoc markup based documentation."; + } + + public String getSpecDir() { + return additionalProperties.get("specDir").toString(); + } + + public String getSnippetDir() { + return additionalProperties.get("snippetDir").toString(); + } + + public AsciidocDocumentationCodegen() { + super(); + + LOGGER.trace("start asciidoc codegen"); + + outputFolder = "generated-code" + File.separator + "asciidoc"; + embeddedTemplateDir = templateDir = "asciidoc-documentation"; + + defaultIncludes = new HashSet(); + + cliOptions.add(new CliOption("appName", "short name of the application")); + cliOptions.add(new CliOption("appDescription", "description of the application")); + cliOptions.add(new CliOption("infoUrl", "a URL where users can get more information about the application")); + cliOptions.add(new CliOption("infoEmail", "an email address to contact for inquiries about the application")); + cliOptions.add(new CliOption("licenseInfo", "a short description of the license")); + cliOptions.add(new CliOption(CodegenConstants.LICENSE_URL, "a URL pointing to the full license")); + cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC)); + cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC)); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC)); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC)); + + cliOptions.add(new CliOption(SNIPPET_DIR, + "path with includable markup snippets (e.g. test output generated by restdoc, default: .") + .defaultValue(".")); + cliOptions.add(new CliOption(SPEC_DIR, + "path with includable markup spec files (e.g. handwritten additional docs, default: .") + .defaultValue("..")); + + additionalProperties.put("appName", "OpenAPI Sample description"); + additionalProperties.put("appDescription", "A sample OpenAPI documentation"); + additionalProperties.put("infoUrl", "https://openapi-generator.tech"); + additionalProperties.put("infoEmail", "team@openapitools.org"); + additionalProperties.put("licenseInfo", "All rights reserved"); + additionalProperties.put(CodegenConstants.LICENSE_URL, "http://apache.org/licenses/LICENSE-2.0.html"); + additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); + additionalProperties.put(CodegenConstants.GROUP_ID, groupId); + additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); + additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); + + supportingFiles.add(new SupportingFile("index.mustache", "", "index.adoc")); + reservedWords = new HashSet(); + + languageSpecificPrimitives = new HashSet(); + importMapping = new HashMap(); + + } + + @Override + public String escapeQuotationMark(String input) { + return input; // just return the original string + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input; // just return the original string + } + + @Override + public void processOpts() { + super.processOpts(); + + String specDir = this.additionalProperties.get(SPEC_DIR) + ""; + if (!Files.isDirectory(Paths.get(specDir))) { + LOGGER.warn("base part for include markup lambda not found: " + specDir + " as " + + Paths.get(specDir).toAbsolutePath()); + } + + this.includeSpecMarkupLambda = new IncludeMarkupLambda(specDir); + additionalProperties.put("specinclude", this.includeSpecMarkupLambda); + + String snippetDir = this.additionalProperties.get(SNIPPET_DIR) + ""; + if (!Files.isDirectory(Paths.get(snippetDir))) { + LOGGER.warn("base part for include markup lambda not found: " + snippetDir + " as " + + Paths.get(snippetDir).toAbsolutePath()); + } + + this.includeSnippetMarkupLambda = new IncludeMarkupLambda(snippetDir); + additionalProperties.put("snippetinclude", this.includeSnippetMarkupLambda); + + this.linkSnippetMarkupLambda = new LinkMarkupLambda(snippetDir); + additionalProperties.put("snippetlink", this.linkSnippetMarkupLambda); + } + + @Override + public void processOpenAPI(OpenAPI openAPI) { + if (this.includeSpecMarkupLambda != null) { + LOGGER.debug("specs: " + ": " + this.includeSpecMarkupLambda.resetCounter()); + } + if (this.includeSnippetMarkupLambda != null) { + LOGGER.debug("snippets: " + ": " + this.includeSnippetMarkupLambda.resetCounter()); + } + super.processOpenAPI(openAPI); + } + +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java new file mode 100644 index 000000000000..0da3aa037874 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AvroSchemaCodegen.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; + +import static org.openapitools.codegen.utils.StringUtils.camelize; + +public class AvroSchemaCodegen extends DefaultCodegen implements CodegenConfig { + private static final String AVRO = "avro-schema"; + protected String packageName = "model"; + + public AvroSchemaCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + outputFolder = "generated-code/avro-schema"; + modelTemplateFiles.put("model.mustache", ".avsc"); + apiPackage = "api"; + modelPackage = "model"; + importMapping.clear(); + embeddedTemplateDir = templateDir = AVRO; + + // default HIDE_GENERATION_TIMESTAMP to true + hideGenerationTimestamp = Boolean.TRUE; + + languageSpecificPrimitives = new HashSet<>( + Arrays.asList("null", "boolean", "int", "integer", "long", "float", "double", "bytes", "string", + "BigDecimal", "UUID", "number", "date", "DateTime") + ); + defaultIncludes = new HashSet<>(languageSpecificPrimitives); + + instantiationTypes.put("array", "Array"); + instantiationTypes.put("list", "Array"); + instantiationTypes.put("map", "Object"); + typeMapping.clear(); + typeMapping.put("number", "double"); + typeMapping.put("DateTime", "string"); + typeMapping.put("date", "string"); + typeMapping.put("short", "int"); + typeMapping.put("char", "string"); + typeMapping.put("integer", "int"); + typeMapping.put("ByteArray", "bytes"); + typeMapping.put("binary", "File"); + typeMapping.put("file", "File"); + typeMapping.put("UUID", "string"); + typeMapping.put("BigDecimal", "string"); + + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, CodegenConstants.PACKAGE_NAME_DESC)); + } + + @Override + public void processOpts() { + super.processOpts(); + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME); + } + + additionalProperties.put("packageName", packageName); + + } + + @Override + public CodegenType getTag() { + return CodegenType.SCHEMA; + } + + @Override + public String getName() { + return "avro-schema"; + } + + @Override + public String getHelp() { + return "Generates a Avro model (beta)."; + } + + @Override + public String modelFileFolder() { + return outputFolder + File.separator; + } + + @Override + public Map postProcessModels(Map objs) { + return postProcessModelsEnum(objs); + } + + @Override + protected void setNonArrayMapProperty(CodegenProperty property, String type) { + super.setNonArrayMapProperty(property, type); + if (property.isModel) { + property.dataType = camelize(modelNamePrefix + property.dataType + modelNameSuffix); + } + } + + @Override + public String escapeUnsafeCharacters(String input) { + // do nothing as it's a schema conversion + return input; + } + + @Override + public String escapeQuotationMark(String input) { + // do nothing as it's a schema conversion + return input; + } + +} 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 7a79c06368f3..b032ac3beedc 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 @@ -65,7 +65,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected String modelDocPath = "docs/"; // Defines TargetFrameworkVersion in csproj files - protected String targetFramework = defaultFramework.dotNetFrameworkVersion; + protected String targetFramework = defaultFramework.name; // Defines nuget identifiers for target framework protected String targetFrameworkNuget = targetFramework; @@ -78,6 +78,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // By default, generated code is considered public protected boolean nonPublicApi = Boolean.FALSE; + protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE; + public CSharpNetCoreClientCodegen() { super(); @@ -206,6 +208,10 @@ public CSharpNetCoreClientCodegen() { CodegenConstants.VALIDATABLE_DESC, this.validatable); + addSwitch(CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS, + CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS_DESC, + this.caseInsensitiveResponseHeaders); + regexModifiers = new HashMap<>(); regexModifiers.put('i', "IgnoreCase"); regexModifiers.put('m', "Multiline"); @@ -470,7 +476,7 @@ public void processOpts() { } clientPackage = "Client"; - String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.dotNetFrameworkVersion); + String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name); FrameworkStrategy strategy = defaultFramework; for (FrameworkStrategy frameworkStrategy : frameworkStrategies) { if (framework.equals(frameworkStrategy.name)) { @@ -481,7 +487,7 @@ public void processOpts() { strategy.configureAdditionalProperties(additionalProperties); setTargetFrameworkNuget(strategy.getNugetFrameworkIdentifier()); - setTargetFramework(strategy.dotNetFrameworkVersion); + setTargetFramework(strategy.name); if (strategy != FrameworkStrategy.NETSTANDARD_2_0) { LOGGER.warn("If using built-in templates-RestSharp only supports netstandard 2.0 or later."); @@ -640,6 +646,10 @@ public void setValidatable(boolean validatable) { this.validatable = validatable; } + public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { + this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; + } + @Override public String toEnumVarName(String value, String datatype) { if (value.length() == 0) { @@ -800,7 +810,7 @@ private static abstract class FrameworkStrategy { } protected void configureAdditionalProperties(final Map properties) { - properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.dotNetFrameworkVersion); + properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.name); // not intended to be user-settable properties.put(TARGET_FRAMEWORK_IDENTIFIER, this.getTargetFrameworkIdentifier()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index cf9d78ed5dd9..3de0cbf5b91e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -27,6 +27,8 @@ import org.openapitools.codegen.*; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.URLPathUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; @@ -35,10 +37,15 @@ import static org.openapitools.codegen.utils.StringUtils.*; public class CppPistacheServerCodegen extends AbstractCppCodegen { + private static final Logger LOGGER = LoggerFactory.getLogger(CppPistacheServerCodegen.class); + protected String implFolder = "impl"; protected boolean isAddExternalLibs = true; + protected boolean isUseStructModel = false; public static final String OPTIONAL_EXTERNAL_LIB = "addExternalLibs"; public static final String OPTIONAL_EXTERNAL_LIB_DESC = "Add the Possibility to fetch and compile external Libraries needed by this Framework."; + public static final String OPTION_USE_STRUCT_MODEL = "useStructModel"; + public static final String OPTION_USE_STRUCT_MODEL_DESC = "Use struct-based model template instead of get/set-based model template"; public static final String HELPERS_PACKAGE_NAME = "helpersPackage"; public static final String HELPERS_PACKAGE_NAME_DESC = "Specify the package name to be used for the helpers (e.g. org.openapitools.server.helpers)."; protected final String PREFIX = ""; @@ -68,9 +75,6 @@ public CppPistacheServerCodegen() { apiPackage = "org.openapitools.server.api"; modelPackage = "org.openapitools.server.model"; - modelTemplateFiles.put("model-header.mustache", ".h"); - modelTemplateFiles.put("model-source.mustache", ".cpp"); - apiTemplateFiles.put("api-header.mustache", ".h"); apiTemplateFiles.put("api-source.mustache", ".cpp"); apiTemplateFiles.put("api-impl-header.mustache", ".h"); @@ -81,6 +85,7 @@ public CppPistacheServerCodegen() { cliOptions.clear(); addSwitch(OPTIONAL_EXTERNAL_LIB, OPTIONAL_EXTERNAL_LIB_DESC, this.isAddExternalLibs); addOption(HELPERS_PACKAGE_NAME, HELPERS_PACKAGE_NAME_DESC, this.helpersPackage); + addSwitch(OPTION_USE_STRUCT_MODEL, OPTION_USE_STRUCT_MODEL_DESC, this.isUseStructModel); reservedWords = new HashSet<>(); @@ -144,6 +149,23 @@ public void processOpts() { } else { additionalProperties.put(OPTIONAL_EXTERNAL_LIB, isAddExternalLibs); } + + setupModelTemplate(); + } + + private void setupModelTemplate() { + if (additionalProperties.containsKey(OPTION_USE_STRUCT_MODEL)) + isUseStructModel = convertPropertyToBooleanAndWriteBack(OPTION_USE_STRUCT_MODEL); + + if (isUseStructModel) { + LOGGER.info("Using struct-based model template"); + modelTemplateFiles.put("model-struct-header.mustache", ".h"); + modelTemplateFiles.put("model-struct-source.mustache", ".cpp"); + } else { + LOGGER.info("Using get/set-based model template"); + modelTemplateFiles.put("model-header.mustache", ".h"); + modelTemplateFiles.put("model-source.mustache", ".cpp"); + } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java index cfaac199a1c4..7ab3d8bfef3a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java @@ -26,7 +26,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen protected Set systemIncludes = new HashSet(); protected Set nonFrameworkPrimitives = new HashSet(); - + public CppQt5AbstractCodegen() { super(); // set modelNamePrefix as default for QHttpEngine Server @@ -61,10 +61,10 @@ public CppQt5AbstractCodegen() { "double") ); nonFrameworkPrimitives.addAll(languageSpecificPrimitives); - + foundationClasses.addAll( Arrays.asList( - "QString", + "QString", "QDate", "QDateTime", "QByteArray") @@ -78,7 +78,7 @@ public CppQt5AbstractCodegen() { typeMapping.put("integer", "qint32"); typeMapping.put("long", "qint64"); typeMapping.put("boolean", "bool"); - typeMapping.put("number", "double"); + typeMapping.put("number", "double"); typeMapping.put("array", "QList"); typeMapping.put("map", "QMap"); typeMapping.put("object", PREFIX + "Object"); @@ -90,8 +90,8 @@ public CppQt5AbstractCodegen() { // modifications on multiple templates) typeMapping.put("UUID", "QString"); typeMapping.put("URI", "QString"); - typeMapping.put("file", "QIODevice"); - typeMapping.put("binary", "QIODevice"); + typeMapping.put("file", "QByteArray"); + typeMapping.put("binary", "QByteArray"); importMapping = new HashMap(); namespaces = new HashMap(); @@ -101,7 +101,6 @@ public CppQt5AbstractCodegen() { systemIncludes.add("QDate"); systemIncludes.add("QDateTime"); systemIncludes.add("QByteArray"); - systemIncludes.add("QIODevice"); } @Override public void processOpts() { @@ -119,7 +118,7 @@ public void processOpts() { additionalProperties().put("prefix", modelNamePrefix); } } - + @Override public String toModelImport(String name) { if( name.isEmpty() ) { @@ -140,7 +139,7 @@ public String toModelImport(String name) { return "#include \"" + folder + name + ".h\""; } - + /** * Optional - type declaration. This is a String which is used by the templates to instantiate your * types. There is typically special handling for different property types @@ -160,9 +159,9 @@ public String getTypeDeclaration(Schema p) { Schema inner = ModelUtils.getAdditionalProperties(p); return getSchemaType(p) + ""; } else if (ModelUtils.isBinarySchema(p)) { - return getSchemaType(p) + "*"; + return getSchemaType(p); } else if (ModelUtils.isFileSchema(p)) { - return getSchemaType(p) + "*"; + return getSchemaType(p); } if (foundationClasses.contains(openAPIType)) { return openAPIType; @@ -174,7 +173,7 @@ public String getTypeDeclaration(Schema p) { } @Override - @SuppressWarnings("rawtypes") + @SuppressWarnings("rawtypes") public String toDefaultValue(Schema p) { if (ModelUtils.isBooleanSchema(p)) { return "false"; @@ -211,7 +210,7 @@ public String toDefaultValue(Schema p) { public String toModelFilename(String name) { return toModelName(name); } - + /** * Optional - OpenAPI type conversion. This is used to map OpenAPI types in a `Schema` into * either language specific types via `typeMapping` or into complex models if there is not a mapping. @@ -219,7 +218,7 @@ public String toModelFilename(String name) { * @return a string value of the type or complex model for this property */ @Override - @SuppressWarnings("rawtypes") + @SuppressWarnings("rawtypes") public String getSchemaType(Schema p) { String openAPIType = super.getSchemaType(p); @@ -242,7 +241,7 @@ public String getSchemaType(Schema p) { public String toVarName(String name) { // sanitize name String varName = name; - varName = sanitizeName(name); + varName = sanitizeName(name); // if it's all uppper case, convert to lower case if (varName.matches("^[A-Z_]*$")) { @@ -270,7 +269,7 @@ public String toParamName(String name) { public String getTypeDeclaration(String str) { return str; } - + @Override protected boolean needToImport(String type) { return StringUtils.isNotBlank(type) && !defaultIncludes.contains(type) @@ -283,7 +282,7 @@ protected boolean needToImport(String type) { public Map postProcessOperationsWithModels(Map objs, List allModels) { Map objectMap = (Map) objs.get("operations"); List operations = (List) objectMap.get("operation"); - + List> imports = (List>) objs.get("imports"); Map codegenModels = new HashMap (); for(Object moObj : allModels) { @@ -298,7 +297,7 @@ public Map postProcessOperationsWithModels(Map o operation.vendorExtensions.put("returnsEnum", true); } } - // Check all return parameter baseType if there is a necessity to include, include it if not + // Check all return parameter baseType if there is a necessity to include, include it if not // already done if (operation.returnBaseType != null && needToImport(operation.returnBaseType)) { if(!isIncluded(operation.returnBaseType, imports)) { @@ -308,7 +307,7 @@ public Map postProcessOperationsWithModels(Map o List params = new ArrayList(); if (operation.allParams != null)params.addAll(operation.allParams); - // Check all parameter baseType if there is a necessity to include, include it if not + // Check all parameter baseType if there is a necessity to include, include it if not // already done for(CodegenParameter param : params) { if(param.isPrimitiveType && needToImport(param.baseType)) { @@ -321,7 +320,7 @@ public Map postProcessOperationsWithModels(Map o // We use QString to pass path params, add it to include if(!isIncluded("QString", imports)) { imports.add(createMapping("import", "QString")); - } + } } } if(isIncluded("QMap", imports)) { @@ -332,28 +331,23 @@ public Map postProcessOperationsWithModels(Map o } return objs; } - - @Override - public Map postProcessModels(Map objs) { - return postProcessModelsEnum(objs); - } @Override public String toEnumValue(String value, String datatype) { return escapeText(value); } - + @Override public boolean isDataTypeString(String dataType) { return "QString".equals(dataType); } - + private Map createMapping(String key, String value) { Map customImport = new HashMap(); customImport.put(key, toModelImport(value)); return customImport; } - + private boolean isIncluded(String type, List> imports) { boolean included = false; String inclStr = toModelImport(type); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java index 62ea88cc6589..73897d8cf74d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java @@ -76,14 +76,15 @@ public CppQt5ClientCodegen() { supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder, PREFIX + "Helpers.cpp")); supportingFiles.add(new SupportingFile("HttpRequest.h.mustache", sourceFolder, PREFIX + "HttpRequest.h")); supportingFiles.add(new SupportingFile("HttpRequest.cpp.mustache", sourceFolder, PREFIX + "HttpRequest.cpp")); + supportingFiles.add(new SupportingFile("HttpFileElement.h.mustache", sourceFolder, PREFIX + "HttpFileElement.h")); + supportingFiles.add(new SupportingFile("HttpFileElement.cpp.mustache", sourceFolder, PREFIX + "HttpFileElement.cpp")); supportingFiles.add(new SupportingFile("object.mustache", sourceFolder, PREFIX + "Object.h")); - supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, PREFIX + "Enum.h")); + supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, PREFIX + "Enum.h")); if (optionalProjectFileFlag) { supportingFiles.add(new SupportingFile("Project.mustache", sourceFolder, "client.pri")); } - typeMapping.put("file", PREFIX + "HttpRequestInputFileElement"); - typeMapping.put("binary", PREFIX +"HttpRequestInputFileElement"); - importMapping.put(PREFIX + "HttpRequestInputFileElement", "#include \"" + PREFIX + "HttpRequest.h\""); + typeMapping.put("file", PREFIX + "HttpFileElement"); + importMapping.put(PREFIX + "HttpFileElement", "#include \"" + PREFIX + "HttpFileElement.h\""); } @Override @@ -95,7 +96,7 @@ public void processOpts() { } else { additionalProperties.put(CodegenConstants.OPTIONAL_PROJECT_FILE, optionalProjectFileFlag); } - + if (additionalProperties.containsKey("modelNamePrefix")) { supportingFiles.clear(); supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, modelNamePrefix + "Helpers.h")); @@ -103,11 +104,10 @@ public void processOpts() { supportingFiles.add(new SupportingFile("HttpRequest.h.mustache", sourceFolder, modelNamePrefix + "HttpRequest.h")); supportingFiles.add(new SupportingFile("HttpRequest.cpp.mustache", sourceFolder, modelNamePrefix + "HttpRequest.cpp")); supportingFiles.add(new SupportingFile("object.mustache", sourceFolder, modelNamePrefix + "Object.h")); - supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, modelNamePrefix + "Enum.h")); + supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, modelNamePrefix + "Enum.h")); - typeMapping.put("file", modelNamePrefix + "HttpRequestInputFileElement"); - typeMapping.put("binary", modelNamePrefix + "HttpRequestInputFileElement"); - importMapping.put(modelNamePrefix + "HttpRequestInputFileElement", "#include \"" + modelNamePrefix + "HttpRequest.h\""); + typeMapping.put("file", modelNamePrefix + "HttpFileElement"); + importMapping.put(modelNamePrefix + "HttpFileElement", "#include \"" + modelNamePrefix + "HttpFileElement.h\""); if (optionalProjectFileFlag) { supportingFiles.add(new SupportingFile("Project.mustache", sourceFolder, modelNamePrefix + "client.pri")); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java index 393fafc8be6c..a462164107d3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5QHttpEngineServerCodegen.java @@ -76,7 +76,7 @@ public CppQt5QHttpEngineServerCodegen() { apiTemplateFiles.put( "apirequest.h.mustache", // the template to use ".h"); // the extension for each file to write - + apiTemplateFiles.put( "apirequest.cpp.mustache", // the template to use ".cpp"); // the extension for each file to write @@ -86,11 +86,13 @@ public CppQt5QHttpEngineServerCodegen() { * will use the resource stream to attempt to read the templates. */ embeddedTemplateDir = templateDir = "cpp-qt5-qhttpengine-server"; - + supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder + MODEL_DIR, PREFIX + "Helpers.h")); supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder + MODEL_DIR, PREFIX + "Helpers.cpp")); - supportingFiles.add(new SupportingFile("object.mustache", sourceFolder + MODEL_DIR, PREFIX + "Object.h")); + supportingFiles.add(new SupportingFile("object.mustache", sourceFolder + MODEL_DIR, PREFIX + "Object.h")); supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder + MODEL_DIR, PREFIX + "Enum.h")); + supportingFiles.add(new SupportingFile("HttpFileElement.h.mustache", sourceFolder + MODEL_DIR, PREFIX + "HttpFileElement.h")); + supportingFiles.add(new SupportingFile("HttpFileElement.cpp.mustache", sourceFolder + MODEL_DIR, PREFIX + "HttpFileElement.cpp")); supportingFiles.add(new SupportingFile("apirouter.h.mustache", sourceFolder + APIHANDLER_DIR, PREFIX + "ApiRouter.h")); supportingFiles.add(new SupportingFile("apirouter.cpp.mustache", sourceFolder + APIHANDLER_DIR, PREFIX + "ApiRouter.cpp")); @@ -102,6 +104,8 @@ public CppQt5QHttpEngineServerCodegen() { supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt")); supportingFiles.add(new SupportingFile("Dockerfile.mustache", sourceFolder, "Dockerfile")); supportingFiles.add(new SupportingFile("LICENSE.txt.mustache", sourceFolder, "LICENSE.txt")); + typeMapping.put("file", PREFIX + "HttpFileElement"); + importMapping.put(PREFIX + "HttpFileElement", "#include \"" + PREFIX + "HttpFileElement.h\""); } @@ -115,9 +119,12 @@ public void processOpts() { supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "Helpers.cpp")); supportingFiles.add(new SupportingFile("object.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "Object.h")); supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "Enum.h")); + supportingFiles.add(new SupportingFile("HttpFileElement.h.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "HttpFileElement.h")); + supportingFiles.add(new SupportingFile("HttpFileElement.cpp.mustache", sourceFolder + MODEL_DIR, modelNamePrefix + "HttpFileElement.cpp")); supportingFiles.add(new SupportingFile("apirouter.h.mustache", sourceFolder + APIHANDLER_DIR, modelNamePrefix + "ApiRouter.h")); - supportingFiles.add(new SupportingFile("apirouter.cpp.mustache", sourceFolder + APIHANDLER_DIR, modelNamePrefix + "ApiRouter.cpp")); - + supportingFiles.add(new SupportingFile("apirouter.cpp.mustache", sourceFolder + APIHANDLER_DIR, modelNamePrefix + "ApiRouter.cpp")); + + supportingFiles.add(new SupportingFile("main.cpp.mustache", sourceFolder + SRC_DIR, "main.cpp")); supportingFiles.add(new SupportingFile("src-CMakeLists.txt.mustache", sourceFolder + SRC_DIR, "CMakeLists.txt")); supportingFiles.add(new SupportingFile("README.md.mustache", sourceFolder, "README.MD")); @@ -125,6 +132,8 @@ public void processOpts() { supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt")); supportingFiles.add(new SupportingFile("Dockerfile.mustache", sourceFolder, "Dockerfile")); supportingFiles.add(new SupportingFile("LICENSE.txt.mustache", sourceFolder, "LICENSE.txt")); + typeMapping.put("file", modelNamePrefix + "HttpFileElement"); + importMapping.put(modelNamePrefix + "HttpFileElement", "#include \"" + modelNamePrefix + "HttpFileElement.h\""); } } @@ -160,7 +169,7 @@ public String getName() { public String getHelp() { return "Generates a Qt5 C++ Server using the QHTTPEngine HTTP Library."; } - + /** * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated @@ -182,7 +191,7 @@ public String apiFileFolder() { private String requestFileFolder() { return outputFolder + "/" + sourceFolder + APIREQUEST_DIR + "/" + apiPackage().replace("::", File.separator); } - + @Override public String apiFilename(String templateName, String tag) { String result = super.apiFilename(templateName, tag); @@ -193,7 +202,7 @@ public String apiFilename(String templateName, String tag) { } return result; } - + @Override public String toApiFilename(String name) { return modelNamePrefix + sanitizeName(camelize(name)) + "ApiHandler"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index ddfdcbb0e0b4..25be57289d73 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -242,7 +242,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation if (response != null) { CodegenProperty cm = fromProperty("response", response); op.vendorExtensions.put("x-codegen-response", cm); - if ("HttpContent".equals(cm.dataType)) { + if ("std::shared_ptr".equals(cm.dataType)) { op.vendorExtensions.put("x-codegen-response-ishttpcontent", true); } } 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 8d9de1271e5c..7e4f21d662ee 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 @@ -62,7 +62,7 @@ public DartClientCodegen() { outputFolder = "generated-code/dart"; modelTemplateFiles.put("model.mustache", ".dart"); apiTemplateFiles.put("api.mustache", ".dart"); - embeddedTemplateDir = templateDir = "dart"; + embeddedTemplateDir = templateDir = "dart2"; apiPackage = "lib.api"; modelPackage = "lib.model"; modelDocTemplateFiles.put("object_doc.mustache", ".md"); @@ -118,13 +118,13 @@ public DartClientCodegen() { typeMapping.put("URI", "String"); typeMapping.put("ByteArray", "String"); - cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based")); + cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based (for Dart 1.x only)")); cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec")); cliOptions.add(new CliOption(PUB_VERSION, "Version in generated pubspec")); cliOptions.add(new CliOption(PUB_DESCRIPTION, "Description in generated pubspec")); cliOptions.add(new CliOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums")); - cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, "source folder for generated code")); - cliOptions.add(CliOption.newBoolean(SUPPORT_DART2, "support dart2").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, "Source folder for generated code")); + cliOptions.add(CliOption.newBoolean(SUPPORT_DART2, "Support Dart 2.x (Dart 1.x support has been deprecated)").defaultValue(Boolean.TRUE.toString())); } @Override @@ -139,7 +139,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a Dart (1.x or 2.x) client library."; + return "Generates a Dart (1.x (deprecated) or 2.x) client library."; } @Override @@ -202,7 +202,10 @@ public void processOpts() { } else { // dart 2.x LOGGER.info("Dart version: 2.x"); - embeddedTemplateDir = templateDir = "dart2"; + // check to not overwrite a custom templateDir + if (templateDir == null) { + embeddedTemplateDir = templateDir = "dart2"; + } } final String libFolder = sourceFolder + File.separator + "lib"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java index cc2516fee73c..0dd404e52a14 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java @@ -45,7 +45,7 @@ public class DartJaguarClientCodegen extends DartClientCodegen { modelToIgnore.add("object"); modelToIgnore.add("list"); modelToIgnore.add("file"); - modelToIgnore.add("uint8list"); + modelToIgnore.add("list"); } private static final String SERIALIZATION_JSON = "json"; @@ -63,8 +63,8 @@ public DartJaguarClientCodegen() { cliOptions.add(new CliOption(NULLABLE_FIELDS, "Is the null fields should be in the JSON payload")); cliOptions.add(new CliOption(SERIALIZATION_FORMAT, "Choose serialization format JSON or PROTO is supported")); - typeMapping.put("file", "Uint8List"); - typeMapping.put("binary", "Uint8List"); + typeMapping.put("file", "List"); + typeMapping.put("binary", "List"); protoTypeMapping.put("Array", "repeated"); protoTypeMapping.put("array", "repeated"); @@ -247,19 +247,19 @@ public Map postProcessOperationsWithModels(Map o } for (CodegenParameter param : op.allParams) { - if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) { + if (param.baseType != null && param.baseType.equalsIgnoreCase("List") && isMultipart) { param.baseType = "MultipartFile"; param.dataType = "MultipartFile"; } } for (CodegenParameter param : op.formParams) { - if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) { + if (param.baseType != null && param.baseType.equalsIgnoreCase("List") && isMultipart) { param.baseType = "MultipartFile"; param.dataType = "MultipartFile"; } } for (CodegenParameter param : op.bodyParams) { - if (param.baseType != null && param.baseType.equalsIgnoreCase("Uint8List") && isMultipart) { + if (param.baseType != null && param.baseType.equalsIgnoreCase("List") && isMultipart) { param.baseType = "MultipartFile"; param.dataType = "MultipartFile"; } @@ -274,8 +274,6 @@ public Map postProcessOperationsWithModels(Map o for (String item : op.imports) { if (!modelToIgnore.contains(item.toLowerCase(Locale.ROOT))) { imports.add(underscore(item)); - } else if (item.equalsIgnoreCase("Uint8List")) { - fullImports.add("dart:typed_data"); } } modelImports.addAll(imports); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java new file mode 100644 index 000000000000..442cbc3601bb --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java @@ -0,0 +1,129 @@ +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.*; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.Property; +import io.swagger.models.parameters.Parameter; + +import java.io.File; +import java.util.*; + +import org.apache.commons.lang3.StringUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen { + public static final String PROJECT_NAME = "projectName"; + + static Logger LOGGER = LoggerFactory.getLogger(FsharpFunctionsServerCodegen.class); + + public CodegenType getTag() { + return CodegenType.SERVER; + } + + public String getName() { + return "fsharp-functions"; + } + + public String getHelp() { + return "Generates a fsharp-functions server."; + } + + public FsharpFunctionsServerCodegen() { + super(); + + // CLI options + addOption(CodegenConstants.LICENSE_URL, + CodegenConstants.LICENSE_URL_DESC, + licenseUrl); + + addOption(CodegenConstants.LICENSE_NAME, + CodegenConstants.LICENSE_NAME_DESC, + licenseName); + + addOption(CodegenConstants.PACKAGE_COPYRIGHT, + CodegenConstants.PACKAGE_COPYRIGHT_DESC, + packageCopyright); + + addOption(CodegenConstants.PACKAGE_AUTHORS, + CodegenConstants.PACKAGE_AUTHORS_DESC, + packageAuthors); + + addOption(CodegenConstants.PACKAGE_TITLE, + CodegenConstants.PACKAGE_TITLE_DESC, + packageTitle); + + addOption(CodegenConstants.PACKAGE_NAME, + "F# module name (convention: Title.Case).", + packageName); + + addOption(CodegenConstants.PACKAGE_VERSION, + "F# package version.", + packageVersion); + + addOption(CodegenConstants.OPTIONAL_PROJECT_GUID, + CodegenConstants.OPTIONAL_PROJECT_GUID_DESC, + null); + + addOption(CodegenConstants.SOURCE_FOLDER, + CodegenConstants.SOURCE_FOLDER_DESC, + sourceFolder); + } + + @Override + public void processOpts() { + super.processOpts(); + + modelPackage = "Model"; + embeddedTemplateDir = templateDir = "fsharp-functions-server"; + + apiTemplateFiles.put("Handler.mustache", "Handler.fs"); + apiTemplateFiles.put("HandlerParams.mustache", "HandlerParams.fs"); + apiTemplateFiles.put("ServiceInterface.mustache", "ServiceInterface.fs"); + apiTemplateFiles.put("ServiceImpl.mustache", "Service.fs"); + modelTemplateFiles.put("Model.mustache", ".fs"); + + String implFolder = sourceFolder + File.separator + "impl"; + + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("build.sh.mustache", projectFolder, "build.sh")); + supportingFiles.add(new SupportingFile("build.bat.mustache", projectFolder, "build.bat")); + supportingFiles.add(new SupportingFile("host.json", "", "host.json")); + supportingFiles.add(new SupportingFile("local.settings.json", "", "local.settings.json")); + supportingFiles.add(new SupportingFile("Project.fsproj.mustache", projectFolder, packageName + ".fsproj")); + + + } + + @Override + public String modelFileFolder() { + return super.modelFileFolder().replace("Model","model"); + } + + @Override + public String apiFileFolder() { + return super.apiFileFolder() + File.separator + "api"; + } + + private String implFileFolder() { + return outputFolder + File.separator + sourceFolder + File.separator + "impl"; + } + + @Override() + public String toModelImport(String name) { + return packageName + "." + modelPackage() + "." + name; + } + + @Override + public String apiFilename(String templateName, String tag) { + String result = super.apiFilename(templateName, tag); + if (templateName.endsWith("Impl.mustache")) { + int ix = result.lastIndexOf(File.separatorChar); + result = result.substring(0, ix) + result.substring(ix, result.length() - 2) + "fs"; + result = result.replace(apiFileFolder(), implFileFolder()); + } + return result; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java index 8bbb27912a41..4cd842eed700 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java @@ -187,7 +187,6 @@ public void processOpts() { LOGGER.warn("Library flag not currently supported."); String authFolder = sourceFolder + File.separator + "auth"; - String serviceFolder = sourceFolder + File.separator + "services"; String implFolder = sourceFolder + File.separator + "impl"; String helperFolder = sourceFolder + File.separator + "helpers"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 749ae845c8e4..27bef303b060 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -55,7 +55,7 @@ public GoClientCodegen() { cliOptions.add(CliOption.newBoolean(CodegenConstants.IS_GO_SUBMODULE, CodegenConstants.IS_GO_SUBMODULE_DESC)); cliOptions.add(CliOption.newBoolean(WITH_GO_CODEGEN_COMMENT, "whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs")); cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); - + cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_CLASS_PREFIX, CodegenConstants.ENUM_CLASS_PREFIX_DESC)); // option to change the order of form/body parameter cliOptions.add(CliOption.newBoolean( @@ -114,6 +114,13 @@ public void processOpts() { } } + if (additionalProperties.containsKey(CodegenConstants.ENUM_CLASS_PREFIX)) { + setEnumClassPrefix(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_CLASS_PREFIX).toString())); + if (enumClassPrefix) { + additionalProperties.put(CodegenConstants.ENUM_CLASS_PREFIX, "true"); + } + } + if (additionalProperties.containsKey(CodegenConstants.IS_GO_SUBMODULE)) { setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString())); if (isGoSubmodule) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index ff0aafe24cbf..e541998cddc2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -19,6 +19,8 @@ import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,6 +35,10 @@ public GoClientExperimentalCodegen() { super(); outputFolder = "generated-code/go-experimental"; embeddedTemplateDir = templateDir = "go-experimental"; + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.EXPERIMENTAL) + .build(); } /** diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 6a69660348cc..889cad954321 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -1065,13 +1065,14 @@ private String mapCollectionFormat(String collectionFormat) { case "tsv": return "TabSeparated"; case "ssv": + case "space": return "SpaceSeparated"; case "pipes": return "PipeSeparated"; case "multi": return "MultiParamArray"; default: - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(collectionFormat + " (collection format) not supported"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index a46452c65c16..665cd9b85d44 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -549,6 +549,7 @@ private String makeQueryListType(String type, String collectionFormat) { return "(QueryList 'CommaSeparated (" + type + "))"; case "tsv": return "(QueryList 'TabSeparated (" + type + "))"; + case "space": case "ssv": return "(QueryList 'SpaceSeparated (" + type + "))"; case "pipes": @@ -556,7 +557,7 @@ private String makeQueryListType(String type, String collectionFormat) { case "multi": return "(QueryList 'MultiParamArray (" + type + "))"; default: - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(collectionFormat + " (collection format) not supported"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 8f1a232f8088..f548ea530a5c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -24,6 +24,7 @@ import org.openapitools.codegen.languages.features.GzipFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; import org.openapitools.codegen.templating.mustache.CaseFormatLambda; +import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -77,6 +78,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String RETROFIT_2 = "retrofit2"; public static final String VERTX = "vertx"; + public static final String SERIALIZATION_LIBRARY_GSON = "gson"; + public static final String SERIALIZATION_LIBRARY_JACKSON = "jackson"; + protected String gradleWrapperPackage = "gradle.wrapper"; protected boolean useRxJava = false; protected boolean useRxJava2 = false; @@ -94,6 +98,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean useReflectionEqualsHashCode = false; protected boolean caseInsensitiveResponseHeaders = false; protected String authFolder; + protected String serializationLibrary = null; public JavaClientCodegen() { super(); @@ -127,19 +132,18 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(USE_REFLECTION_EQUALS_HASHCODE, "Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.")); cliOptions.add(CliOption.newBoolean(CASE_INSENSITIVE_RESPONSE_HEADERS, "Make API response's headers case-insensitive. Available on " + OKHTTP_GSON + ", " + JERSEY2 + " libraries")); - - supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.8.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); - supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.8.x"); - supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.8.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'"); + supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); + supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); + supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.9.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'"); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)"); - supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.8.x"); + supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.8.x"); - supportedLibraries.put(VERTX, "HTTP client: VertX client 3.x. JSON processing: Jackson 2.8.x"); - supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.x. JSON processing: Jackson 2.8.x"); - supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x. Only for Java8"); + supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x"); + supportedLibraries.put(VERTX, "HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x"); + supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x"); + supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8"); supportedLibraries.put(NATIVE, "HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); @@ -149,6 +153,12 @@ public JavaClientCodegen() { cliOptions.add(libraryOption); setLibrary(OKHTTP_GSON); + CliOption serializationLibrary = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, "Serialization library, default depends from the library"); + Map serializationOptions = new HashMap<>(); + serializationOptions.put(SERIALIZATION_LIBRARY_GSON, "Use Gson as serialization library"); + serializationOptions.put(SERIALIZATION_LIBRARY_JACKSON, "Use Jackson as serialization library"); + serializationLibrary.setEnum(serializationOptions); + cliOptions.add(serializationLibrary); } @Override @@ -283,6 +293,10 @@ public void processOpts() { "BeanValidationException.java")); } + if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { + setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); + } + //TODO: add doc to retrofit1 and feign if (FEIGN.equals(getLibrary()) || RETROFIT_1.equals(getLibrary())) { modelDocTemplateFiles.remove("model_doc.mustache"); @@ -300,7 +314,7 @@ public void processOpts() { } if (FEIGN.equals(getLibrary())) { - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java")); } else if (OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { @@ -315,53 +329,60 @@ public void processOpts() { // NOTE: below moved to postProcessOpoerationsWithModels //supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); //supportingFiles.add(new SupportingFile("auth/RetryingOAuth.mustache", authFolder, "RetryingOAuth.java")); - additionalProperties.put("gson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_GSON); } else if (usesAnyRetrofitLibrary()) { supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); supportingFiles.add(new SupportingFile("CollectionFormats.mustache", invokerFolder, "CollectionFormats.java")); - additionalProperties.put("gson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_GSON); if ("retrofit2".equals(getLibrary()) && !usePlayWS) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); } } else if (JERSEY2.equals(getLibrary())) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (NATIVE.equals(getLibrary())) { setJava8Mode(true); additionalProperties.put("java8", "true"); - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (RESTEASY.equals(getLibrary())) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (JERSEY1.equals(getLibrary())) { - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (RESTTEMPLATE.equals(getLibrary())) { - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java")); } else if (WEBCLIENT.equals(getLibrary())) { setJava8Mode(true); additionalProperties.put("java8", "true"); - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (VERTX.equals(getLibrary())) { typeMapping.put("file", "AsyncFile"); importMapping.put("AsyncFile", "io.vertx.core.file.AsyncFile"); setJava8Mode(true); additionalProperties.put("java8", "true"); - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); apiTemplateFiles.put("apiImpl.mustache", "Impl.java"); apiTemplateFiles.put("rxApiImpl.mustache", ".java"); supportingFiles.remove(new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml")); } else if (GOOGLE_API_CLIENT.equals(getLibrary())) { - additionalProperties.put("jackson", "true"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (REST_ASSURED.equals(getLibrary())) { - additionalProperties.put("gson", "true"); + if(getSerializationLibrary() == null) { + LOGGER.info("No serializationLibrary configured, using '"+SERIALIZATION_LIBRARY_GSON+"' as fallback"); + setSerializationLibrary(SERIALIZATION_LIBRARY_GSON); + } + if(SERIALIZATION_LIBRARY_JACKSON.equals(getSerializationLibrary())) { + supportingFiles.add(new SupportingFile("JacksonObjectMapper.mustache", invokerFolder, "JacksonObjectMapper.java")); + } else if (SERIALIZATION_LIBRARY_GSON.equals(getSerializationLibrary())) { + supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); + supportingFiles.add(new SupportingFile("GsonObjectMapper.mustache", invokerFolder, "GsonObjectMapper.java")); + } additionalProperties.put("convert", new CaseFormatLambda(LOWER_CAMEL, UPPER_UNDERSCORE)); apiTemplateFiles.put("api.mustache", ".java"); supportingFiles.add(new SupportingFile("ResponseSpecBuilders.mustache", invokerFolder, "ResponseSpecBuilders.java")); - supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); - supportingFiles.add(new SupportingFile("GsonObjectMapper.mustache", invokerFolder, "GsonObjectMapper.java")); } else { LOGGER.error("Unknown library option (-l/--library): " + getLibrary()); } @@ -414,16 +435,30 @@ public void processOpts() { supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java")); supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java")); - additionalProperties.put("jackson", "true"); - additionalProperties.remove("gson"); + forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } - if (additionalProperties.containsKey("jackson") && !NATIVE.equals(getLibrary())) { - supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder, "RFC3339DateFormat.java")); - if ("threetenbp".equals(dateLibrary) && !usePlayWS) { - supportingFiles.add(new SupportingFile("CustomInstantDeserializer.mustache", invokerFolder, "CustomInstantDeserializer.java")); + if(getSerializationLibrary() == null) { + LOGGER.info("No serializationLibrary configured, using '"+SERIALIZATION_LIBRARY_GSON+"' as fallback"); + setSerializationLibrary(SERIALIZATION_LIBRARY_GSON); + } + if(SERIALIZATION_LIBRARY_JACKSON.equals(getSerializationLibrary())) { + additionalProperties.put(SERIALIZATION_LIBRARY_JACKSON, "true"); + additionalProperties.remove(SERIALIZATION_LIBRARY_GSON); + if (!NATIVE.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder, "RFC3339DateFormat.java")); + if ("threetenbp".equals(dateLibrary) && !usePlayWS) { + supportingFiles.add(new SupportingFile("CustomInstantDeserializer.mustache", invokerFolder, "CustomInstantDeserializer.java")); + } } + } else if (SERIALIZATION_LIBRARY_GSON.equals(getSerializationLibrary())) { + additionalProperties.put(SERIALIZATION_LIBRARY_GSON, "true"); + additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); + } else { + additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); + additionalProperties.remove(SERIALIZATION_LIBRARY_GSON); } + } private boolean usesAnyRetrofitLibrary() { @@ -580,11 +615,12 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert if (!BooleanUtils.toBoolean(model.isEnum)) { //final String lib = getLibrary(); //Needed imports for Jackson based libraries - if (additionalProperties.containsKey("jackson")) { + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { model.imports.add("JsonProperty"); model.imports.add("JsonValue"); + model.imports.add("JsonInclude"); } - if (additionalProperties.containsKey("gson")) { + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_GSON)) { model.imports.add("SerializedName"); model.imports.add("TypeAdapter"); model.imports.add("JsonAdapter"); @@ -594,7 +630,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } else { // enum class //Needed imports for Jackson's JsonCreator - if (additionalProperties.containsKey("jackson")) { + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { model.imports.add("JsonValue"); model.imports.add("JsonCreator"); } @@ -605,7 +641,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert public Map postProcessModelsEnum(Map objs) { objs = super.postProcessModelsEnum(objs); //Needed import for Gson based libraries - if (additionalProperties.containsKey("gson")) { + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_GSON)) { List> imports = (List>) objs.get("imports"); List models = (List) objs.get("models"); for (Object _mo : models) { @@ -623,6 +659,39 @@ public Map postProcessModelsEnum(Map objs) { return objs; } + @Override + public Map postProcessModels(Map objs) { + objs = super.postProcessModels(objs); + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON) && !JERSEY1.equals(getLibrary())) { + List> imports = (List>) objs.get("imports"); + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + boolean addImports = false; + for (CodegenProperty var : cm.vars) { + boolean isOptionalNullable = Boolean.FALSE.equals(var.required) && Boolean.TRUE.equals(var.isNullable); + // only add JsonNullable and related imports to optional and nullable values + addImports |= isOptionalNullable; + var.getVendorExtensions().put("isJacksonOptionalNullable", isOptionalNullable); + } + if (addImports) { + cm.imports.add("JsonNullable"); + Map itemJsonNullable = new HashMap(); + itemJsonNullable.put("import", "org.openapitools.jackson.nullable.JsonNullable"); + imports.add(itemJsonNullable); + + cm.imports.add("NoSuchElementException"); + Map itemExc = new HashMap(); + itemExc.put("import", "java.util.NoSuchElementException"); + imports.add(itemExc); + } + } + } + + return objs; + } + public void setUseRxJava(boolean useRxJava) { this.useRxJava = useRxJava; doNotUseRx = false; @@ -677,6 +746,31 @@ public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveRespo this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } + /** + * Serialization library. + * @return 'gson' or 'jackson' + */ + public String getSerializationLibrary() { + return serializationLibrary; + } + + public void setSerializationLibrary(String serializationLibrary) { + if(SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) { + this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; + } else if(SERIALIZATION_LIBRARY_GSON.equalsIgnoreCase(serializationLibrary)) { + this.serializationLibrary = SERIALIZATION_LIBRARY_GSON; + } else { + throw new IllegalArgumentException("Unexpected serializationLibrary value: " + serializationLibrary); + } + } + + public void forceSerializationLibrary(String serializationLibrary) { + if((this.serializationLibrary != null) && !this.serializationLibrary.equalsIgnoreCase(serializationLibrary)) { + LOGGER.warn("The configured serializationLibrary '" + this.serializationLibrary + "', is not supported by the library: '" + getLibrary() + "', switching back to: " + serializationLibrary); + } + setSerializationLibrary(serializationLibrary); + } + final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?"); final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java index 8b7736fce321..42251432c293 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -239,6 +239,9 @@ public String getHelp() { public String toApiName(final String name) { String computed = name; if (computed.length() == 0) { + if (primaryResourceName == null) { + return "DefaultApi"; + } return primaryResourceName + "Api"; } computed = sanitizeName(computed); 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 adb1eba7cf1f..a0a927780581 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 @@ -19,21 +19,42 @@ import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; import java.io.File; import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; public class KotlinClientCodegen extends AbstractKotlinCodegen { + protected static final String VENDOR_EXTENSION_ESCAPED_NAME = "x-escapedName"; + + protected static final String JVM = "jvm"; + protected static final String MULTIPLATFORM = "multiplatform"; + public static final String DATE_LIBRARY = "dateLibrary"; public static final String COLLECTION_TYPE = "collectionType"; protected String dateLibrary = DateLibrary.JAVA8.value; protected String collectionType = CollectionType.ARRAY.value; + // https://kotlinlang.org/docs/reference/grammar.html#Identifier + protected static final Pattern IDENTIFIER_PATTERN = + Pattern.compile("[\\p{Ll}\\p{Lm}\\p{Lo}\\p{Lt}\\p{Lu}\\p{Nl}_][\\p{Ll}\\p{Lm}\\p{Lo}\\p{Lt}\\p{Lu}\\p{Nl}\\p{Nd}_]*"); + + // https://kotlinlang.org/docs/reference/grammar.html#Identifier + protected static final String IDENTIFIER_REPLACEMENTS = + "[.;:/\\[\\]<>]"; + public enum DateLibrary { STRING("string"), THREETENBP("threetenbp"), @@ -81,9 +102,9 @@ public KotlinClientCodegen() { CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use"); Map dateOptions = new HashMap<>(); - dateOptions.put(DateLibrary.THREETENBP.value, "Threetenbp"); + dateOptions.put(DateLibrary.THREETENBP.value, "Threetenbp (jvm only)"); dateOptions.put(DateLibrary.STRING.value, "String"); - dateOptions.put(DateLibrary.JAVA8.value, "Java 8 native JSR310"); + dateOptions.put(DateLibrary.JAVA8.value, "Java 8 native JSR310 (jvm only)"); dateLibrary.setEnum(dateOptions); dateLibrary.setDefault(this.dateLibrary); cliOptions.add(dateLibrary); @@ -95,6 +116,15 @@ public KotlinClientCodegen() { collectionType.setEnum(collectionOptions); collectionType.setDefault(this.collectionType); cliOptions.add(collectionType); + + supportedLibraries.put(JVM, "Platform: Java Virtual Machine. HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1."); + supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0."); + + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use"); + libraryOption.setEnum(supportedLibraries); + libraryOption.setDefault(JVM); + cliOptions.add(libraryOption); + setLibrary(JVM); } public CodegenType getTag() { @@ -121,10 +151,80 @@ public void setCollectionType(String collectionType) { public void processOpts() { super.processOpts(); + if (MULTIPLATFORM.equals(getLibrary())) { + sourceFolder = "src/commonMain/kotlin"; + } + + // infrastructure destination folder + final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/"); + + // additional properties if (additionalProperties.containsKey(DATE_LIBRARY)) { setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); } + // common (jvm/multiplatform) supporting files + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); + supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + supportingFiles.add(new SupportingFile("infrastructure/ApiClient.kt.mustache", infrastructureFolder, "ApiClient.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ApiAbstractions.kt.mustache", infrastructureFolder, "ApiAbstractions.kt")); + supportingFiles.add(new SupportingFile("infrastructure/RequestConfig.kt.mustache", infrastructureFolder, "RequestConfig.kt")); + supportingFiles.add(new SupportingFile("infrastructure/RequestMethod.kt.mustache", infrastructureFolder, "RequestMethod.kt")); + + if (JVM.equals(getLibrary())) { + additionalProperties.put(JVM, true); + + // jvm specific supporting files + supportingFiles.add(new SupportingFile("infrastructure/ApplicationDelegates.kt.mustache", infrastructureFolder, "ApplicationDelegates.kt")); + supportingFiles.add(new SupportingFile("infrastructure/Errors.kt.mustache", infrastructureFolder, "Errors.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ResponseExtensions.kt.mustache", infrastructureFolder, "ResponseExtensions.kt")); + supportingFiles.add(new SupportingFile("infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ApiInfrastructureResponse.kt.mustache", infrastructureFolder, "ApiInfrastructureResponse.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt")); + 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")); + + } else if (MULTIPLATFORM.equals(getLibrary())) { + additionalProperties.put(MULTIPLATFORM, true); + setDateLibrary(DateLibrary.STRING.value); + + // multiplatform default includes + defaultIncludes.add("io.ktor.client.request.forms.InputProvider"); + + // multiplatform type mapping + typeMapping.put("number", "kotlin.Double"); + typeMapping.put("file", "InputProvider"); + + // multiplatform import mapping + importMapping.put("BigDecimal", "kotlin.Double"); + importMapping.put("UUID", "kotlin.String"); + importMapping.put("URI", "kotlin.String"); + importMapping.put("InputProvider", "io.ktor.client.request.forms.InputProvider"); + importMapping.put("File", "io.ktor.client.request.forms.InputProvider"); + importMapping.put("Timestamp", "kotlin.String"); + importMapping.put("LocalDateTime", "kotlin.String"); + importMapping.put("LocalDate", "kotlin.String"); + importMapping.put("LocalTime", "kotlin.String"); + + // multiplatform specific supporting files + supportingFiles.add(new SupportingFile("infrastructure/HttpResponse.kt.mustache", infrastructureFolder, "HttpResponse.kt")); + + // multiplatform specific testing files + final String testFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/"); + supportingFiles.add(new SupportingFile("commonTest/coroutine.mustache", "src/commonTest/kotlin/util", "Coroutine.kt")); + supportingFiles.add(new SupportingFile("iosTest/coroutine.mustache", "src/iosTest/kotlin/util", "Coroutine.kt")); + supportingFiles.add(new SupportingFile("jvmTest/coroutine.mustache", "src/jvmTest/kotlin/util", "Coroutine.kt")); + + // gradle wrapper supporting files + supportingFiles.add(new SupportingFile("gradlew.mustache", "", "gradlew")); + supportingFiles.add(new SupportingFile("gradlew.bat.mustache", "", "gradlew.bat")); + supportingFiles.add(new SupportingFile("gradle-wrapper.properties.mustache", "gradle.wrapper".replace(".", File.separator), "gradle-wrapper.properties")); + supportingFiles.add(new SupportingFile("gradle-wrapper.jar", "gradle.wrapper".replace(".", File.separator), "gradle-wrapper.jar")); + } + + // date library processing if (DateLibrary.THREETENBP.value.equals(dateLibrary)) { additionalProperties.put(DateLibrary.THREETENBP.value, true); typeMapping.put("date", "LocalDate"); @@ -151,25 +251,83 @@ public void processOpts() { typeMapping.put("list", "kotlin.collections.List"); additionalProperties.put("isList", true); } + } - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); - supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + @Override + public Map postProcessModels(Map objs) { + objs = super.postProcessModels(objs); + return postProcessModelsEscapeNames(objs); + } - final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/"); + @SuppressWarnings("unchecked") + private static Map postProcessModelsEscapeNames(Map objs) { + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); - supportingFiles.add(new SupportingFile("infrastructure/ApiClient.kt.mustache", infrastructureFolder, "ApiClient.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ApiAbstractions.kt.mustache", infrastructureFolder, "ApiAbstractions.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ApiInfrastructureResponse.kt.mustache", infrastructureFolder, "ApiInfrastructureResponse.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ApplicationDelegates.kt.mustache", infrastructureFolder, "ApplicationDelegates.kt")); - supportingFiles.add(new SupportingFile("infrastructure/RequestConfig.kt.mustache", infrastructureFolder, "RequestConfig.kt")); - supportingFiles.add(new SupportingFile("infrastructure/RequestMethod.kt.mustache", infrastructureFolder, "RequestMethod.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ResponseExtensions.kt.mustache", infrastructureFolder, "ResponseExtensions.kt")); - supportingFiles.add(new SupportingFile("infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); - supportingFiles.add(new SupportingFile("infrastructure/Errors.kt.mustache", infrastructureFolder, "Errors.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt")); - 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 (cm.vars != null) { + for (CodegenProperty var : cm.vars) { + var.vendorExtensions.put(VENDOR_EXTENSION_ESCAPED_NAME, escapeIdentifier(var.name)); + } + } + if (cm.requiredVars != null) { + for (CodegenProperty var : cm.requiredVars) { + var.vendorExtensions.put(VENDOR_EXTENSION_ESCAPED_NAME, escapeIdentifier(var.name)); + } + } + if (cm.optionalVars != null) { + for (CodegenProperty var : cm.optionalVars) { + var.vendorExtensions.put(VENDOR_EXTENSION_ESCAPED_NAME, escapeIdentifier(var.name)); + } + } + } + return objs; + } + + private static String escapeIdentifier(String identifier) { + + // the kotlin grammar permits a wider set of characters in their identifiers that all target + // platforms permit (namely jvm). in order to remain compatible with target platforms, we + // initially replace all illegal target characters before escaping the identifier if required. + identifier = identifier.replaceAll(IDENTIFIER_REPLACEMENTS, "_"); + if (IDENTIFIER_PATTERN.matcher(identifier).matches()) return identifier; + return '`' + identifier + '`'; + } + + private static void removeDuplicates(List list) { + Set set = new HashSet<>(); + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + CodegenProperty item = iterator.next(); + if (set.contains(item.name)) iterator.remove(); + else set.add(item.name); + } + } + + @Override + @SuppressWarnings("unchecked") + public Map postProcessOperationsWithModels(Map objs, List allModels) { + super.postProcessOperationsWithModels(objs, allModels); + Map operations = (Map) objs.get("operations"); + if (operations != null) { + List ops = (List) operations.get("operation"); + for (CodegenOperation operation : ops) { + if (operation.hasConsumes == Boolean.TRUE) { + if (isMultipartType(operation.consumes)) { + operation.isMultipart = Boolean.TRUE; + } + } + } + } + return operations; + } + + private static boolean isMultipartType(List> consumes) { + Map firstType = consumes.get(0); + if (firstType != null) { + return "multipart/form-data".equals(firstType.get("mediaType")); + } + return false; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java new file mode 100644 index 000000000000..36fddf1812aa --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java @@ -0,0 +1,87 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Locale; + +public class KotlinVertxServerCodegen extends AbstractKotlinCodegen { + + protected String rootPackage = "org.openapitools.server.api"; + protected String apiVersion = "1.0.0-SNAPSHOT"; + + public static final String ROOT_PACKAGE = "rootPackage"; + + public static final String PROJECT_NAME = "projectName"; + + static Logger LOGGER = LoggerFactory.getLogger(KotlinVertxServerCodegen.class); + + public CodegenType getTag() { + return CodegenType.SERVER; + } + + public String getName() { + return "kotlin-vertx"; + } + + public String getHelp() { + return "Generates a kotlin-vertx server."; + } + + public KotlinVertxServerCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + outputFolder = "generated-code" + File.separator + "kotlin-vertx"; + modelTemplateFiles.put("model.mustache", ".kt"); + + apiTestTemplateFiles.clear(); + modelDocTemplateFiles.clear(); + supportingFiles.clear(); + + apiTemplateFiles.clear(); + apiTemplateFiles.put("api.mustache", ".kt"); + apiTemplateFiles.put("apiProxy.mustache", "VertxProxyHandler.kt"); + apiTemplateFiles.put("api_verticle.mustache", "Verticle.kt"); + + embeddedTemplateDir = templateDir = "kotlin-vertx-server"; + apiPackage = rootPackage + ".verticle"; + modelPackage = rootPackage + ".model"; + artifactId = "openapi-kotlin-vertx-server"; + artifactVersion = apiVersion; + + updateOption(CodegenConstants.API_PACKAGE, apiPackage); + updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); + additionalProperties.put(ROOT_PACKAGE, rootPackage); + + supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + + } + +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java new file mode 100644 index 000000000000..939f7e62498e --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -0,0 +1,331 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; + +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { + static Logger LOGGER = LoggerFactory.getLogger(NimClientCodegen.class); + + public static final String PROJECT_NAME = "projectName"; + + protected String packageName = "openapiclient"; + protected String packageVersion = "1.0.0"; + + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + public String getName() { + return "nim"; + } + + public String getHelp() { + return "Generates a nim client (beta)."; + } + + public NimClientCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + outputFolder = "generated-code" + File.separator + "nim"; + modelTemplateFiles.put("model.mustache", ".nim"); + apiTemplateFiles.put("api.mustache", ".nim"); + embeddedTemplateDir = templateDir = "nim-client"; + apiPackage = File.separator + packageName + File.separator + "apis"; + modelPackage = File.separator + packageName + File.separator + "models"; + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("sample_client.mustache", "", "sample_client.nim")); + supportingFiles.add(new SupportingFile("config.mustache", "", "config.nim")); + + setReservedWordsLowerCase( + Arrays.asList( + "addr", "and", "as", "asm", + "bind", "block", "break", + "case", "cast", "concept", "const", "continue", "converter", + "defer", "discard", "distinct", "div", "do", + "elif", "else", "end", "enum", "except", "export", + "finally", "for", "from", "func", + "if", "import", "in", "include", "interface", "is", "isnot", "iterator", + "let", + "macro", "method", "mixin", "mod", + "nil", "not", "notin", + "object", "of", "or", "out", + "proc", "ptr", + "raise", "ref", "return", + "shl", "shr", "static", + "template", "try", "tuple", "type", + "using", + "var", + "when", "while", + "xor", + "yield" + ) + ); + + defaultIncludes = new HashSet( + Arrays.asList( + "array" + ) + ); + + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "int", + "int8", + "int16", + "int32", + "int64", + "uint", + "uint8", + "uint16", + "uint32", + "uint64", + "float", + "float32", + "float64", + "bool", + "char", + "string", + "cstring", + "pointer") + ); + + typeMapping.clear(); + typeMapping.put("integer", "int"); + typeMapping.put("long", "int64"); + typeMapping.put("number", "float"); + typeMapping.put("float", "float"); + typeMapping.put("double", "float64"); + typeMapping.put("boolean", "bool"); + typeMapping.put("UUID", "string"); + typeMapping.put("URI", "string"); + typeMapping.put("date", "string"); + typeMapping.put("DateTime", "string"); + typeMapping.put("password", "string"); + typeMapping.put("file", "string"); + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + @Override + public Map postProcessModels(Map objs) { + return postProcessModelsEnum(objs); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } + + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + + apiPackage = File.separator + packageName + File.separator + "apis"; + modelPackage = File.separator + packageName + File.separator + "models"; + supportingFiles.add(new SupportingFile("lib.mustache", "", packageName + ".nim")); + } + + @Override + public String escapeReservedWord(String name) { + LOGGER.warn("A reserved word \"" + name + "\" is used. Consider renaming the field name"); + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "`" + name + "`"; + } + + @Override + public String escapeQuotationMark(String input) { + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public String toModelImport(String name) { + name = name.replaceAll("-", "_"); + if (importMapping.containsKey(name)) { + return "model_" + StringUtils.underscore(importMapping.get(name)); + } else { + return "model_" + StringUtils.underscore(name); + } + } + + @Override + public String toApiImport(String name) { + name = name.replaceAll("-", "_"); + if (importMapping.containsKey(name)) { + return "api_" + StringUtils.underscore(importMapping.get(name)); + } else { + return "api_" + StringUtils.underscore(name); + } + } + + @Override + public String toModelFilename(String name) { + name = name.replaceAll("-", "_"); + return "model_" + StringUtils.underscore(name); + } + + @Override + public String toApiFilename(String name) { + name = name.replaceAll("-", "_"); + return "api_" + StringUtils.underscore(name); + } + + @Override + public String toOperationId(String operationId) { + String sanitizedOperationId = sanitizeName(operationId); + + if (isReservedWord(sanitizedOperationId)) { + sanitizedOperationId = "call" + StringUtils.camelize(sanitizedOperationId, false); + } + + return StringUtils.camelize(sanitizedOperationId, true); + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + @SuppressWarnings("unchecked") + Map objectMap = (Map) objs.get("operations"); + @SuppressWarnings("unchecked") + List operations = (List) objectMap.get("operation"); + for (CodegenOperation operation : operations) { + operation.httpMethod = operation.httpMethod.toLowerCase(Locale.ROOT); + } + + return objs; + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + if (inner == null) { + return null; + } + return "seq[" + getTypeDeclaration(inner) + "]"; + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = ModelUtils.getAdditionalProperties(p); + if (inner == null) { + inner = new StringSchema(); + } + return "Table[string, " + getTypeDeclaration(inner) + "]"; + } + + String schemaType = getSchemaType(p); + if (typeMapping.containsKey(schemaType)) { + return typeMapping.get(schemaType); + } + + if (schemaType.matches("\\d.*")) { // starts with number + return "`" + schemaType + "`"; + } else { + return schemaType; + } + } + + @Override + public String toVarName(String name) { + if (isReservedWord(name)) { + name = escapeReservedWord(name); + } + + if (name.matches("^\\d.*")) { + name = "`" + name + "`"; + } + + return name; + } + + @Override + public String toParamName(String name) { + return toVarName(name); + } + + @Override + protected boolean needToImport(String type) { + if (defaultIncludes.contains(type)) { + return false; + } else if (languageSpecificPrimitives.contains(type)) { + return false; + } else if (typeMapping.containsKey(type) && languageSpecificPrimitives.contains(typeMapping.get(type))) { + return false; + } + + return true; + } + + @Override + public String toEnumName(CodegenProperty property) { + String name = StringUtils.camelize(property.name, false); + + if (name.matches("\\d.*")) { // starts with number + return "`" + name + "`"; + } else { + return name; + } + } + + @Override + public String toEnumVarName(String name, String datatype) { + name = name.replace(" ", "_"); + name = StringUtils.camelize(name, false); + + if (name.matches("\\d.*")) { // starts with number + return "`" + name + "`"; + } else { + return name; + } + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java index 19a4b60d05b5..9b9dd6ce4097 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java @@ -163,11 +163,11 @@ public String apiFilename(String templateName, String tag) { if (templateName.equals("service.mustache")) { String stringToMatch = File.separator + "controllers" + File.separator; String replacement = File.separator + implFolder + File.separator; - result = result.replaceAll(Pattern.quote(stringToMatch), replacement); - + result = result.replace(stringToMatch, replacement); + stringToMatch = "Controller.js"; replacement = "Service.js"; - result = result.replaceAll(Pattern.quote(stringToMatch), replacement); + result = result.replace(stringToMatch, replacement); } return result; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java index e6a69a80a147..ae97d9dbce2e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java @@ -17,13 +17,13 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import org.apache.commons.io.FileUtils; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.serializer.SerializerUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,11 +58,11 @@ public String getHelp() { @Override public void processOpenAPI(OpenAPI openAPI) { - String swaggerString = Json.pretty(openAPI); + String jsonOpenAPI = SerializerUtils.toJsonString(openAPI); try { String outputFile = outputFolder + File.separator + "openapi.json"; - FileUtils.writeStringToFile(new File(outputFile), swaggerString); + FileUtils.writeStringToFile(new File(outputFile), jsonOpenAPI); LOGGER.info("wrote file to " + outputFile); } catch (Exception e) { LOGGER.error(e.getMessage(), e); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java new file mode 100644 index 000000000000..93b7faf09e1b --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -0,0 +1,458 @@ +/* + * Copyright 2019 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; + +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.utils.ProcessUtils; +import org.openapitools.codegen.utils.ModelUtils; + +import org.apache.commons.lang3.StringUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; +import java.util.regex.Pattern; + +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class); + + protected String packageName = "openapitools"; + + @Override + public CodegenType getTag() { + return CodegenType.CONFIG; + } + + public String getName() { + return "protobuf-schema"; + } + + public String getHelp() { + return "Generates gRPC and protocol buffer schema files (beta)"; + } + + public ProtobufSchemaCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + outputFolder = "generated-code/protobuf-schema"; + modelTemplateFiles.put("model.mustache", ".proto"); + apiTemplateFiles.put("api.mustache", ".proto"); + embeddedTemplateDir = templateDir = "protobuf-schema"; + hideGenerationTimestamp = Boolean.TRUE; + modelPackage = "messages"; + apiPackage = "services"; + + /*setReservedWordsLowerCase( + Arrays.asList( + // data type + "nil", "string", "boolean", "number", "userdata", "thread", + "table", + + // reserved words: http://www.lua.org/manual/5.1/manual.html#2.1 + "and", "break", "do", "else", "elseif", + "end", "false", "for", "function", "if", + "in", "local", "nil", "not", "or", + "repeat", "return", "then", "true", "until", "while" + ) + );*/ + + defaultIncludes = new HashSet( + Arrays.asList( + "map", + "array") + ); + + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "map", + "array", + "bool", + "bytes", + "string", + "int32", + "int64", + "uint32", + "uint64", + "sint32", + "sint64", + "fixed32", + "fixed64", + "sfixed32", + "sfixed64", + "float", + "double") + ); + + instantiationTypes.clear(); + instantiationTypes.put("array", "repeat"); + //instantiationTypes.put("map", "map"); + + // ref: https://developers.google.com/protocol-buffers/docs/proto + typeMapping.clear(); + typeMapping.put("array", "array"); + typeMapping.put("map", "map"); + typeMapping.put("integer", "int32"); + typeMapping.put("long", "int64"); + typeMapping.put("number", "float"); + typeMapping.put("float", "float"); + typeMapping.put("double", "double"); + typeMapping.put("boolean", "bool"); + typeMapping.put("string", "string"); + typeMapping.put("UUID", "string"); + typeMapping.put("URI", "string"); + typeMapping.put("date", "string"); + typeMapping.put("DateTime", "string"); + typeMapping.put("password", "string"); + // TODO fix file mapping + typeMapping.put("file", "string"); + typeMapping.put("binary", "string"); + typeMapping.put("ByteArray", "bytes"); + typeMapping.put("object", "TODO_OBJECT_MAPPING"); + + importMapping.clear(); + /* + importMapping = new HashMap(); + importMapping.put("time.Time", "time"); + importMapping.put("*os.File", "os"); + importMapping.put("os", "io/ioutil"); + */ + + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + + cliOptions.clear(); + /*cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "GraphQL package name (convention: lowercase).") + .defaultValue("openapi2graphql")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "GraphQL package version.") + .defaultValue("1.0.0")); + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) + .defaultValue(Boolean.TRUE.toString()));*/ + + } + + @Override + public void processOpts() { + super.processOpts(); + + //apiTestTemplateFiles.put("api_test.mustache", ".proto"); + //modelTestTemplateFiles.put("model_test.mustache", ".proto"); + + apiDocTemplateFiles.clear(); // TODO: add api doc template + modelDocTemplateFiles.clear(); // TODO: add model doc template + + modelPackage = "models"; + apiPackage = "services"; + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } + + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + //supportingFiles.add(new SupportingFile("root.mustache", "", packageName + ".proto")); + //supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + //supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")) + //supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); + } + + @Override + public String toOperationId(String operationId) { + // throw exception if method name is empty (should not occur as an auto-generated method name will be used) + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method name (operationId) not allowed"); + } + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + + return camelize(sanitizeName(operationId)); + } + + @Override + public Map postProcessModels(Map objs) { + objs = postProcessModelsEnum(objs); + List models = (List) objs.get("models"); + // add x-index to properties + ProcessUtils.addIndexToProperties(models, 1); + + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + + for (CodegenProperty var : cm.vars) { + // add x-protobuf-type: repeated if it's an array + if (Boolean.TRUE.equals(var.isListContainer)) { + var.vendorExtensions.put("x-protobuf-type", "repeated"); + } + + // add x-protobuf-data-type + // ref: https://developers.google.com/protocol-buffers/docs/proto3 + if (!var.vendorExtensions.containsKey("x-protobuf-data-type")) { + if (var.isListContainer) { + var.vendorExtensions.put("x-protobuf-data-type", var.items.dataType); + } else { + var.vendorExtensions.put("x-protobuf-data-type", var.dataType); + } + } + + if (var.isEnum && var.allowableValues.containsKey("enumVars")) { + List> enumVars = (List>) var.allowableValues.get("enumVars"); + int enumIndex = 0; + for (Map enumVar : enumVars) { + enumVar.put("protobuf-enum-index", enumIndex); + enumIndex++; + } + } + } + } + return objs; + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input; + } + + @Override + public String escapeQuotationMark(String input) { + return input; + } + + /** + * Return the default value of the property + * + * @param p OpenAPI property object + * @return string presentation of the default value of the property + */ + @Override + public String toDefaultValue(Schema p) { + if (ModelUtils.isBooleanSchema(p)) { + if (p.getDefault() != null) { + if (Boolean.valueOf(p.getDefault().toString()) == false) + return "false"; + else + return "true"; + } + } else if (ModelUtils.isDateSchema(p)) { + // TODO + } else if (ModelUtils.isDateTimeSchema(p)) { + // TODO + } else if (ModelUtils.isNumberSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } + } else if (ModelUtils.isIntegerSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } + } else if (ModelUtils.isStringSchema(p)) { + if (p.getDefault() != null) { + if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find()) + return "'''" + p.getDefault() + "'''"; + else + return "'" + p.getDefault() + "'"; + } + } else if (ModelUtils.isArraySchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } + } + + return null; + } + + @Override + public String apiFileFolder() { + return outputFolder + File.separatorChar + apiPackage; + } + + @Override + public String modelFileFolder() { + return outputFolder + File.separatorChar + modelPackage; + } + + @Override + public String toApiFilename(String name) { + // replace - with _ e.g. created-at => created_at + name = name.replaceAll("-", "_"); + + // e.g. PhoneNumber => phone_number + return underscore(name) + "_service"; + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultService"; + } + // e.g. phone_number => PhoneNumber + return camelize(name) + "Service"; + } + + @Override + public String toApiVarName(String name) { + if (name.length() == 0) { + return "default_service"; + } + return underscore(name) + "_service"; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + @Override + public String toModelFilename(String name) { + // underscore the model file name + // PhoneNumber => phone_number + return underscore(toModelName(name)); + } + + @Override + public String toModelName(String name) { + name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + // remove dollar sign + name = name.replaceAll("$", ""); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(name)) { + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name)); + name = "model_" + name; // e.g. return => ModelReturn (after camelize) + } + + // model name starts with number + if (name.matches("^\\d.*")) { + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name)); + name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) + } + + if (!StringUtils.isEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } + + // camelize the model name + // phone_number => PhoneNumber + return camelize(name); + } + + @Override + public String getSchemaType(Schema p) { + String schemaType = super.getSchemaType(p); + String type = null; + if (typeMapping.containsKey(schemaType)) { + type = typeMapping.get(schemaType); + if (languageSpecificPrimitives.contains(type)) { + return type; + } + } else { + type = toModelName(schemaType); + } + return type; + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + int index = 1; + for (CodegenParameter p : op.allParams) { + // add x-protobuf-type: repeated if it's an array + if (Boolean.TRUE.equals(p.isListContainer)) { + p.vendorExtensions.put("x-protobuf-type", "repeated"); + } else if (Boolean.TRUE.equals(p.isMapContainer)) { + LOGGER.warn("Map parameter (name: {}, operation ID: {}) not yet supported", p.paramName, op.operationId); + } + + // add x-protobuf-data-type + // ref: https://developers.google.com/protocol-buffers/docs/proto3 + if (!p.vendorExtensions.containsKey("x-protobuf-data-type")) { + if (Boolean.TRUE.equals(p.isListContainer)) { + p.vendorExtensions.put("x-protobuf-data-type", p.items.dataType); + } else { + p.vendorExtensions.put("x-protobuf-data-type", p.dataType); + } + } + + p.vendorExtensions.put("x-index", index); + index++; + } + + if (StringUtils.isEmpty(op.returnType)) { + op.vendorExtensions.put("x-grpc-response", "google.protobuf.Empty"); + } else { + if (Boolean.FALSE.equals(op.returnTypeIsPrimitive) && StringUtils.isEmpty(op.returnContainer)) { + op.vendorExtensions.put("x-grpc-response", op.returnType); + } else { + if ("map".equals(op.returnContainer)) { + LOGGER.warn("Map response (operation ID: {}) not yet supported", op.operationId); + op.vendorExtensions.put("x-grpc-response-type", op.returnBaseType); + } else if ("array".equals(op.returnContainer)) { + op.vendorExtensions.put("x-grpc-response-type", "repeated " + op.returnBaseType); + } else { // primitive type + op.vendorExtensions.put("x-grpc-response-type", op.returnBaseType); + } + } + } + } + + return objs; + } + + @Override + public String toModelImport(String name) { + return underscore(name); + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + return getSchemaType(p) + "[" + getTypeDeclaration(inner) + "]"; + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = ModelUtils.getAdditionalProperties(p); + return getSchemaType(p) + "[str, " + getTypeDeclaration(inner) + "]"; + } + return super.getTypeDeclaration(p); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index ffbad6f5d237..71dd5d61133e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -16,29 +16,69 @@ package org.openapitools.codegen.languages; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.examples.Example; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.examples.ExampleGenerator; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.io.File; import java.util.*; import java.util.regex.Pattern; +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; + public class PythonClientExperimentalCodegen extends PythonClientCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientExperimentalCodegen.class); public PythonClientExperimentalCodegen() { super(); - supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py")); - apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md"); + apiTemplateFiles.remove("api.mustache"); apiTemplateFiles.put("python-experimental/api.mustache", ".py"); + + apiDocTemplateFiles.remove("api_doc.mustache"); + apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md"); + + modelDocTemplateFiles.remove("model_doc.mustache"); modelDocTemplateFiles.put("python-experimental/model_doc.mustache", ".md"); + + modelTemplateFiles.remove("model.mustache"); modelTemplateFiles.put("python-experimental/model.mustache", ".py"); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.EXPERIMENTAL) + .build(); + } + + @Override + public void processOpts() { + super.processOpts(); + + supportingFiles.remove(new SupportingFile("api_client.mustache", packagePath(), "api_client.py")); + supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py")); + + supportingFiles.add(new SupportingFile("python-experimental/model_utils.mustache", packagePath(), "model_utils.py")); + + // default this to true so the python ModelSimple models will be generated + ModelUtils.setGenerateAliasAsModel(true); + LOGGER.info(CodegenConstants.GENERATE_ALIAS_AS_MODEL + " is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums"); } /** @@ -65,6 +105,7 @@ public String dateToString(Schema p, Date date, DateFormat dateFormatter, DateFo /** * Return the default value of the property + * * @param p OpenAPI property object * @return string presentation of the default value of the property */ @@ -151,8 +192,401 @@ public String toDefaultValue(Schema p) { } return defaultValue; } else { - return defaultObject.toString(); + return defaultObject.toString(); + } + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + // add regex information to property + postProcessPattern(property.pattern, property.vendorExtensions); + } + + // override with any special post-processing for all models + @SuppressWarnings({"static-method", "unchecked"}) + public Map postProcessAllModels(Map objs) { + // loop through all models and delete ones where type!=object and the model has no validations and enums + // we will remove them because they are not needed + Map modelSchemasToRemove = new HashMap(); + for (Map.Entry entry : objs.entrySet()) { + Map inner = (Map) entry.getValue(); + List> models = (List>) inner.get("models"); + for (Map mo : models) { + CodegenModel cm = (CodegenModel) mo.get("model"); + Schema modelSchema = ModelUtils.getSchema(this.openAPI, cm.name); + CodegenProperty modelProperty = fromProperty("value", modelSchema); + if (cm.isEnum || cm.isAlias) { + if (!modelProperty.isEnum && !modelProperty.hasValidation) { + // remove these models because they are aliases and do not have any enums or validations + modelSchemasToRemove.put(cm.name, modelSchema); + } + } else if (cm.isArrayModel && !modelProperty.isEnum && !modelProperty.hasValidation) { + // remove any ArrayModels which lack validation and enums + modelSchemasToRemove.put(cm.name, modelSchema); + } + } + } + + // Remove modelSchemasToRemove models from objs + for (String modelName : modelSchemasToRemove.keySet()) { + objs.remove(modelName); + } + return objs; + } + + /** + * Convert OAS Property object to Codegen Property object + * + * @param name name of the property + * @param p OAS property object + * @return Codegen Property object + */ + @Override + public CodegenProperty fromProperty(String name, Schema p) { + // we have a custom version of this function to always set allowableValues.enumVars on all enum variables + CodegenProperty result = super.fromProperty(name, p); + if (result.isEnum) { + updateCodegenPropertyEnum(result); + } + return result; + } + + /** + * Update codegen property's enum by adding "enumVars" (with name and value) + * + * @param var list of CodegenProperty + */ + @Override + public void updateCodegenPropertyEnum(CodegenProperty var) { + // we have a custom version of this method to omit overwriting the defaultValue + Map allowableValues = var.allowableValues; + + // handle array + if (var.mostInnerItems != null) { + allowableValues = var.mostInnerItems.allowableValues; + } + + if (allowableValues == null) { + return; + } + + List values = (List) allowableValues.get("values"); + if (values == null) { + return; + } + + String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; + Optional referencedSchema = ModelUtils.getSchemas(openAPI).entrySet().stream() + .filter(entry -> Objects.equals(varDataType, toModelName(entry.getKey()))) + .map(Map.Entry::getValue) + .findFirst(); + String dataType = (referencedSchema.isPresent()) ? getTypeDeclaration(referencedSchema.get()) : varDataType; + + // put "enumVars" map into `allowableValues", including `name` and `value` + List> enumVars = new ArrayList<>(); + String commonPrefix = findCommonPrefixOfVars(values); + int truncateIdx = commonPrefix.length(); + for (Object value : values) { + Map enumVar = new HashMap<>(); + String enumName; + if (truncateIdx == 0) { + enumName = value.toString(); + } else { + enumName = value.toString().substring(truncateIdx); + if ("".equals(enumName)) { + enumName = value.toString(); + } + } + + enumVar.put("name", toEnumVarName(enumName, dataType)); + enumVar.put("value", toEnumValue(value.toString(), dataType)); + enumVar.put("isString", isDataTypeString(dataType)); + enumVars.add(enumVar); + } + // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames + Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); + if (referencedSchema.isPresent()) { + extensions = referencedSchema.get().getExtensions(); + } + updateEnumVarsWithExtensions(enumVars, extensions); + allowableValues.put("enumVars", enumVars); + // overwriting defaultValue omitted from here + } + + @Override + public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { + CodegenParameter result = super.fromRequestBody(body, imports, bodyParameterName); + // if we generated a model with a non-object type because it has validations or enums, + // make sure that the datatype of that body parameter refers to our model class + Content content = body.getContent(); + Set keySet = content.keySet(); + Object[] keyArray = (Object[]) keySet.toArray(); + MediaType mediaType = content.get(keyArray[0]); + Schema schema = mediaType.getSchema(); + String ref = schema.get$ref(); + if (ref == null) { + return result; + } + String modelName = ModelUtils.getSimpleRef(ref); + // the result lacks validation info so we need to make a CodegenProperty from the schema to check + // if we have validation and enum info exists + Schema realSchema = ModelUtils.getSchema(this.openAPI, modelName); + CodegenProperty modelProp = fromProperty("body", realSchema); + if (modelProp.isPrimitiveType && (modelProp.hasValidation || modelProp.isEnum)) { + String simpleDataType = result.dataType; + result.isPrimitiveType = false; + result.isModel = true; + result.dataType = modelName; + imports.add(modelName); + // set the example value + if (modelProp.isEnum) { + String value = modelProp._enum.get(0).toString(); + result.example = modelName + "(" + toEnumValue(value, simpleDataType) + ")"; + } else { + result.example = modelName + "(" + result.example + ")"; + } + } + return result; + } + + /** + * Convert OAS Response object to Codegen Response object + * + * @param responseCode HTTP response code + * @param response OAS Response object + * @return Codegen Response object + */ + @Override + public CodegenResponse fromResponse(String responseCode, ApiResponse response) { + // if a response points at a model whose type != object and it has validations and/or enums, then we will + // generate the model, and the response.isModel must be changed to true and response.baseType must be the name + // of the model. Point responses at models if the model is python class type ModelSimple + // When we serialize/deserialize ModelSimple models, validations and enums will be checked. + Schema responseSchema; + if (this.openAPI != null && this.openAPI.getComponents() != null) { + responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(response)); + } else { // no model/alias defined + responseSchema = ModelUtils.getSchemaFromResponse(response); + } + + String newBaseType = null; + if (responseSchema != null) { + CodegenProperty cp = fromProperty("response", responseSchema); + if (cp.complexType != null) { + // check the referenced schema to see if it is an type=object model + Schema modelSchema = ModelUtils.getSchema(this.openAPI, cp.complexType); + if (modelSchema != null && !"object".equals(modelSchema.getType())) { + CodegenProperty modelProp = fromProperty("response", modelSchema); + if (modelProp.isEnum == true || modelProp.hasValidation == true) { + // this model has validations and/or enums so we will generate it + newBaseType = cp.complexType; + } + } + } else { + if (cp.isEnum == true || cp.hasValidation == true) { + // this model has validations and/or enums so we will generate it + Schema sc = ModelUtils.getSchemaFromResponse(response); + newBaseType = ModelUtils.getSimpleRef(sc.get$ref()); + } + } + } + + CodegenResponse result = super.fromResponse(responseCode, response); + if (newBaseType != null) { + result.isModel = true; + result.baseType = newBaseType; + result.dataType = newBaseType; + } + + return result; + } + + /** + * Set op's returnBaseType, returnType, examples etc. + * + * @param operation endpoint Operation + * @param schemas a map of the schemas in the openapi spec + * @param op endpoint CodegenOperation + * @param methodResponse the default ApiResponse for the endpoint + */ + @Override + public void handleMethodResponse(Operation operation, + Map schemas, + CodegenOperation op, + ApiResponse methodResponse) { + // we have a custom version of this method to handle endpoints that return models where + // type != object the model has validations and/or enums + // we do this by invoking our custom fromResponse method to create defaultResponse + // which we then use to set op.returnType and op.returnBaseType + CodegenResponse defaultResponse = fromResponse("defaultResponse", methodResponse); + Schema responseSchema = ModelUtils.unaliasSchema(this.openAPI, ModelUtils.getSchemaFromResponse(methodResponse)); + + if (responseSchema != null) { + op.returnBaseType = defaultResponse.baseType; + + // generate examples + String exampleStatusCode = "200"; + for (String key : operation.getResponses().keySet()) { + if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) { + exampleStatusCode = key; + } + } + op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation)); + op.defaultResponse = toDefaultValue(responseSchema); + op.returnType = defaultResponse.dataType; + op.hasReference = schemas.containsKey(op.returnBaseType); + + // lookup discriminator + Schema schema = schemas.get(op.returnBaseType); + if (schema != null) { + CodegenModel cmod = fromModel(op.returnBaseType, schema); + op.discriminator = cmod.discriminator; + } + + if (defaultResponse.isListContainer) { + op.isListContainer = true; + } else if (defaultResponse.isMapContainer) { + op.isMapContainer = true; + } else { + op.returnSimpleType = true; + } + if (languageSpecificPrimitives().contains(op.returnBaseType) || op.returnBaseType == null) { + op.returnTypeIsPrimitive = true; + } + } + addHeaders(methodResponse, op.responseHeaders); + } + + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized variable name for enum + */ + public String toEnumVarName(String value, String datatype) { + // our enum var names are keys in a python dict, so change spaces to underscores + if (value.length() == 0) { + return "EMPTY"; + } + + String var = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT); + return var; + } + + /** + * Return the enum value in the language specified format + * e.g. status becomes "status" + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized value for enum + */ + public String toEnumValue(String value, String datatype) { + if (datatype.equals("int") || datatype.equals("float")) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + + @Override + public void postProcessParameter(CodegenParameter parameter) { + postProcessPattern(parameter.pattern, parameter.vendorExtensions); + } + + /** + * Convert OAS Model object to Codegen Model object + * + * @param name the name of the model + * @param schema OAS Model object + * @return Codegen Model object + */ + @Override + public CodegenModel fromModel(String name, Schema schema) { + // we have a custom version of this function so we can produce + // models for components whose type != object and which have validations and enums + // this ensures that endpoint (operation) responses with validations and enums + // will generate models, and when those endpoint responses are received in python + // the response is cast as a model, and the model will validate the response using the enums and validations + Map propertyToModelName = new HashMap(); + Map propertiesMap = schema.getProperties(); + if (propertiesMap != null) { + for (Map.Entry entry : propertiesMap.entrySet()) { + String schemaPropertyName = entry.getKey(); + String pythonPropertyName = toVarName(schemaPropertyName); + Schema propertySchema = entry.getValue(); + String ref = propertySchema.get$ref(); + if (ref == null) { + continue; + } + Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, propertySchema); + String refType = refSchema.getType(); + if (refType == null || refType.equals("object")) { + continue; + } + CodegenProperty modelProperty = fromProperty("_fake_name", refSchema); + if (modelProperty.isEnum == false && modelProperty.hasValidation == false) { + continue; + } + String modelName = ModelUtils.getSimpleRef(ref); + propertyToModelName.put(pythonPropertyName, modelName); + } + } + CodegenModel result = super.fromModel(name, schema); + + // make non-object type models have one property so we can use it to store enums and validations + if (result.isAlias || result.isEnum) { + Schema modelSchema = ModelUtils.getSchema(this.openAPI, result.name); + CodegenProperty modelProperty = fromProperty("value", modelSchema); + if (modelProperty.isEnum == true || modelProperty.hasValidation == true) { + // these models are non-object models with enums and/or validations + // add a single property to the model so we can have a way to access validations + result.isAlias = true; + modelProperty.required = true; + List theProperties = Arrays.asList(modelProperty); + result.setAllVars(theProperties); + result.setVars(theProperties); + result.setRequiredVars(theProperties); + // post process model properties + if (result.vars != null) { + for (CodegenProperty prop : result.vars) { + postProcessModelProperty(result, prop); + } + } + + } + } + + // return all models which don't need their properties connected to non-object models + if (propertyToModelName.isEmpty()) { + return result; + } + + // fix all property references to non-object models, make those properties non-primitive and + // set their dataType and complexType to the model name, so documentation will refer to the correct model + ArrayList> listOfLists = new ArrayList>(); + listOfLists.add(result.vars); + listOfLists.add(result.allVars); + listOfLists.add(result.requiredVars); + listOfLists.add(result.optionalVars); + listOfLists.add(result.readOnlyVars); + listOfLists.add(result.readWriteVars); + for (List cpList : listOfLists) { + for (CodegenProperty cp : cpList) { + if (!propertyToModelName.containsKey(cp.name)) { + continue; + } + cp.isPrimitiveType = false; + String modelName = propertyToModelName.get(cp.name); + cp.complexType = modelName; + cp.dataType = modelName; + cp.isEnum = false; + cp.hasValidation = false; + } } + return result; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 8dde5473738d..9e227b3eee09 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -615,10 +615,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation } for (CodegenParameter param : op.headerParams) { - // If a header uses UUIDs, we need to import the UUID package. - if (param.dataType.equals(uuidType)) { - additionalProperties.put("apiUsesUuid", true); - } processParam(param, op); // Give header params a name in camel case. CodegenParameters don't have a nameInCamelCase property. @@ -754,10 +750,21 @@ public Map postProcessOperationsWithModels(Map o } if (op.authMethods != null) { + boolean headerAuthMethods = false; + for (CodegenSecurity s : op.authMethods) { if (s.isApiKey && s.isKeyInHeader) { s.vendorExtensions.put("x-apiKeyName", toModelName(s.keyParamName)); + headerAuthMethods = true; } + + if (s.isBasicBasic || s.isBasicBearer || s.isOAuth) { + headerAuthMethods = true; + } + } + + if (headerAuthMethods) { + op.vendorExtensions.put("hasHeaderAuthMethods", "true"); } } } @@ -902,6 +909,12 @@ public CodegenModel fromModel(String name, Schema model) { additionalProperties.put("usesXmlNamespaces", true); } + Schema additionalProperties = ModelUtils.getAdditionalProperties(model); + + if (additionalProperties != null) { + mdl.additionalPropertiesType = getSchemaType(additionalProperties); + } + return mdl; } @@ -925,7 +938,15 @@ public Map postProcessAllModels(Map objs) { String modelName = entry.getKey(); CodegenModel model = entry.getValue(); + if (uuidType.equals(model.dataType)) { + additionalProperties.put("apiUsesUuid", true); + } + for (CodegenProperty prop : model.vars) { + if (prop.dataType.equals(uuidType)) { + additionalProperties.put("apiUsesUuid", true); + } + String xmlName = modelXmlNames.get(prop.dataType); if (xmlName != null) { prop.vendorExtensions.put("itemXmlName", xmlName); @@ -1108,20 +1129,34 @@ public Map postProcessModels(Map objs) { // 'null'. This ensures that we treat this model as a struct // with multiple parameters. cm.dataType = null; - } else if (cm.dataType != null) { - if (cm.dataType.equals("map")) { - // We don't yet support `additionalProperties`. We ignore - // the `additionalProperties` type ('map') and warn the - // user. This will produce code that compiles, but won't - // feature the `additionalProperties`. + } else if (cm.dataType != null && cm.dataType.equals("map")) { + if (!cm.allVars.isEmpty() || cm.additionalPropertiesType == null) { + // We don't yet support `additionalProperties` that also have + // properties. If we see variables, we ignore the + // `additionalProperties` type ('map') and warn the user. This + // will produce code that compiles, but won't feature the + // `additionalProperties` - but that's likely more useful to + // the user than the alternative. + LOGGER.warn("Ignoring additionalProperties (see https://github.com/OpenAPITools/openapi-generator/issues/318) alongside defined properties"); cm.dataType = null; - LOGGER.warn("Ignoring unsupported additionalProperties (see https://github.com/OpenAPITools/openapi-generator/issues/318)"); - } else { - // We need to hack about with single-parameter models to - // get them recognised correctly. - cm.isAlias = false; - cm.dataType = typeMapping.get(cm.dataType); } + else + { + String type; + + if (typeMapping.containsKey(cm.additionalPropertiesType)) { + type = typeMapping.get(cm.additionalPropertiesType); + } else { + type = toModelName(cm.additionalPropertiesType); + } + + cm.dataType = "HashMap"; + } + } else if (cm.dataType != null) { + // We need to hack about with single-parameter models to + // get them recognised correctly. + cm.isAlias = false; + cm.dataType = typeMapping.get(cm.dataType); } cm.vendorExtensions.put("isString", "String".equals(cm.dataType)); @@ -1132,6 +1167,11 @@ public Map postProcessModels(Map objs) { private void processParam(CodegenParameter param, CodegenOperation op) { String example = null; + // If a parameter uses UUIDs, we need to import the UUID package. + if (param.dataType.equals(uuidType)) { + additionalProperties.put("apiUsesUuid", true); + } + if (param.isString) { param.vendorExtensions.put("formatString", "\\\"{}\\\""); example = "\"" + ((param.example != null) ? param.example : "") + "\".to_string()"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index 1422504281fd..759ce8fa1cef 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -101,7 +101,8 @@ public Swift4Codegen() { "UUID", "URL", "AnyObject", - "Any") + "Any", + "Decimal") ); defaultIncludes = new HashSet<>( Arrays.asList( @@ -115,7 +116,8 @@ public Swift4Codegen() { "Any", "Empty", "AnyObject", - "Any") + "Any", + "Decimal") ); objcReservedWords = new HashSet<>( @@ -198,6 +200,7 @@ public Swift4Codegen() { typeMapping.put("ByteArray", "Data"); typeMapping.put("UUID", "UUID"); typeMapping.put("URI", "String"); + typeMapping.put("BigDecimal", "Decimal"); importMapping = new HashMap<>(); 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 87850355e905..170bb948e3d9 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 @@ -67,6 +67,8 @@ public TypeScriptAngularClientCodegen() { super(); this.outputFolder = "generated-code/typescript-angular"; + supportsMultipleInheritance = true; + embeddedTemplateDir = templateDir = "typescript-angular"; modelTemplateFiles.put("model.mustache", ".ts"); apiTemplateFiles.put("api.service.mustache", ".ts"); @@ -209,8 +211,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // Set the typescript version compatible to the Angular version - if (ngVersion.atLeast("7.0.0")) { - // Angular v7 requires typescript ">=3.1.1 <3.2.0" + if (ngVersion.atLeast("8.0.0")) { + additionalProperties.put("tsVersion", ">=3.4.0 <3.6.0"); + } else if (ngVersion.atLeast("7.0.0")) { additionalProperties.put("tsVersion", ">=3.1.1 <3.2.0"); } else if (ngVersion.atLeast("6.0.0")) { additionalProperties.put("tsVersion", ">=2.7.2 and <2.10.0"); @@ -222,7 +225,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // Set the rxJS version compatible to the Angular version - if (ngVersion.atLeast("7.0.0")) { + if (ngVersion.atLeast("8.0.0")) { + additionalProperties.put("rxjsVersion", "6.5.0"); + } else if (ngVersion.atLeast("7.0.0")) { additionalProperties.put("rxjsVersion", "6.3.0"); } else if (ngVersion.atLeast("6.0.0")) { additionalProperties.put("rxjsVersion", "6.1.0"); @@ -250,7 +255,10 @@ private void addNpmPackageGeneration(SemVer ngVersion) { additionalProperties.put("useOldNgPackagr", !ngVersion.atLeast("5.0.0")); // Specific ng-packagr configuration - if (ngVersion.atLeast("7.0.0")) { + if (ngVersion.atLeast("8.0.0")) { + additionalProperties.put("ngPackagrVersion", "5.4.0"); + additionalProperties.put("tsickleVersion", "0.35.0"); + } else if (ngVersion.atLeast("7.0.0")) { // compatible versions with typescript version additionalProperties.put("ngPackagrVersion", "5.1.0"); additionalProperties.put("tsickleVersion", "0.34.0"); @@ -268,7 +276,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // set zone.js version - if (ngVersion.atLeast("5.0.0")) { + if (ngVersion.atLeast("8.0.0")) { + additionalProperties.put("zonejsVersion", "0.9.1"); + } else if (ngVersion.atLeast("5.0.0")) { // compatible versions to Angular 5+ additionalProperties.put("zonejsVersion", "0.8.26"); } else { @@ -659,3 +669,4 @@ private String convertUsingFileNamingConvention(String originalName) { } } + 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 41986aa24fc1..3e27363508b2 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 @@ -33,11 +33,15 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege 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 PREFIX_PARAMETER_INTERFACES = "prefixParameterInterfaces"; + public static final String TYPESCRIPT_THREE_PLUS = "typescriptThreePlus"; protected String npmRepository = null; private boolean useSingleRequestParameter = true; + private boolean prefixParameterInterfaces = false; protected boolean addedApiIndex = false; protected boolean addedModelIndex = false; + protected boolean typescriptThreePlus = false; public TypeScriptFetchClientCodegen() { @@ -59,6 +63,8 @@ public TypeScriptFetchClientCodegen() { this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(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.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.TRUE.toString())); + this.cliOptions.add(new CliOption(PREFIX_PARAMETER_INTERFACES, "Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + this.cliOptions.add(new CliOption(TYPESCRIPT_THREE_PLUS, "Setting this property to true will generate TypeScript 3.6+ compatible code.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); } @Override @@ -79,6 +85,14 @@ public void setNpmRepository(String npmRepository) { this.npmRepository = npmRepository; } + public Boolean getTypescriptThreePlus() { + return typescriptThreePlus; + } + + public void setTypescriptThreePlus(Boolean typescriptThreePlus) { + this.typescriptThreePlus = typescriptThreePlus; + } + @Override public void processOpts() { super.processOpts(); @@ -94,9 +108,18 @@ public void processOpts() { } writePropertyBack(USE_SINGLE_REQUEST_PARAMETER, getUseSingleRequestParameter()); + if (additionalProperties.containsKey(PREFIX_PARAMETER_INTERFACES)) { + this.setPrefixParameterInterfaces(convertPropertyToBoolean(PREFIX_PARAMETER_INTERFACES)); + } + writePropertyBack(PREFIX_PARAMETER_INTERFACES, getPrefixParameterInterfaces()); + if (additionalProperties.containsKey(NPM_NAME)) { addNpmPackageGeneration(); } + + if (additionalProperties.containsKey(TYPESCRIPT_THREE_PLUS)) { + this.setTypescriptThreePlus(convertPropertyToBoolean(TYPESCRIPT_THREE_PLUS)); + } } @Override @@ -208,6 +231,7 @@ public Map postProcessOperationsWithModels(Map o this.addOperationModelImportInfomation(operations); this.updateOperationParameterEnumInformation(operations); this.addOperationObjectResponseInformation(operations); + this.addOperationPrefixParameterInterfacesInformation(operations); return operations; } @@ -254,6 +278,11 @@ private void addOperationObjectResponseInformation(Map operation } } + private void addOperationPrefixParameterInterfacesInformation(Map operations) { + Map _operations = (Map) operations.get("operations"); + operations.put("prefixParameterInterfaces", getPrefixParameterInterfaces()); + } + private void addExtraReservedWords() { this.reservedWords.add("BASE_PATH"); this.reservedWords.add("BaseAPI"); @@ -289,4 +318,12 @@ private boolean getUseSingleRequestParameter() { private void setUseSingleRequestParameter(boolean useSingleRequestParameter) { this.useSingleRequestParameter = useSingleRequestParameter; } + + private boolean getPrefixParameterInterfaces() { + return prefixParameterInterfaces; + } + + private void setPrefixParameterInterfaces(boolean prefixParameterInterfaces) { + this.prefixParameterInterfaces = prefixParameterInterfaces; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java index 3f1384d15dd3..e2837499f403 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/serializer/SerializerUtils.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.module.SimpleModule; import io.swagger.v3.core.util.Yaml; +import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -15,9 +16,7 @@ public static String toYamlString(OpenAPI openAPI) { if(openAPI == null) { return null; } - - SimpleModule module = new SimpleModule("OpenAPIModule"); - module.addSerializer(OpenAPI.class, new OpenAPISerializer()); + SimpleModule module = createModule(); try { return Yaml.mapper() .registerModule(module) @@ -29,4 +28,30 @@ public static String toYamlString(OpenAPI openAPI) { } return null; } + + public static String toJsonString(OpenAPI openAPI) { + if (openAPI == null) { + return null; + } + + SimpleModule module = createModule(); + try { + return Json.mapper() + .copy() + .registerModule(module) + .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true) + .writerWithDefaultPrettyPrinter() + .writeValueAsString(openAPI) + .replace("\r\n", "\n"); + } catch (JsonProcessingException e) { + LOGGER.warn("Can not create json content", e); + } + return null; + } + + private static SimpleModule createModule() { + SimpleModule module = new SimpleModule("OpenAPIModule"); + module.addSerializer(OpenAPI.class, new OpenAPISerializer()); + return module; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index ad991f679545..d9cc61cbc034 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -359,14 +359,7 @@ public static boolean isMapSchema(Schema schema) { } public static boolean isArraySchema(Schema schema) { - if (schema instanceof ArraySchema) { - return true; - } - // assume it's an array if maxItems, minItems is set - if (schema != null && (schema.getMaxItems() != null || schema.getMinItems() != null)) { - return true; - } - return false; + return (schema instanceof ArraySchema); } public static boolean isStringSchema(Schema schema) { @@ -896,6 +889,8 @@ public static List getInterfaces(ComposedSchema composed) { public static String getParentName(ComposedSchema composedSchema, Map allSchemas) { List interfaces = getInterfaces(composedSchema); + List refedParentNames = new ArrayList<>(); + if (interfaces != null && !interfaces.isEmpty()) { for (Schema schema : interfaces) { // get the actual schema @@ -911,6 +906,7 @@ public static String getParentName(ComposedSchema composedSchema, Map&1 | grep -v 'To https' diff --git a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache new file mode 100644 index 000000000000..ac01b293cc12 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache @@ -0,0 +1,19 @@ +{{! + If this is map and items are nullable, make sure that nulls are included. + To determine what JsonInclude.Include method to use, consider the following: + * If the field is required, always include it, even if it is null. + * Else use custom behaviour, IOW use whatever is defined on the object mapper + }} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + @JsonInclude({{#isMapContainer}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMapContainer}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) + {{#withXml}} + {{^isContainer}} + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isContainer}} + {{#isContainer}} + {{#isXmlWrapped}} + // items.xmlName={{items.xmlName}} + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") + {{/isXmlWrapped}} + {{/isContainer}} + {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index 6d43061d347b..9df586c08cb2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -12,6 +12,7 @@ import org.threeten.bp.*; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} @@ -177,6 +178,8 @@ public class ApiClient { module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); objectMapper.registerModule(module); {{/threetenbp}} + JsonNullableModule jnm = new JsonNullableModule(); + objectMapper.registerModule(jnm); return objectMapper; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/EncodingUtils.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/EncodingUtils.mustache index 6bf2a0e4bfbb..705eb6aa9d39 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/EncodingUtils.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/EncodingUtils.mustache @@ -77,7 +77,7 @@ public final class EncodingUtils { return null; } try { - return URLEncoder.encode(parameter.toString(), "UTF-8"); + return URLEncoder.encode(parameter.toString(), "UTF-8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { // Should never happen, UTF-8 is always supported throw new RuntimeException(e); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 982faaa4628c..a92022e83aec 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -120,8 +120,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" {{#threetenbp}} threepane_version = "2.6.4" {{/threetenbp}} @@ -141,6 +142,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" {{#joda}} compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index 946b31956110..040912220229 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -14,9 +14,9 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-jackson" % "{{#useFeign10}}10.2.3{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", "io.github.openfeign" % "feign-slf4j" % "{{#useFeign10}}10.2.3{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.9.9" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index d2634ca5df47..ef60c22df43f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -244,6 +244,11 @@ jackson-databind ${jackson-databind-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#withXml}} @@ -309,8 +314,9 @@ 1.5.21 {{#useFeign10}}10.2.3{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}} 2.1.0 - 2.9.9 - 2.9.9 + 2.9.10 + 0.2.0 + 2.9.10 {{#threetenbp}} 2.6.4 {{/threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache index fa6e7a601fe2..9df560415d01 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/ApiClient.mustache @@ -4,6 +4,7 @@ import {{apiPackage}}.*; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} @@ -53,6 +54,8 @@ public class ApiClient { module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); objectMapper.registerModule(module); {{/threetenbp}} + JsonNullableModule jnm = new JsonNullableModule(); + objectMapper.registerModule(jnm); return objectMapper; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache index 6a9c10c02ea1..7c5669aa2a2f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache @@ -6,6 +6,7 @@ import {{invokerPackage}}.ApiClient; {{/imports}} import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -104,10 +105,10 @@ public class {{classname}} { } }{{/queryParams}}{{/hasQueryParams}} - String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} + GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); }{{#bodyParam}} @@ -135,8 +136,8 @@ public class {{classname}} { } }{{/queryParams}}{{/hasQueryParams}} - String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = {{#bodyParam}}{{paramName}} == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -176,10 +177,10 @@ public class {{classname}} { } } - String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} + GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); } 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 84ae616aad63..4471072ec2f1 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 @@ -120,8 +120,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" google_api_client_version = "1.23.0" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" @@ -140,6 +141,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" {{#java8}} compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/java8}} 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 48f28b25d1b8..3dea3928279c 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 @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.9" % "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 0269a88c3bcc..8bafe1ea9a48 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 @@ -253,6 +253,11 @@ jackson-databind ${jackson-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#withXml}} @@ -299,10 +304,11 @@ UTF-8 1.5.22 - 1.23.0 + 1.30.2 2.25.1 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 {{#joda}} 2.9.9 {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 1007a857ca05..4d2c3e21b617 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -704,7 +704,7 @@ public class ApiClient { } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -716,11 +716,15 @@ public class ApiClient { } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); } else { throw new ApiException(500, "unknown method type " + method); } @@ -772,6 +776,8 @@ public class ApiClient { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { {{^supportJava6}} clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); @@ -782,6 +788,9 @@ public class ApiClient { {{#supportJava6}} clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); {{/supportJava6}} + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache index 911391a6baf1..56ea77278f71 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -5,6 +5,7 @@ import org.threeten.bp.*; {{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; {{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{/java8}} @@ -45,6 +46,8 @@ public class JSON implements ContextResolver { module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper.registerModule(module); {{/threetenbp}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); } /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index 19c079e3229b..89131a0f9433 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -107,7 +107,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { 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 3f192edafd8f..588239f5c88f 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 @@ -119,8 +119,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" {{#supportJava6}} jersey_version = "2.6" commons_io_version=2.5 @@ -144,6 +145,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" {{#joda}} compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} 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 d5d69065495c..ef2e32af36ee 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 @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, "org.glassfish.jersey.media" % "jersey-media-multipart" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, "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.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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", {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.9" % "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 27a94b563114..621228c2a7a4 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 @@ -276,6 +276,11 @@ jackson-databind ${jackson-databind-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#withXml}} @@ -355,8 +360,9 @@ 2.5 3.6 {{/supportJava6}} - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 {{#threetenbp}} 2.6.4 {{/threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index eee8f2923d90..6bcad4a2f3fb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import java.net.URI; import java.net.URLEncoder; @@ -151,6 +152,8 @@ public class ApiClient { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.registerModule(new JavaTimeModule()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); URI baseURI = URI.create("{{{basePath}}}"); scheme = baseURI.getScheme(); host = baseURI.getHost(); @@ -249,6 +252,17 @@ public class ApiClient { return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + /** * Set a custom request interceptor. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/generatedAnnotation.mustache new file mode 100644 index 000000000000..dc1f2cd40e96 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/generatedAnnotation.mustache @@ -0,0 +1 @@ +{{^hideGenerationTimestamp}}@javax.annotation.processing.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index ad7c4234c1c0..e3fe7f74118f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -188,6 +188,11 @@ jackson-datatype-jsr310 ${jackson-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + @@ -210,6 +215,7 @@ 11 11 2.9.9 + 0.2.0 4.12 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 32b1e3fcf040..26015967b404 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -90,7 +90,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables String localVarPath = "{{{path}}}"{{#pathParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache index 19ab0fa98c31..1a691ea94821 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache @@ -13,7 +13,8 @@ import java.util.function.Supplier; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; -import static {{invokerPackage}}.GsonObjectMapper.gson; +import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; + {{/fullJavaUtil}} public class ApiClient { @@ -42,7 +43,7 @@ public class ApiClient { public static class Config { private Supplier reqSpecSupplier = () -> new RequestSpecBuilder() {{#basePath}}.setBaseUri(BASE_URI){{/basePath}} - .setConfig(config().objectMapperConfig(objectMapperConfig().defaultObjectMapper(gson()))); + .setConfig(config().objectMapperConfig(objectMapperConfig().defaultObjectMapper({{#gson}}gson(){{/gson}}{{#jackson}}jackson(){{/jackson}}))); /** * Use common specification for all operations diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache new file mode 100644 index 000000000000..9d87ce9ef46a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/JacksonObjectMapper.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +{{#threetenbp}} +import org.threeten.bp.*; +{{/threetenbp}} +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; +{{#java8}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{/java8}} +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} +{{#threetenbp}} +import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +{{/threetenbp}} + +import io.restassured.internal.mapping.Jackson2Mapper; +import io.restassured.path.json.mapper.factory.Jackson2ObjectMapperFactory; + + +public class JacksonObjectMapper extends Jackson2Mapper { + + private JacksonObjectMapper() { + super(createFactory()); + } + + private static Jackson2ObjectMapperFactory createFactory() { + return (cls, charset) -> { + ObjectMapper mapper = new ObjectMapper(); + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.setDateFormat(new RFC3339DateFormat()); + {{#java8}} + mapper.registerModule(new JavaTimeModule()); + {{/java8}} + {{#joda}} + mapper.registerModule(new JodaModule()); + {{/joda}} + {{#threetenbp}} + ThreeTenModule module = new ThreeTenModule(); + module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); + module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); + module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); + mapper.registerModule(module); + {{/threetenbp}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + }; + } + + public static JacksonObjectMapper jackson() { + return new JacksonObjectMapper(); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index 75ea07db60a2..db803e8f2e13 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -2,7 +2,9 @@ package {{package}}; +{{#gson}} import com.google.gson.reflect.TypeToken; +{{/gson}} {{#imports}}import {{import}}; {{/imports}} @@ -15,6 +17,9 @@ import java.util.Map; import io.restassured.RestAssured; import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.ResponseSpecBuilder; +{{#jackson}} +import io.restassured.common.mapper.TypeRef; +{{/jackson}} import io.restassured.http.Method; import io.restassured.response.Response; import io.swagger.annotations.*; @@ -24,8 +29,9 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; {{/fullJavaUtil}} +{{#gson}} import {{invokerPackage}}.JSON; - +{{/gson}} import static io.restassured.http.Method.*; @Api(value = "{{{baseName}}}") @@ -139,8 +145,9 @@ public class {{classname}} { * @return {{returnType}} */ public {{{returnType}}} executeAs(Function handler) { - Type type = new TypeToken<{{{returnType}}}>(){}.getType(); - return execute(handler).as(type); + {{#gson}}Type type = new TypeToken<{{{returnType}}}>(){}.getType(); + {{/gson}}{{#jackson}}TypeRef<{{{returnType}}}> type = new TypeRef<{{{returnType}}}>(){}; + {{/jackson}}return execute(handler).as(type); } {{/returnType}} {{#bodyParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache index 5c17db415e3a..74a1c9f7e8c1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache @@ -20,7 +20,7 @@ import java.util.Map; {{/fullJavaUtil}} import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; -import static {{invokerPackage}}.GsonObjectMapper.gson; +import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; /** * API tests for {{classname}} @@ -33,7 +33,8 @@ public class {{classname}}Test { @Before public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( - () -> new RequestSpecBuilder().setConfig(config().objectMapperConfig(objectMapperConfig().defaultObjectMapper(gson()))) + () -> new RequestSpecBuilder() + .setConfig(config().objectMapperConfig(objectMapperConfig().defaultObjectMapper({{#gson}}gson(){{/gson}}{{#jackson}}jackson(){{/jackson}}))) .addFilter(new ErrorLoggingFilter()) .setBaseUri("{{{basePath}}}"))).{{classVarName}}(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index b2d8683d3a41..d67815a76aad 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -98,8 +98,15 @@ ext { swagger_annotations_version = "1.5.21" rest_assured_version = "4.0.0" junit_version = "4.12" +{{#jackson}} + jackson_version = "{{^threetenbp}}2.9.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" + jackson_databind_version = "{{^threetenbp}}2.9.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" + jackson-databind-nullable-version = 0.2.0 +{{/jackson}} +{{#gson}} gson_version = "2.8.5" gson_fire_version = "1.8.3" +{{/gson}} {{#joda}} jodatime_version = "2.9.9" {{/joda}} @@ -113,10 +120,19 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.google.code.findbugs:jsr305:3.0.2" compile "io.rest-assured:scala-support:$rest_assured_version" +{{#jackson}} + 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_databind_version" + compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" +{{/jackson}} +{{#gson}} compile "io.gsonfire:gson-fire:$gson_fire_version" + compile 'com.google.code.gson:gson:$gson_version' +{{/gson}} {{#joda}} compile "joda-time:joda-time:$jodatime_version" - compile 'com.google.code.gson:gson:$gson_version' {{/joda}} {{#threetenbp}} compile "org.threeten:threetenbp:$threetenbp_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index d8d817271cb5..5f62ab214819 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -11,8 +11,15 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.21", "io.rest-assured" % "scala-support" % "4.0.0", +{{#jackson}} + "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "compile", +{{/jackson}} +{{#gson}} "com.google.code.gson" % "gson" % "2.8.5", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", +{{/gson}} {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index f8a8b5a1c885..383403811b8d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -217,11 +217,13 @@ rest-assured ${rest-assured.version} + {{#gson}} com.google.code.gson gson ${gson-version} + {{/gson}} {{#joda}} joda-time @@ -236,16 +238,69 @@ ${threetenbp-version} {{/threetenbp}} + {{#gson}} io.gsonfire gson-fire ${gson-fire-version} - - com.squareup.okio - okio - ${okio-version} - + {{/gson}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{#withXml}} + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + {{/withXml}} + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + {{/joda}} + {{#java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{/java8}} + {{#threetenbp}} + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + {{/threetenbp}} + {{/jackson}} + + com.squareup.okio + okio + ${okio-version} + junit @@ -267,6 +322,14 @@ {{#threetenbp}} 1.3.8 {{/threetenbp}} + {{#jackson}} + 2.9.9 + 2.9.9 + 0.2.0 + {{#threetenbp}} + 2.6.4 + {{/threetenbp}} + {{/jackson}} 1.13.0 4.12 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 457abc0e1d83..ca672da4998a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -41,6 +41,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory; import {{invokerPackage}}.auth.Authentication; import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; import {{invokerPackage}}.auth.ApiKeyAuth; {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; @@ -78,8 +79,9 @@ public class ApiClient { setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap();{{#authMethods}}{{#isBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -661,11 +663,15 @@ public class ApiClient { } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { - response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity); + response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); } else { throw new ApiException(500, "unknown method type " + method); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache index 6f5829fa5093..22888421d822 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/JSON.mustache @@ -2,6 +2,7 @@ package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; {{#java8}} import com.fasterxml.jackson.datatype.jsr310.*; {{/java8}} @@ -26,6 +27,8 @@ public class JSON implements ContextResolver { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); {{#java8}} mapper.registerModule(new JavaTimeModule()); {{/java8}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache index f6806af6b5fd..e13ddbc9e161 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache @@ -57,7 +57,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { 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 4232b110be44..1c133a743537 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 @@ -119,8 +119,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" threetenbp_version = "2.6.4" resteasy_version = "3.1.3.Final" {{^java8}} @@ -143,6 +144,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" {{#java8}} compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/java8}} 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 4f67eb388233..0af339a0da6b 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 @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.9" % "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 7d6927871f1a..4318c37628a4 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 @@ -212,6 +212,11 @@ jackson-databind ${jackson-databind-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#withXml}} @@ -289,8 +294,9 @@ UTF-8 1.5.22 3.1.3.Final - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 2.6.4 {{^java8}} 2.9.9 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 52e5f96e994b..430783443435 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 @@ -39,6 +39,7 @@ import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; {{/threetenbp}} import java.io.BufferedReader; @@ -661,6 +662,7 @@ public class ApiClient { messageConverters.add(new MappingJackson2HttpMessageConverter()); XmlMapper xmlMapper = new XmlMapper(); xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); + xmlMapper.registerModule(new JsonNullableModule()); messageConverters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); RestTemplate restTemplate = new RestTemplate(messageConverters); @@ -674,6 +676,7 @@ public class ApiClient { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper.registerModule(module); + mapper.registerModule(new JsonNullableModule()); } } {{/threetenbp}} 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 a3a9716286a8..1815ab926e11 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 @@ -120,8 +120,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" junit_version = "4.12" @@ -138,6 +139,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" {{#java8}} compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/java8}} 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 77d021644d63..c48a68e347aa 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 @@ -255,6 +255,11 @@ jackson-jaxrs-json-provider ${jackson-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#withXml}} @@ -306,6 +311,7 @@ 4.3.9.RELEASE 2.9.9 2.9.9 + 0.2.0 {{#joda}} 2.9.9 {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache index a549ea59d1c2..33331adb026f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache index 8c91c335dfce..dbfa4ae767bb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { 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 41ba48113409..cf02f243950a 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 @@ -127,12 +127,13 @@ ext { play_version = "2.4.11" {{/play24}} {{#play25}} - jackson_version = "2.9.9" + jackson_version = "2.9.10" play_version = "2.5.14" {{/play25}} {{#play26}} - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" play_version = "2.6.7" {{/play26}} {{/usePlayWS}} @@ -189,6 +190,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}:$jackson_version" {{/usePlayWS}} 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 21b00d3b91e4..78f7e5786af5 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 @@ -23,16 +23,16 @@ lazy val root = (project in file(".")). {{/play24}} {{#play25}} "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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", {{/play25}} {{#play26}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "javax.validation" % "validation-api" % "1.1.0.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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", {{/play26}} "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", {{/usePlayWS}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache index e03dc69971be..2395426ab2c3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache @@ -8,6 +8,8 @@ import java.util.*; import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import play.libs.Json; import play.libs.ws.WSClient; @@ -68,10 +70,14 @@ public class ApiClient { auth.applyToParams(extraQueryParams, extraHeaders); } + ObjectMapper mapper = Json.mapper(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return new Retrofit.Builder() .baseUrl(basePath) .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(JacksonConverterFactory.create(Json.mapper())) + .addConverterFactory(JacksonConverterFactory.create(mapper)) .callFactory(new Play24CallFactory(wsClient, extraHeaders, extraQueryParams)) .addCallAdapterFactory(new Play24CallAdapterFactory()) .build() diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache index 7d3dbd1e28ca..221d52c4e9b7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache @@ -8,6 +8,8 @@ import java.util.*; import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import play.libs.Json; import play.libs.ws.WSClient; @@ -67,10 +69,14 @@ public class ApiClient { auth.applyToParams(extraQueryParams, extraHeaders); } + ObjectMapper mapper = Json.mapper(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return new Retrofit.Builder() .baseUrl(basePath) .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(JacksonConverterFactory.create(Json.mapper())) + .addConverterFactory(JacksonConverterFactory.create(mapper)) .callFactory(new Play25CallFactory(wsClient, extraHeaders, extraQueryParams)) .addCallAdapterFactory(new Play25CallAdapterFactory()) .build() diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache index d59912773c85..166fb0880196 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/ApiClient.mustache @@ -13,6 +13,7 @@ import retrofit2.Converter; import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; +import org.openapitools.jackson.nullable.JsonNullableModule; import play.libs.Json; import play.libs.ws.WSClient; @@ -89,6 +90,8 @@ public class ApiClient { } if (defaultMapper == null) { defaultMapper = Json.mapper(); + JsonNullableModule jnm = new JsonNullableModule(); + defaultMapper.registerModule(jnm); } return new Retrofit.Builder() 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 aef50309c1cc..8bca88942d34 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 @@ -314,6 +314,11 @@ play-java-ws_2.11 ${play-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{/play24}} {{#play25}} @@ -321,6 +326,11 @@ play-java-ws_2.11 ${play-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{/play25}} {{#play26}} @@ -333,6 +343,11 @@ validation-api 1.1.0.Final + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{/play26}} {{/usePlayWS}} {{#parcelableModel}} @@ -360,19 +375,20 @@ 1.8.3 1.5.22 {{#usePlayWS}} - 2.9.9 + 2.9.10 {{#play24}} 2.6.6 2.4.11 {{/play24}} {{#play25}} - 2.9.9 + 2.9.10 2.5.15 {{/play25}} {{#play26}} - 2.9.9 + 2.9.10 2.6.7 {{/play26}} + 0.2.0 {{/usePlayWS}} 2.5.0 {{#useRxJava}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 170c92666ed6..571a3e4e63fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -14,6 +14,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import io.vertx.core.*; import io.vertx.core.buffer.Buffer; import io.vertx.core.file.AsyncFile; @@ -77,6 +78,8 @@ public class ApiClient { this.objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); this.objectMapper.registerModule(new JavaTimeModule()); this.objectMapper.setDateFormat(dateFormat); + JsonNullableModule jnm = new JsonNullableModule(); + this.objectMapper.registerModule(jnm); // Setup authentications (key: authentication name, value: authentication). this.authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} @@ -441,7 +444,7 @@ public class ApiClient { updateParamsForAuth(authNames, queryParams, headerParams); - if (accepts != null) { + if (accepts != null && accepts.length > 0) { headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts)); } @@ -576,7 +579,7 @@ public class ApiClient { return; } else { try { - resultContent = Json.mapper.readValue(httpResponse.bodyAsString(), returnType); + resultContent = this.objectMapper.readValue(httpResponse.bodyAsString(), returnType); result = Future.succeededFuture(resultContent); } catch (Exception e) { result = ApiException.fail(new DecodeException("Failed to decode:" + e.getMessage(), e)); 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 cf71f2376988..20aa961eaafb 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 @@ -28,8 +28,8 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "{{^threetenbp}}2.9.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" - jackson_databind_version = "{{^threetenbp}}2.9.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" + jackson_version = "{{^threetenbp}}2.9.10{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" + jackson_databind_version = "{{^threetenbp}}2.9.10{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" 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 db6ef66924b1..17d2c1261a95 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 @@ -243,6 +243,11 @@ jackson-databind ${jackson-databind} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#joda}} com.fasterxml.jackson.datatype @@ -284,8 +289,9 @@ UTF-8 3.4.2 1.5.22 - {{^threetenbp}}2.9.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} - {{^threetenbp}}2.9.9{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} + {{^threetenbp}}2.9.10{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} + {{^threetenbp}}2.9.10{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} + 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 943acff9c372..2e08f6da5f21 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 @@ -3,6 +3,7 @@ package {{invokerPackage}}; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.core.ParameterizedTypeReference; @@ -96,6 +97,8 @@ public class ApiClient { mapper.setDateFormat(dateFormat); mapper.registerModule(new JavaTimeModule()); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); this.webClient = buildWebClient(mapper); this.init(); 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 44098edb0f34..c8651f58c58d 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 @@ -105,6 +105,11 @@ jackson-databind ${jackson-databind-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + {{#java8}} @@ -138,8 +143,9 @@ UTF-8 1.5.22 5.0.7.RELEASE - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 4.12 3.1.8.RELEASE 0.7.8.RELEASE diff --git a/modules/openapi-generator/src/main/resources/Java/model.mustache b/modules/openapi-generator/src/main/resources/Java/model.mustache index 08429bb58dea..2194bbfdb39c 100644 --- a/modules/openapi-generator/src/main/resources/Java/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model.mustache @@ -20,6 +20,7 @@ import {{import}}; import java.io.Serializable; {{/serializableModel}} {{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache index 614e260c97fc..101870341f5d 100644 --- a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache @@ -56,7 +56,7 @@ @Override public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 240190fa11b7..309a42baced9 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -2,6 +2,13 @@ * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} */{{#description}} @ApiModel(description = "{{{description}}}"){{/description}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{/jackson}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcelableModel}}implements Parcelable {{#serializableModel}}, Serializable {{/serializableModel}}{{/parcelableModel}}{{^parcelableModel}}{{#serializableModel}}implements Serializable {{/serializableModel}}{{/parcelableModel}}{ {{#serializableModel}} @@ -19,21 +26,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} - {{#jackson}} - public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} - {{/jackson}} {{#withXml}} {{#isXmlAttribute}} @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") @@ -59,7 +51,25 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#vendorExtensions.isJacksonOptionalNullable}} + {{#isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.isJacksonOptionalNullable}} + {{^vendorExtensions.isJacksonOptionalNullable}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{/isContainer}} + {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.isJacksonOptionalNullable}} {{/vars}} {{#parcelableModel}} @@ -84,14 +94,28 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/gson}} {{/parcelableModel}} {{#vars}} + {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { - this.{{name}} = {{name}}; + {{#vendorExtensions.isJacksonOptionalNullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.isJacksonOptionalNullable}} + {{^vendorExtensions.isJacksonOptionalNullable}}this.{{name}} = {{name}};{{/vendorExtensions.isJacksonOptionalNullable}} return this; } {{#isListContainer}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.isJacksonOptionalNullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.isJacksonOptionalNullable}} + {{^vendorExtensions.isJacksonOptionalNullable}} {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -99,11 +123,24 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/required}} this.{{name}}.add({{name}}Item); return this; + {{/vendorExtensions.isJacksonOptionalNullable}} } {{/isListContainer}} {{#isMapContainer}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.isJacksonOptionalNullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.isJacksonOptionalNullable}} + {{^vendorExtensions.isJacksonOptionalNullable}} {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -111,6 +148,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/required}} this.{{name}}.put(key, {{name}}Item); return this; + {{/vendorExtensions.isJacksonOptionalNullable}} } {{/isMapContainer}} @@ -142,13 +180,43 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{#vendorExtensions.extraAnnotation}} {{{vendorExtensions.extraAnnotation}}} {{/vendorExtensions.extraAnnotation}} +{{^vendorExtensions.isJacksonOptionalNullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.isJacksonOptionalNullable}} public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.isJacksonOptionalNullable}} + {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} + if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.isJacksonOptionalNullable}} + {{^vendorExtensions.isJacksonOptionalNullable}} + return {{name}}; + {{/vendorExtensions.isJacksonOptionalNullable}} + } + + {{#vendorExtensions.isJacksonOptionalNullable}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { return {{name}}; } + {{/vendorExtensions.isJacksonOptionalNullable}} + {{^isReadOnly}} + {{#vendorExtensions.isJacksonOptionalNullable}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + public void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.{{name}} = {{name}}; + } + {{/vendorExtensions.isJacksonOptionalNullable}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.isJacksonOptionalNullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.isJacksonOptionalNullable}} + {{^vendorExtensions.isJacksonOptionalNullable}} this.{{name}} = {{name}}; + {{/vendorExtensions.isJacksonOptionalNullable}} } {{/isReadOnly}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache index fce25592536f..9e3aebc0a780 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/model.mustache @@ -10,6 +10,9 @@ import org.apache.commons.lang3.ObjectUtils; {{/supportJava6}} {{#imports}}import {{import}}; {{/imports}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +{{/jackson}} {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index 8e3abbae6a74..302b7e257c81 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -2,6 +2,13 @@ * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} */{{#description}} @ApiModel(description = "{{{description}}}"){{/description}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{/jackson}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} @@ -24,7 +31,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}}; + private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index 9bf214630797..bb173eef7e4e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index 9b6f2fdf2a4c..64aec46faf03 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -14,7 +14,7 @@ 1.8 4.12 3.4.1 - 3.3 + 3.8.1 {{vertxSwaggerRouterVersion}} 2.3 2.7.4 diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache index 3d582557526e..8b3f689c9121 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -36,10 +42,10 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache index 3d582557526e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -36,10 +42,10 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/Javascript/package.mustache b/modules/openapi-generator/src/main/resources/Javascript/package.mustache index 05c74e781db8..23515dd9c28c 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/package.mustache @@ -11,7 +11,7 @@ "fs": false }, "dependencies": { - "superagent": "3.7.0" + "superagent": "5.1.0" }, "devDependencies": { "expect.js": "^0.3.1", diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 9a8fba9fc43e..67c0f473b506 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -4,6 +4,7 @@ org.openapitools.codegen.languages.AndroidClientCodegen org.openapitools.codegen.languages.Apache2ConfigCodegen org.openapitools.codegen.languages.ApexClientCodegen org.openapitools.codegen.languages.AspNetCoreServerCodegen +org.openapitools.codegen.languages.AvroSchemaCodegen org.openapitools.codegen.languages.BashClientCodegen org.openapitools.codegen.languages.CLibcurlClientCodegen org.openapitools.codegen.languages.ClojureClientCodegen @@ -27,6 +28,7 @@ org.openapitools.codegen.languages.ErlangClientCodegen org.openapitools.codegen.languages.ErlangProperCodegen org.openapitools.codegen.languages.ErlangServerCodegen org.openapitools.codegen.languages.FlashClientCodegen +org.openapitools.codegen.languages.FsharpGiraffeServerCodegen org.openapitools.codegen.languages.GoClientCodegen org.openapitools.codegen.languages.GoClientExperimentalCodegen org.openapitools.codegen.languages.GoServerCodegen @@ -37,6 +39,7 @@ org.openapitools.codegen.languages.GroovyClientCodegen org.openapitools.codegen.languages.KotlinClientCodegen org.openapitools.codegen.languages.KotlinServerCodegen org.openapitools.codegen.languages.KotlinSpringServerCodegen +org.openapitools.codegen.languages.KotlinVertxServerCodegen org.openapitools.codegen.languages.HaskellHttpClientCodegen org.openapitools.codegen.languages.HaskellServantCodegen org.openapitools.codegen.languages.JavaClientCodegen @@ -60,6 +63,7 @@ org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen org.openapitools.codegen.languages.JMeterClientCodegen org.openapitools.codegen.languages.LuaClientCodegen org.openapitools.codegen.languages.MysqlSchemaCodegen +org.openapitools.codegen.languages.NimClientCodegen org.openapitools.codegen.languages.NodeJSServerCodegen org.openapitools.codegen.languages.NodeJSExpressServerCodegen org.openapitools.codegen.languages.ObjcClientCodegen @@ -75,6 +79,7 @@ org.openapitools.codegen.languages.PhpSilexServerCodegen org.openapitools.codegen.languages.PhpSymfonyServerCodegen org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen org.openapitools.codegen.languages.PowerShellClientCodegen +org.openapitools.codegen.languages.ProtobufSchemaCodegen org.openapitools.codegen.languages.PythonClientCodegen org.openapitools.codegen.languages.PythonClientExperimentalCodegen org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen @@ -111,3 +116,5 @@ org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen org.openapitools.codegen.languages.FsharpGiraffeServerCodegen +org.openapitools.codegen.languages.AsciidocDocumentationCodegen +org.openapitools.codegen.languages.FsharpFunctionsServerCodegen diff --git a/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache index 90e9e063940b..8b3f689c9121 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/android/libraries/volley/pom.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/pom.mustache index 66f1be9033b2..3e5b52e5394c 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/pom.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/pom.mustache @@ -53,7 +53,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.5.1 + 3.8.1 {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} diff --git a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache index f9ebd628a72f..ea68ac1ed00f 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache @@ -45,10 +45,10 @@ For more information, see &1 | grep -v 'To https' diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache new file mode 100644 index 000000000000..425cb563715f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -0,0 +1,101 @@ += {{{appName}}} +{{infoEmail}} +{{#version}}{{{version}}}{{/version}} +:toc: left +:numbered: +:toclevels: 3 +:source-highlighter: highlightjs +:keywords: openapi, rest, {{appName}} +:specDir: {{specDir}} +:snippetDir: {{snippetDir}} +:generator-template: v1 2019-09-03 +:info-url: {{infoUrl}} +:app-name: {{appName}} + +[abstract] +.Abstract +{{{appDescription}}} + +{{#specinclude}}intro.adoc{{/specinclude}} + +== Endpoints + +{{#apiInfo}} +{{#apis}} +{{#operations}} + +[.{{baseName}}] +=== {{baseName}} + +{{#operation}} + +[.{{nickname}}] +==== {{nickname}} + +`{{httpMethod}} {{path}}` + +{{{summary}}} + +===== Description + +{{{notes}}} + +{{#specinclude}}{{path}}/{{httpMethod}}/spec.adoc{{/specinclude}} + + +{{> params}} + +===== Return Type + +{{#hasReference}} +{{^returnSimpleType}}{{returnContainer}}[{{/returnSimpleType}}<<{{returnBaseType}}>>{{^returnSimpleType}}]{{/returnSimpleType}} +{{/hasReference}} + +{{^hasReference}} +{{#returnType}}<<{{returnType}}>>{{/returnType}} +{{^returnType}}-{{/returnType}} +{{/hasReference}} + +{{#hasProduces}} +===== Content Type + +{{#produces}} +* {{{mediaType}}} +{{/produces}} +{{/hasProduces}} + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + +{{#responses}} + +| {{code}} +| {{message}} +| {{^simpleType}}{{dataType}}[<<{{baseType}}>>]{{/simpleType}} {{#simpleType}}<<{{dataType}}>>{{/simpleType}} + +{{/responses}} +|=== + +===== Samples + +{{#snippetinclude}}{{path}}/{{httpMethod}}/http-request.adoc{{/snippetinclude}} +{{#snippetinclude}}{{path}}/{{httpMethod}}/http-response.adoc{{/snippetinclude}} + +{{#snippetlink}}* wiremock data, {{path}}/{{httpMethod}}/{{httpMethod}}.json{{/snippetlink}} + +ifdef::internal-generation[] +===== Implementation +{{#specinclude}}{{path}}/{{httpMethod}}/implementation.adoc{{/specinclude}} + +endif::internal-generation[] + +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +{{> model}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache new file mode 100644 index 000000000000..b36b7227c190 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache @@ -0,0 +1,28 @@ +[#models] +== Models + +{{#models}} + {{#model}} + +[#{{classname}}] +==== _{{classname}}_ {{title}} + +{{unescapedDescription}} + +[.fields-{{classname}}] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +{{#vars}} +| {{name}} +| {{#required}}X{{/required}} +| {{dataType}} {{#isContainer}} of <<{{complexType}}>>{{/isContainer}} +| {{description}} +| {{{dataFormat}}} {{#isEnum}}Enum: _ {{#_enum}}{{this}}, {{/_enum}}{{/isEnum}} _ + +{{/vars}} +|=== + + {{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache new file mode 100644 index 000000000000..863c72948915 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache @@ -0,0 +1,5 @@ +| {{paramName}} +| {{description}} {{#baseType}}<<{{baseType}}>>{{/baseType}} +| {{^required}}-{{/required}}{{#required}}X{{/required}} +| {{defaultValue}} +| {{{pattern}}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache new file mode 100644 index 000000000000..9be5b8377f04 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache @@ -0,0 +1,53 @@ +===== Parameters + +{{#hasPathParams}} +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +{{#pathParams}} +{{>param}} +{{/pathParams}} +|=== +{{/hasPathParams}} + +{{#hasBodyParam}} +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +{{#bodyParams}} +{{>param}} +{{/bodyParams}} +|=== +{{/hasBodyParam}} + +{{#hasHeaderParams}} +====== Header Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +{{#headerParams}} +{{>param}} +{{/headerParams}} +|=== +{{/hasHeaderParams}} + +{{#hasQueryParams}} +====== Query Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +{{#queryParams}} +{{>param}} +{{/queryParams}} +|=== +{{/hasQueryParams}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/stubs/empty.adoc b/modules/openapi-generator/src/main/resources/asciidoc-documentation/stubs/empty.adoc new file mode 100644 index 000000000000..c6d8ea163e71 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/stubs/empty.adoc @@ -0,0 +1 @@ +// openapi generator built documentation, see https://github.com/OpenAPITools/openapi-generator diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache index 2d42dc2916ba..fbd2d815d58d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}[FromForm]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}[FromForm]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache index 45a5be9d7b5b..a3a929904c62 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache index bf1cb3902fc3..fcb2200d5b73 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache @@ -18,22 +18,20 @@ namespace {{modelPackage}} /// [DataContract] public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{>enumClass}}{{/items}}{{/items.isEnum}} + { {{#vars}}{{#isEnum}}{{^isModel}}{{>enumClass}}{{/isModel}}{{/isEnum}}{{#items.isEnum}}{{^isModel}}{{#items}}{{>enumClass}}{{/items}}{{/isModel}}{{/items.isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} - /// - {{#description}} - /// {{description}} - {{/description}} - {{#required}} - [Required] - {{/required}} - {{#pattern}} - [RegularExpression("{{{pattern}}}")] - {{/pattern}} + /// {{#description}} + /// {{description}}{{/description}}{{#required}} + [Required]{{/required}}{{#pattern}} + [RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} + [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} + [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} + [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} + [Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache index e9fa09b005d3..c454950bd147 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/avro-schema/model.mustache b/modules/openapi-generator/src/main/resources/avro-schema/model.mustache new file mode 100644 index 000000000000..55232ea9a971 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/avro-schema/model.mustache @@ -0,0 +1,11 @@ +{{#models}} +{{#model}} +{ + "namespace": "{{packageName}}", + "type": "{{#isEnum}}enum{{/isEnum}}{{^isEnum}}record{{/isEnum}}", + "doc": "{{{description}}}", + "name": "{{{classname}}}", +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}} +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/avro-schema/modelEnum.mustache b/modules/openapi-generator/src/main/resources/avro-schema/modelEnum.mustache new file mode 100644 index 000000000000..b0659602bd41 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/avro-schema/modelEnum.mustache @@ -0,0 +1,3 @@ + "symbols": [{{#allowableValues}}{{#enumVars}} + {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + ] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache b/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache new file mode 100644 index 000000000000..0472804f293c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache @@ -0,0 +1,9 @@ + "fields": [ + {{#vars}} + { + "name": "{{baseName}}", + "type": {{^required}}["null", {{/required}}{{>typeProperty}}{{^required}}]{{/required}}, + "doc": "{{{description}}}" + }{{^-last}},{{/-last}} + {{/vars}} + ] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/avro-schema/typeArray.mustache b/modules/openapi-generator/src/main/resources/avro-schema/typeArray.mustache new file mode 100644 index 000000000000..01aba0e2043a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/avro-schema/typeArray.mustache @@ -0,0 +1,4 @@ +{ + "type": "{{dataType}}", + {{#items}}"items": "{{#isModel}}{{package}}.{{/isModel}}{{dataType}}"{{/items}} + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/avro-schema/typeEnum.mustache b/modules/openapi-generator/src/main/resources/avro-schema/typeEnum.mustache new file mode 100644 index 000000000000..9925382e34e1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/avro-schema/typeEnum.mustache @@ -0,0 +1,7 @@ +{ + "type": "enum", + "name": "{{classname}}_{{name}}", + "symbols": [{{#allowableValues}}{{#enumVars}} + {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + ] + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache b/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache new file mode 100644 index 000000000000..ffad928c07a8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache @@ -0,0 +1 @@ +{{^isEnum}}{{^isContainer}}{{#isPrimitiveType}}"{{dataType}}"{{/isPrimitiveType}}{{#isModel}}"{{package}}.{{dataType}}"{{/isModel}}{{/isContainer}}{{#isContainer}}{{>typeArray}}{{/isContainer}}{{/isEnum}}{{#isEnum}}{{>typeEnum}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache index a822ae28ae59..2ad6f17868fd 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 @@ -35,5 +35,5 @@ file(GLOB SRCS ) add_executable(${PROJECT_NAME} ${SRCS} ) -add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN) +{{#addExternalLibs}}add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN){{/addExternalLibs}} target_link_libraries(${PROJECT_NAME} pistache pthread) diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache index 239c88e4473e..01d7882fa984 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache @@ -13,11 +13,12 @@ #include "{{classname}}Impl.h"{{/operations}}{{/apis}}{{/apiInfo}} #define PISTACHE_SERVER_THREADS 2 -#define PISTACHE_SERVER_MAX_PAYLOAD 32768 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 static Pistache::Http::Endpoint *httpEndpoint; #ifdef __linux__ -static void sigHandler(int sig){ +static void sigHandler [[noreturn]] (int sig){ switch(sig){ case SIGINT: case SIGQUIT: @@ -61,7 +62,8 @@ int main() { auto opts = Pistache::Http::Endpoint::options() .threads(PISTACHE_SERVER_THREADS); opts.flags(Pistache::Tcp::Options::ReuseAddr); - opts.maxPayload(PISTACHE_SERVER_MAX_PAYLOAD); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); httpEndpoint->init(opts); {{#apiInfo}}{{#apis}}{{#operations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache index a05667766a9f..b999e5997b4e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache @@ -35,12 +35,10 @@ public: /// /// {{description}} /// - {{#isContainer}}{{{dataType}}}& {{getter}}(); - {{/isContainer}}{{^isContainer}}{{{dataType}}} {{getter}}() const; - void {{setter}}({{{dataType}}} const{{^isPrimitiveType}}&{{/isPrimitiveType}} value); - {{/isContainer}}{{^required}}bool {{nameInCamelCase}}IsSet() const; - void unset{{name}}(); - {{/required}} + {{{dataType}}}{{#isContainer}}&{{/isContainer}} {{getter}}(){{^isContainer}} const{{/isContainer}}; + void {{setter}}({{{dataType}}} const{{^isPrimitiveType}}&{{/isPrimitiveType}} value);{{^required}} + bool {{nameInCamelCase}}IsSet() const; + void unset{{name}}();{{/required}} {{/vars}} friend void to_json(nlohmann::json& j, const {{classname}}& o); diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache index e69d65cafc68..03b8d574df46 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache @@ -29,7 +29,7 @@ void to_json(nlohmann::json& j, const {{classname}}& o) { j = nlohmann::json(); {{#vars}} - {{#required}}j["{{baseName}}"] = o.m_{{name}};{{/required}}{{^required}}if(o.{{nameInCamelCase}}IsSet()) + {{#required}}j["{{baseName}}"] = o.m_{{name}};{{/required}}{{^required}}if(o.{{nameInCamelCase}}IsSet(){{#isContainer}} || !o.m_{{name}}.empty(){{/isContainer}}) j["{{baseName}}"] = o.m_{{name}};{{/required}} {{/vars}} } @@ -45,20 +45,15 @@ void from_json(const nlohmann::json& j, {{classname}}& o) {{/vars}} } -{{#vars}}{{#isContainer}}{{{dataType}}}& {{classname}}::{{getter}}() -{ - return m_{{name}}; -} -{{/isContainer}}{{^isContainer}}{{{dataType}}} {{classname}}::{{getter}}() const +{{#vars}}{{{dataType}}}{{#isContainer}}&{{/isContainer}} {{classname}}::{{getter}}(){{^isContainer}} const{{/isContainer}} { return m_{{name}}; } void {{classname}}::{{setter}}({{{dataType}}} const{{^isPrimitiveType}}&{{/isPrimitiveType}} value) { - m_{{name}} = value; - {{^required}}m_{{name}}IsSet = true;{{/required}} + m_{{name}} = value;{{^required}} + m_{{name}}IsSet = true;{{/required}} } -{{/isContainer}} {{^required}}bool {{classname}}::{{nameInCamelCase}}IsSet() const { return m_{{name}}IsSet; diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache new file mode 100644 index 000000000000..a49415db26de --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-header.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} +{{#models}}{{#model}}/* + * {{classname}}.h + * + * {{description}} + */ + +#ifndef {{classname}}_H_ +#define {{classname}}_H_ + +{{{defaultInclude}}} +{{#imports}}{{{this}}} +{{/imports}} +#include +#include + +{{#modelNamespaceDeclarations}} +namespace {{this}} { +{{/modelNamespaceDeclarations}} + +struct {{classname}} +{ + {{#vars}} + {{^required}}Pistache::Optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{baseName}}; + {{/vars}} + + nlohmann::json to_json() const; + static {{classname}} from_json(const nlohmann::json& j); +}; + +void to_json(nlohmann::json& j, const {{classname}}& o); +void from_json(const nlohmann::json& j, {{classname}}& o); + +{{#modelNamespaceDeclarations}} +} // {{this}} +{{/modelNamespaceDeclarations}} + +#endif /* {{classname}}_H_ */ +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache new file mode 100644 index 000000000000..2e4f114cc73c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-struct-source.mustache @@ -0,0 +1,49 @@ +{{>licenseInfo}} +{{#models}}{{#model}} + +#include "{{classname}}.h" + +{{#modelNamespaceDeclarations}} +namespace {{this}} { +{{/modelNamespaceDeclarations}} + +nlohmann::json {{classname}}::to_json() const +{ + nlohmann::json j; + {{#modelNamespaceDeclarations}}::{{this}}{{/modelNamespaceDeclarations}}::to_json(j, *this); + return j; +} + +{{classname}} {{classname}}::from_json(const nlohmann::json& j) +{ + {{classname}} o{}; + {{#modelNamespaceDeclarations}}::{{this}}{{/modelNamespaceDeclarations}}::from_json(j, o); + return o; +} + +void to_json(nlohmann::json& j, const {{classname}}& o) +{ + {{#vars}} + {{^required}}if (!o.{{baseName}}.isEmpty()){{/required}} + j["{{baseName}}"] = o.{{baseName}}{{^required}}.get(){{/required}}; + {{/vars}} +} + +void from_json(const nlohmann::json& j, {{classname}}& o) +{ + {{#vars}} + {{#required}}j.at("{{baseName}}").get_to(o.{{baseName}});{{/required}} + {{^required}}if (j.find("{{baseName}}") != j.end()) { + {{{dataType}}} temporary_{{baseName}}; + j.at("{{baseName}}").get_to(temporary_{{baseName}}); + o.{{baseName}} = Pistache::Some(temporary_{{baseName}}); + }{{/required}} + {{/vars}} +} + +{{#modelNamespaceDeclarations}} +} // {{this}} +{{/modelNamespaceDeclarations}} + +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache new file mode 100644 index 000000000000..a4ff7f64c4a0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache @@ -0,0 +1,155 @@ +{{>licenseInfo}} + +#include +#include +#include +#include + +#include "{{prefix}}HttpFileElement.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} + +void +{{prefix}}HttpFileElement::setMimeType(const QString &mime){ + mime_type = mime; +} + +void +{{prefix}}HttpFileElement::setFileName(const QString &name){ + local_filename = name; +} + +void +{{prefix}}HttpFileElement::setVariableName(const QString &name){ + variable_name = name; +} + +void +{{prefix}}HttpFileElement::setRequestFileName(const QString &name){ + request_filename = name; +} + +bool +{{prefix}}HttpFileElement::isSet() const { + return !local_filename.isEmpty() || !request_filename.isEmpty(); +} + +QString +{{prefix}}HttpFileElement::asJson() const{ + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return QString(bArray); +} + +QJsonValue +{{prefix}}HttpFileElement::asJsonValue() const{ + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return QJsonDocument::fromBinaryData(bArray.data()).object(); +} + +bool +{{prefix}}HttpFileElement::fromStringValue(const QString &instr){ + QFile file(local_filename); + bool result = false; + if(file.exists()) { + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(instr.toUtf8()); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +bool +{{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) { + QFile file(local_filename); + bool result = false; + if(file.exists()) { + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(QJsonDocument(jval.toObject()).toBinaryData()); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +QByteArray +{{prefix}}HttpFileElement::asByteArray() const { + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return bArray; +} + +bool +{{prefix}}HttpFileElement::fromByteArray(const QByteArray& bytes){ + QFile file(local_filename); + bool result = false; + if(file.exists()){ + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(bytes); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +bool +{{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ + setMimeType(mime); + setFileName(localFName); + setVariableName(varName); + setRequestFileName(reqFname); + return fromByteArray(bytes); +} + +QByteArray +{{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ + setMimeType(mime); + setFileName(localFName); + setVariableName(varName); + setRequestFileName(reqFname); + return asByteArray(); +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.h.mustache new file mode 100644 index 000000000000..9ebfe3623566 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.h.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} +#ifndef {{prefix}}_HTTP_FILE_ELEMENT_H +#define {{prefix}}_HTTP_FILE_ELEMENT_H + +#include +#include +#include + + +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} + +class {{prefix}}HttpFileElement { + +public: + QString variable_name; + QString local_filename; + QString request_filename; + QString mime_type; + void setMimeType(const QString &mime); + void setFileName(const QString &name); + void setVariableName(const QString &name); + void setRequestFileName(const QString &name); + bool isSet() const; + bool fromStringValue(const QString &instr); + bool fromJsonValue(const QJsonValue &jval); + bool fromByteArray(const QByteArray& bytes); + bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); + QString asJson() const; + QJsonValue asJsonValue() const; + QByteArray asByteArray() const; + QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime); +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} + +Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}HttpFileElement) + +#endif // {{prefix}}_HTTP_FILE_ELEMENT_H 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 05bad7539e35..58f2398dfebc 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 @@ -1,11 +1,16 @@ {{>licenseInfo}} -#include "{{prefix}}HttpRequest.h" + + #include +#include +#include #include #include #include #include +#include "{{prefix}}HttpRequest.h" + {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -32,7 +37,7 @@ void {{prefix}}HttpRequestInput::add_var(QString key, QString value) { } void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { - {{prefix}}HttpRequestInputFileElement file; + {{prefix}}HttpFileElement file; file.variable_name = variable_name; file.local_filename = local_filename; file.request_filename = request_filename; @@ -48,6 +53,7 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f timeout = 0; timer = new QTimer(); manager = new QNetworkAccessManager(this); + workingDirectory = QDir::currentPath(); connect(manager, &QNetworkAccessManager::finished, this, &{{prefix}}HttpRequestWorker::on_manager_finished); } @@ -58,16 +64,50 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f } timer->deleteLater(); } + for (const auto & item: multiPartFields) { + if(item != nullptr) { + delete item; + } + } } -QMap {{prefix}}HttpRequestWorker::getResponseHeaders() const { +QMap {{prefix}}HttpRequestWorker::getResponseHeaders() const { return headers; } +{{prefix}}HttpFileElement {{prefix}}HttpRequestWorker::getHttpFileElement(const QString &fieldname){ + if(!files.isEmpty()){ + if(fieldname.isEmpty()){ + return files.first(); + }else if (files.contains(fieldname)){ + return files[fieldname]; + } + } + return OAIHttpFileElement(); +} + +QByteArray *{{prefix}}HttpRequestWorker::getMultiPartField(const QString &fieldname){ + if(!multiPartFields.isEmpty()){ + if(fieldname.isEmpty()){ + return multiPartFields.first(); + }else if (multiPartFields.contains(fieldname)){ + return multiPartFields[fieldname]; + } + } + return nullptr; +} + void {{prefix}}HttpRequestWorker::setTimeOut(int tout){ timeout = tout; } +void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path){ + if(!path.isEmpty()){ + workingDirectory = path; + } +} + + QString {{prefix}}HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -196,7 +236,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { } // add files - for (QList<{{prefix}}HttpRequestInputFileElement>::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { + for (QList<{{prefix}}HttpFileElement>::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { QFileInfo fi(file_info->local_filename); // ensure necessary variables are available @@ -276,8 +316,13 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); } - if (request_content.size() > 0 && !isFormData) { - request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) { + if(!input->headers.contains("Content-Type")){ + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + } + else { + request.setHeader(QNetworkRequest::ContentTypeHeader, input->headers.value("Content-Type")); + } } else if (input->var_layout == URL_ENCODED) { request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); @@ -331,9 +376,10 @@ void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { } } reply->deleteLater(); - + process_form_response(); emit on_execution_finished(this); } + void {{prefix}}HttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { error_type = QNetworkReply::TimeoutError; response = ""; @@ -341,9 +387,37 @@ void {{prefix}}HttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { disconnect(manager, nullptr, nullptr, nullptr); reply->abort(); reply->deleteLater(); - emit on_execution_finished(this); } + +void {{prefix}}HttpRequestWorker::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(); + if((contentDisposition.count() > 0) && (contentDisposition.first() == QString("attachment"))){ + QString filename = QUuid::createUuid().toString(); + for(const auto &file : contentDisposition){ + if(file.contains(QString("filename"))){ + filename = file.split(QString("="), QString::SkipEmptyParts).at(1); + break; + } + } + {{prefix}}HttpFileElement felement; + felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); + files.insert(filename, felement); + } + + } else if(getResponseHeaders().contains(QString("Content-Type")) ) { + auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); + if((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))){ + + } + else { + + } + } +} + QSslConfiguration* {{prefix}}HttpRequestWorker::sslDefaultConfiguration; 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 0af88c407086..5138113d7dcb 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 @@ -16,6 +16,7 @@ #include +#include "{{prefix}}HttpFileElement.h" {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -23,16 +24,6 @@ namespace {{this}} { enum {{prefix}}HttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; -class {{prefix}}HttpRequestInputFileElement { - -public: - QString variable_name; - QString local_filename; - QString request_filename; - QString mime_type; - -}; - class {{prefix}}HttpRequestInput { @@ -42,7 +33,7 @@ public: {{prefix}}HttpRequestVarLayout var_layout; QMap vars; QMap headers; - QList<{{prefix}}HttpRequestInputFileElement> files; + QList<{{prefix}}HttpFileElement> files; QByteArray request_body; {{prefix}}HttpRequestInput(); @@ -65,19 +56,26 @@ public: explicit {{prefix}}HttpRequestWorker(QObject *parent = nullptr); virtual ~{{prefix}}HttpRequestWorker(); - QMap getResponseHeaders() const; + QMap getResponseHeaders() const; QString http_attribute_encode(QString attribute_name, QString input); void execute({{prefix}}HttpRequestInput *input); static QSslConfiguration* sslDefaultConfiguration; void setTimeOut(int tout); + void setWorkingDirectory(const QString &path); + {{prefix}}HttpFileElement getHttpFileElement(const QString &fieldname = QString()); + QByteArray* getMultiPartField(const QString &fieldname = QString()); signals: void on_execution_finished({{prefix}}HttpRequestWorker *worker); private: QNetworkAccessManager *manager; - QMap headers; + QMap headers; + QMap files; + QMap multiPartFields; + QString workingDirectory; int timeout; void on_manager_timeout(QNetworkReply *reply); + void process_form_response(); private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache index 9f530b381aa0..854841518e2f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache @@ -18,8 +18,9 @@ HEADERS += \ # Others $${PWD}/{{prefix}}Helpers.h \ $${PWD}/{{prefix}}HttpRequest.h \ - $${PWD}/{{prefix}}Object.h - $${PWD}/{{prefix}}Enum.h + $${PWD}/{{prefix}}Object.h \ + $${PWD}/{{prefix}}Enum.h \ + $${PWD}/{{prefix}}HttpFileElement.h SOURCES += \ # Models @@ -38,5 +39,6 @@ SOURCES += \ {{/apiInfo}} # Others $${PWD}/{{prefix}}Helpers.cpp \ - $${PWD}/{{prefix}}HttpRequest.cpp + $${PWD}/{{prefix}}HttpRequest.cpp \ + $${PWD}/{{prefix}}HttpFileElement.cpp 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 5777507ec972..9b5d5973b1a7 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 @@ -37,6 +37,10 @@ void {{classname}}::setApiTimeOutMs(const int tout){ timeout = tout; } +void {{classname}}::setWorkingDirectory(const QString& path){ + workingDirectory = path; +} + void {{classname}}::addHeaders(const QString& key, const QString& value){ defaultHeaders.insert(key, value); } @@ -102,22 +106,23 @@ void } } {{/collectionFormat}}{{/queryParams}} - {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(); + {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(this); worker->setTimeOut(timeout); + worker->setWorkingDirectory(workingDirectory); {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); - {{#formParams}} - if ({{paramName}} != nullptr) { - {{^isFile}}input.add_var("{{baseName}}", {{paramName}});{{/isFile}}{{#isFile}}input.add_file("{{baseName}}", (*{{paramName}}).local_filename, (*{{paramName}}).request_filename, (*{{paramName}}).mime_type);{{/isFile}} - } - {{/formParams}}{{#bodyParams}} + {{#formParams}}{{^isFile}} + input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));{{/isFile}}{{#isFile}} + input.add_file("{{baseName}}", {{paramName}}.local_filename, {{paramName}}.request_filename, {{paramName}}.mime_type);{{/isFile}}{{/formParams}} + {{#bodyParams}} {{#isContainer}}{{#isListContainer}} QJsonDocument doc(::{{cppNamespace}}::toJsonValue({{paramName}}).toArray());{{/isListContainer}}{{#isMapContainer}} QJsonDocument doc(::{{cppNamespace}}::toJsonValue({{paramName}}).toObject());{{/isMapContainer}} QByteArray bytes = doc.toJson(); input.request_body.append(bytes); {{/isContainer}}{{^isContainer}}{{#isString}} - QString output({{paramName}});{{/isString}}{{#isByteArray}}QString output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}} - QString output = {{paramName}}.asJson();{{/isByteArray}}{{/isString}} + QString output({{paramName}});{{/isString}}{{#isByteArray}}QString output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}}{{^isFile}} + QString output = {{paramName}}.asJson();{{/isFile}}{{/isByteArray}}{{/isString}}{{#isFile}}{{#hasConsumes}}input.headers.insert("Content-Type", {{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}});{{/hasConsumes}} + QByteArray output = {{paramName}}.asByteArray();{{/isFile}} input.request_body.append(output); {{/isContainer}}{{/bodyParams}} {{#headerParams}} @@ -184,7 +189,7 @@ void {{/isMapContainer}} {{^isMapContainer}} {{^returnTypeIsPrimitive}} - {{{returnType}}} output(QString(worker->response)); + {{{returnType}}} output{{^isResponseFile}}(QString(worker->response)){{/isResponseFile}}{{#isResponseFile}} = worker->getHttpFileElement(){{/isResponseFile}}; {{/returnTypeIsPrimitive}} {{/isMapContainer}} {{/isListContainer}} 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 5f0232797544..aca810bfb78b 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 @@ -24,6 +24,7 @@ public: 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); {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}const {{{dataType}}}& {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); @@ -31,6 +32,7 @@ public: private: QString basePath; QString host; + QString workingDirectory; int timeout; QMap defaultHeaders; {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache index ddf83be29152..9b97b53e52c9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache @@ -55,11 +55,23 @@ toStringValue(const double &value){ return QString::number(value); } +QString +toStringValue(const {{prefix}}Object &value){ + return value.asJson(); +} + + QString toStringValue(const {{prefix}}Enum &value){ return value.asJson(); } +QString +toStringValue(const {{prefix}}HttpFileElement &value){ + return value.asJson(); +} + + QJsonValue toJsonValue(const QString &value){ return QJsonValue(value); @@ -115,6 +127,12 @@ toJsonValue(const {{prefix}}Enum &value){ return value.asJsonValue(); } +QJsonValue +toJsonValue(const {{prefix}}HttpFileElement &value){ + return value.asJsonValue(); +} + + bool fromStringValue(const QString &inStr, QString &value){ value.clear(); @@ -209,6 +227,11 @@ fromStringValue(const QString &inStr, {{prefix}}Enum &value){ return true; } +bool +fromStringValue(const QString &inStr, OAIHttpFileElement &value){ + return value.fromStringValue(inStr); +} + bool fromJsonValue(QString &value, const QJsonValue &jval){ bool ok = true; @@ -337,6 +360,11 @@ fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval){ return true; } +bool +fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval){ + return value.fromJsonValue(jval); +} + {{#cppNamespaceDeclarations}} } {{/cppNamespaceDeclarations}} 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 6c8436c55434..f5275022a716 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 @@ -11,8 +11,10 @@ #include #include #include + #include "{{prefix}}Object.h" #include "{{prefix}}Enum.h" +#include "{{prefix}}HttpFileElement.h" {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -27,7 +29,9 @@ namespace {{this}} { QString toStringValue(const bool &value); QString toStringValue(const float &value); QString toStringValue(const double &value); - QString toStringValue(const {{prefix}}Enum &value); + QString toStringValue(const {{prefix}}Object &value); + QString toStringValue(const {{prefix}}Enum &value); + QString toStringValue(const {{prefix}}HttpFileElement &value); template QString toStringValue(const QList &val) { @@ -52,6 +56,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); template QJsonValue toJsonValue(const QList &val) { @@ -80,7 +85,9 @@ namespace {{this}} { 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, {{prefix}}Enum &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); template bool fromStringValue(const QList &inStr, QList &val) { @@ -115,6 +122,7 @@ 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); template bool fromJsonValue(QList &val, const QJsonValue &jval) { 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 1e25f8982777..0f71c97ca6c8 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 @@ -2,13 +2,13 @@ {{#models}}{{#model}} #include "{{classname}}.h" -#include "{{prefix}}Helpers.h" - #include #include #include #include +#include "{{prefix}}Helpers.h" + {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -70,7 +70,7 @@ void if(varmap.count() > 0){ for(auto val : varmap.keys()){ {{^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)); + auto jval = QJsonValue::fromVariant(varmap.value(val)); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); {{name}}.insert({{name}}.end(), val, item); } @@ -103,7 +103,7 @@ QString QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} {{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const { {{^isEnum}}QJsonObject obj;{{#vars}} - {{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{ + {{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{ obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}})); }{{/isContainer}}{{#isContainer}} if({{name}}.size() > 0){ 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 556139facfb3..3c83c1f0d534 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 @@ -17,6 +17,7 @@ #include "{{prefix}}Object.h" #include "{{prefix}}Enum.h" + {{#models}} {{#model}} {{#cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache new file mode 100644 index 000000000000..a4ff7f64c4a0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.cpp.mustache @@ -0,0 +1,155 @@ +{{>licenseInfo}} + +#include +#include +#include +#include + +#include "{{prefix}}HttpFileElement.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} + +void +{{prefix}}HttpFileElement::setMimeType(const QString &mime){ + mime_type = mime; +} + +void +{{prefix}}HttpFileElement::setFileName(const QString &name){ + local_filename = name; +} + +void +{{prefix}}HttpFileElement::setVariableName(const QString &name){ + variable_name = name; +} + +void +{{prefix}}HttpFileElement::setRequestFileName(const QString &name){ + request_filename = name; +} + +bool +{{prefix}}HttpFileElement::isSet() const { + return !local_filename.isEmpty() || !request_filename.isEmpty(); +} + +QString +{{prefix}}HttpFileElement::asJson() const{ + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return QString(bArray); +} + +QJsonValue +{{prefix}}HttpFileElement::asJsonValue() const{ + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return QJsonDocument::fromBinaryData(bArray.data()).object(); +} + +bool +{{prefix}}HttpFileElement::fromStringValue(const QString &instr){ + QFile file(local_filename); + bool result = false; + if(file.exists()) { + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(instr.toUtf8()); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +bool +{{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) { + QFile file(local_filename); + bool result = false; + if(file.exists()) { + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(QJsonDocument(jval.toObject()).toBinaryData()); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +QByteArray +{{prefix}}HttpFileElement::asByteArray() const { + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return bArray; +} + +bool +{{prefix}}HttpFileElement::fromByteArray(const QByteArray& bytes){ + QFile file(local_filename); + bool result = false; + if(file.exists()){ + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(bytes); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +bool +{{prefix}}HttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ + setMimeType(mime); + setFileName(localFName); + setVariableName(varName); + setRequestFileName(reqFname); + return fromByteArray(bytes); +} + +QByteArray +{{prefix}}HttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ + setMimeType(mime); + setFileName(localFName); + setVariableName(varName); + setRequestFileName(reqFname); + return asByteArray(); +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache new file mode 100644 index 000000000000..9ebfe3623566 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/HttpFileElement.h.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} +#ifndef {{prefix}}_HTTP_FILE_ELEMENT_H +#define {{prefix}}_HTTP_FILE_ELEMENT_H + +#include +#include +#include + + +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} + +class {{prefix}}HttpFileElement { + +public: + QString variable_name; + QString local_filename; + QString request_filename; + QString mime_type; + void setMimeType(const QString &mime); + void setFileName(const QString &name); + void setVariableName(const QString &name); + void setRequestFileName(const QString &name); + bool isSet() const; + bool fromStringValue(const QString &instr); + bool fromJsonValue(const QJsonValue &jval); + bool fromByteArray(const QByteArray& bytes); + bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); + QString asJson() const; + QJsonValue asJsonValue() const; + QByteArray asByteArray() const; + QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime); +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} + +Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{prefix}}HttpFileElement) + +#endif // {{prefix}}_HTTP_FILE_ELEMENT_H diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache index 2874ef8c7129..bf34a3a150c0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/enum.mustache @@ -15,7 +15,7 @@ class {{prefix}}Enum { {{prefix}}Enum() { } - + {{prefix}}Enum(QString jsonString) { fromJson(jsonString); } @@ -48,7 +48,7 @@ class {{prefix}}Enum { return true; } private : - QString jstr; + QString jstr; }; {{#cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache index 9aa16e1b52a0..9b97b53e52c9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-body.mustache @@ -55,11 +55,23 @@ toStringValue(const double &value){ return QString::number(value); } +QString +toStringValue(const {{prefix}}Object &value){ + return value.asJson(); +} + + QString toStringValue(const {{prefix}}Enum &value){ return value.asJson(); } +QString +toStringValue(const {{prefix}}HttpFileElement &value){ + return value.asJson(); +} + + QJsonValue toJsonValue(const QString &value){ return QJsonValue(value); @@ -115,6 +127,12 @@ toJsonValue(const {{prefix}}Enum &value){ return value.asJsonValue(); } +QJsonValue +toJsonValue(const {{prefix}}HttpFileElement &value){ + return value.asJsonValue(); +} + + bool fromStringValue(const QString &inStr, QString &value){ value.clear(); @@ -209,6 +227,11 @@ fromStringValue(const QString &inStr, {{prefix}}Enum &value){ return true; } +bool +fromStringValue(const QString &inStr, OAIHttpFileElement &value){ + return value.fromStringValue(inStr); +} + bool fromJsonValue(QString &value, const QJsonValue &jval){ bool ok = true; @@ -220,7 +243,7 @@ fromJsonValue(QString &value, const QJsonValue &jval){ } else if(jval.isDouble()){ value = QString::number(jval.toDouble()); } else { - ok = false; + ok = false; } } else { ok = false; @@ -230,7 +253,7 @@ fromJsonValue(QString &value, const QJsonValue &jval){ bool fromJsonValue(QDateTime &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ value = QDateTime::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); @@ -254,7 +277,7 @@ fromJsonValue(QByteArray &value, const QJsonValue &jval){ bool fromJsonValue(QDate &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ value = QDate::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); @@ -266,7 +289,7 @@ fromJsonValue(QDate &value, const QJsonValue &jval){ bool fromJsonValue(qint32 &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ value = jval.toInt(); } else { @@ -277,7 +300,7 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){ bool fromJsonValue(qint64 &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ value = jval.toVariant().toLongLong(); } else { @@ -288,7 +311,7 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){ bool fromJsonValue(bool &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isBool()){ value = jval.toBool(); } else { @@ -299,7 +322,7 @@ fromJsonValue(bool &value, const QJsonValue &jval){ bool fromJsonValue(float &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isDouble()){ value = static_cast(jval.toDouble()); } else { @@ -310,7 +333,7 @@ fromJsonValue(float &value, const QJsonValue &jval){ bool fromJsonValue(double &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isDouble()){ value = jval.toDouble(); } else { @@ -321,7 +344,7 @@ fromJsonValue(double &value, const QJsonValue &jval){ bool fromJsonValue({{prefix}}Object &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isObject()){ value.fromJsonObject(jval.toObject()); ok = value.isValid(); @@ -337,6 +360,11 @@ fromJsonValue({{prefix}}Enum &value, const QJsonValue &jval){ return true; } +bool +fromJsonValue({{prefix}}HttpFileElement &value, const QJsonValue &jval){ + return value.fromJsonValue(jval); +} + {{#cppNamespaceDeclarations}} } {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache index 0948f4f662f1..f5275022a716 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/helpers-header.mustache @@ -11,8 +11,10 @@ #include #include #include + #include "{{prefix}}Object.h" #include "{{prefix}}Enum.h" +#include "{{prefix}}HttpFileElement.h" {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -27,7 +29,9 @@ namespace {{this}} { QString toStringValue(const bool &value); QString toStringValue(const float &value); QString toStringValue(const double &value); - QString toStringValue(const {{prefix}}Enum &value); + QString toStringValue(const {{prefix}}Object &value); + QString toStringValue(const {{prefix}}Enum &value); + QString toStringValue(const {{prefix}}HttpFileElement &value); template QString toStringValue(const QList &val) { @@ -52,6 +56,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); template QJsonValue toJsonValue(const QList &val) { @@ -80,7 +85,9 @@ namespace {{this}} { 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, {{prefix}}Enum &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); template bool fromStringValue(const QList &inStr, QList &val) { @@ -115,6 +122,7 @@ 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); template bool fromJsonValue(QList &val, const QJsonValue &jval) { @@ -129,7 +137,7 @@ namespace {{this}} { ok = false; } return ok; - } + } template bool fromJsonValue(QMap &val, const QJsonValue &jval) { diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache index 2a75a18c760c..0f71c97ca6c8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache @@ -2,13 +2,13 @@ {{#models}}{{#model}} #include "{{classname}}.h" -#include "{{prefix}}Helpers.h" - #include #include #include #include +#include "{{prefix}}Helpers.h" + {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -43,7 +43,7 @@ void {{^isEnum}}QByteArray array (jsonString.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject);{{/isEnum}}{{#isEnum}}{{#allowableValues}}{{#enumVars}} + 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; @@ -70,7 +70,7 @@ void if(varmap.count() > 0){ for(auto val : varmap.keys()){ {{^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)); + auto jval = QJsonValue::fromVariant(varmap.value(val)); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); {{name}}.insert({{name}}.end(), val, item); } @@ -92,7 +92,7 @@ QString {{#enumVars}} case e{{classname}}::{{name}}: val = {{#isString}}"{{value}}"{{/isString}}{{^isString}}QString::number({{value}}){{/isString}}; - break;{{#-last}} + break;{{#-last}} default: break;{{/-last}} {{/enumVars}} @@ -103,7 +103,7 @@ QString QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} {{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const { {{^isEnum}}QJsonObject obj;{{#vars}} - {{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{ + {{^isContainer}}{{#complexType}}if({{name}}.isSet()){{/complexType}}{{^complexType}}if(m_{{name}}_isSet){{/complexType}}{ obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}})); }{{/isContainer}}{{#isContainer}} if({{name}}.size() > 0){ diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache index 38b42f401a2c..3c83c1f0d534 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache @@ -17,6 +17,7 @@ #include "{{prefix}}Object.h" #include "{{prefix}}Enum.h" + {{#models}} {{#model}} {{#cppNamespaceDeclarations}} @@ -53,7 +54,7 @@ public: {{classname}}::e{{classname}} getValue() const; void setValue(const {{classname}}::e{{classname}}& value);{{/isEnum}} - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache index 100670d1fc5c..e58b49adb921 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/object.mustache @@ -15,7 +15,7 @@ class {{prefix}}Object { {{prefix}}Object() { } - + {{prefix}}Object(QString jsonString) { fromJson(jsonString); } diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache index effb911aa827..c3691a55382c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache @@ -294,9 +294,9 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r }) .then([=](std::vector localVarResponse) { - HttpContent localVarResult; + {{{returnType}}} localVarResult; std::shared_ptr stream = std::make_shared(std::string(localVarResponse.begin(), localVarResponse.end())); - localVarResult.setData(stream); + localVarResult->setData(stream); return localVarResult; {{/vendorExtensions.x-codegen-response-ishttpcontent}} {{^vendorExtensions.x-codegen-response-ishttpcontent}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache index 4504311e4053..8b3f689c9121 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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-petstore-cpprest "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index 868f98f7ac77..a1141597d0ed 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -42,14 +42,14 @@ public: enum class e{{classname}} { {{#allowableValues}} - {{#values}} + {{#enumVars}} {{#enumDescription}} /// /// {{enumDescription}} /// {{/enumDescription}} - {{classname}}_{{.}}{{^last}},{{/last}} - {{/values}} + {{classname}}_{{{name}}}{{^last}},{{/last}} + {{/enumVars}} {{/allowableValues}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index 08bb16e16982..9784bdaee679 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -27,8 +27,8 @@ web::json::value {{classname}}::toJson() const { web::json::value val = web::json::value::object(); - {{#allowableValues}}{{#values}} - if (m_value == e{{classname}}::{{classname}}_{{.}}) val = web::json::value::string(U("{{.}}"));{{/values}}{{/allowableValues}} + {{#allowableValues}}{{#enumVars}} + if (m_value == e{{classname}}::{{classname}}_{{name}}) val = web::json::value::string(U({{{value}}}));{{/enumVars}}{{/allowableValues}} return val; } @@ -37,8 +37,8 @@ void {{classname}}::fromJson(const web::json::value& val) { auto s = val.as_string(); - {{#allowableValues}}{{#values}} - if (s == utility::conversions::to_string_t("{{.}}")) m_value = e{{classname}}::{{classname}}_{{.}};{{/values}}{{/allowableValues}} + {{#allowableValues}}{{#enumVars}} + if (s == utility::conversions::to_string_t({{{value}}})) m_value = e{{classname}}::{{classname}}_{{name}};{{/enumVars}}{{/allowableValues}} } void {{classname}}::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const @@ -51,8 +51,8 @@ void {{classname}}::toMultipart(std::shared_ptr multipart, co utility::string_t s; - {{#allowableValues}}{{#values}} - if (m_value == e{{classname}}::{{classname}}_{{.}}) s = utility::conversions::to_string_t("{{.}}");{{/values}}{{/allowableValues}} + {{#allowableValues}}{{#enumVars}} + if (m_value == e{{classname}}::{{classname}}_{{name}}) s = utility::conversions::to_string_t({{{value}}});{{/enumVars}}{{/allowableValues}} multipart->add(ModelBase::toHttpContent(namePrefix, s)); } @@ -70,8 +70,8 @@ void {{classname}}::fromMultiPart(std::shared_ptr multipart, s = ModelBase::stringFromHttpContent(multipart->getContent(namePrefix)); e{{classname}} v; - {{#allowableValues}}{{#values}} - if (s == utility::conversions::to_string_t("{{.}}")) v = e{{classname}}::{{classname}}_{{.}};{{/values}}{{/allowableValues}} + {{#allowableValues}}{{#enumVars}} + if (s == utility::conversions::to_string_t({{{value}}})) v = e{{classname}}::{{classname}}_{{name}};{{/enumVars}}{{/allowableValues}} setValue(v); } diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache index 91446e73a33b..f4548d75605b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache @@ -118,8 +118,8 @@ std::shared_ptr ModelBase::toHttpContent( const utility::string_t& content->setName( name ); content->setContentDisposition( utility::conversions::to_string_t("form-data") ); content->setContentType( contentType ); - std::stringstream* valueAsStringStream = new std::stringstream(); - (*valueAsStringStream) << value; + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; content->setData( std::shared_ptr( valueAsStringStream ) ); return content; } @@ -129,8 +129,8 @@ std::shared_ptr ModelBase::toHttpContent( const utility::string_t& content->setName( name ); content->setContentDisposition( utility::conversions::to_string_t("form-data") ); content->setContentType( contentType ); - std::stringstream* valueAsStringStream = new std::stringstream(); - (*valueAsStringStream) << value; + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; content->setData( std::shared_ptr( valueAsStringStream) ) ; return content; } @@ -140,8 +140,8 @@ std::shared_ptr ModelBase::toHttpContent( const utility::string_t& content->setName( name ); content->setContentDisposition( utility::conversions::to_string_t("form-data") ); content->setContentType( contentType ); - std::stringstream* valueAsStringStream = new std::stringstream(); - (*valueAsStringStream) << value; + std::stringstream* valueAsStringStream = new std::stringstream(); + (*valueAsStringStream) << value; content->setData( std::shared_ptr( valueAsStringStream ) ); return content; } @@ -285,7 +285,7 @@ utility::string_t ModelBase::stringFromJson(const web::json::value& val) utility::datetime ModelBase::dateFromJson(const web::json::value& val) { - return val.is_null() ? utility::datetime::from_string(L"NULL", utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); + return val.is_null() ? utility::datetime::from_string(utility::conversions::to_string_t("NULL"), utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); } bool ModelBase::boolFromJson(const web::json::value& val) { diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache index 4504311e4053..8b3f689c9121 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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-petstore-cpprest "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index 55b3e96c4c7e..e874041b3e7c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -317,7 +317,7 @@ namespace {{packageName}}.Client request.RequestFormat = DataFormat.Json; } - request.AddBody(options.Data); + request.AddJsonBody(options.Data); } if (options.FileParameters != null) @@ -327,9 +327,9 @@ namespace {{packageName}}.Client var bytes = ClientUtils.ReadAsBytes(fileParam.Value); var fileStream = fileParam.Value as FileStream; if (fileStream != null) - FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); else - FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided"); + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); } } @@ -347,7 +347,7 @@ 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(), result) + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result) { ErrorText = response.ErrorMessage, Cookies = new List() 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 f9a29c90aa33..90d09845bd49 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -400,7 +400,7 @@ namespace {{packageName}}.Client { ApiKey = apiKey, ApiKeyPrefix = apiKeyPrefix, - DefaultHeader = defaultHeaders, + DefaultHeaders = defaultHeaders, BasePath = second.BasePath ?? first.BasePath, Timeout = second.Timeout, UserAgent = second.UserAgent ?? first.UserAgent, diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache index 50a93703f57e..a34c6eb5bd0d 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache @@ -21,6 +21,26 @@ namespace {{packageName}}.Client #endregion Private Fields + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) { + _dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary>(comparer); + } + + #endregion Constructors + #region Enumerators /// @@ -62,21 +82,44 @@ namespace {{packageName}}.Client _dictionary.Clear(); } + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. public bool Contains(KeyValuePair> item) { throw new NotImplementedException(); } + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented public void CopyTo(KeyValuePair>[] array, int arrayIndex) { throw new NotImplementedException(); } + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented public bool Remove(KeyValuePair> item) { throw new NotImplementedException(); } + /// + /// Gets the number of items contained in the Multimap. + /// public int Count { get @@ -85,6 +128,9 @@ namespace {{packageName}}.Client } } + /// + /// Gets a value indicating whether the Multimap is read-only. + /// public bool IsReadOnly { get @@ -93,6 +139,12 @@ namespace {{packageName}}.Client } } + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. public void Add(T key, IList value) { if (value != null && value.Count > 0) @@ -111,22 +163,47 @@ namespace {{packageName}}.Client } } + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. public bool ContainsKey(T key) { return _dictionary.ContainsKey(key); } + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. public bool Remove(T key) { IList list; return TryRemove(key, out list); } + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. public bool TryGetValue(T key, out IList value) { return _dictionary.TryGetValue(key, out value); } + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. public IList this[T key] { get @@ -136,6 +213,9 @@ namespace {{packageName}}.Client set { _dictionary[key] = value; } } + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// public ICollection Keys { get @@ -144,6 +224,9 @@ namespace {{packageName}}.Client } } + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// public ICollection> Values { get @@ -152,11 +235,24 @@ namespace {{packageName}}.Client } } + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. public void CopyTo(Array array, int index) { ((ICollection) _dictionary).CopyTo(array, index); } + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. public void Add(T key, TValue value) { if (value != null) @@ -181,7 +277,7 @@ namespace {{packageName}}.Client #region Private Members /** - * Helper method to encapsulate generator differences between dictioary types. + * Helper method to encapsulate generator differences between dictionary types. */ private bool TryRemove(T key, out IList value) { @@ -203,7 +299,7 @@ namespace {{packageName}}.Client } /** - * Helper method to encapsulate generator differences between dictioary types. + * Helper method to encapsulate generator differences between dictionary types. */ private bool TryAdd(T key, IList value) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache index f23e4b1cf939..a3fec02b66b9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache @@ -23,9 +23,7 @@ {{packageName}} {{packageName}} {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - {{targetFrameworkVersion}} - {{targetFrameworkIdentifier}} + {{targetFramework}} 512 bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml @@ -40,6 +38,4 @@ - - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache index b37471905a9d..65666612ab3a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -32,18 +32,11 @@ - {{packageGuid}} {{packageName}} - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}. - - - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index d7afee1b7952..985617647113 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -138,7 +138,7 @@ namespace {{packageName}}.{{apiPackage}} } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access.{{#supportsAsync}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache index e9c7bdb802b1..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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-petstore-perl "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index e40e9541db0e..f68d4c29a2cd 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -3,8 +3,6 @@ false {{targetFramework}} - {{targetFrameworkVersion}} - {{targetFrameworkIdentifier}} {{packageName}} {{packageName}} Library diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index c1d1c2e0c11f..c66575646c8a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -23,6 +23,8 @@ + + {{^netStandard}} diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache index 6e2a4aa2583c..812ac789ae5b 100644 --- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache @@ -245,6 +245,7 @@ namespace {{packageName}}.Client var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, contentType); + RestClient.UserAgent = Configuration.UserAgent; InterceptRequest(request); var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request); InterceptResponse(request, response); diff --git a/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache index e9c7bdb802b1..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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-petstore-perl "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache index 93cdde77b2a9..4b1c1420e031 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache @@ -39,7 +39,7 @@ version: {{pubVersion}} description: {{pubDescription}} dependencies: {{pubName}}: - git: https://github.com/{{gitUserId}}/{{gitRepoId}}.git + git: https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git version: 'any' ``` diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache index 1fd657ea1dfc..b162a53ad4b4 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache @@ -1,6 +1,6 @@ library {{pubName}}.api; -import 'package:http/io_client.dart'; +import 'package:http/http.dart' as http; import 'package:jaguar_serializer/jaguar_serializer.dart'; {{#protoFormat}} import 'package:jaguar_serializer_protobuf/proto_repo.dart'; @@ -19,7 +19,7 @@ import 'package:jaguar_mimetype/jaguar_mimetype.dart'; {{#jsonFormat}} final _jsonJaguarRepo = JsonRepo() -{{#models}}{{#model}}..add({{classname}}Serializer()) +{{#models}}{{#model}}{{^isEnum}}..add({{classname}}Serializer()){{/isEnum}} {{/model}}{{/models}}; final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, @@ -52,7 +52,7 @@ class {{clientName}} { * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) */ {{clientName}}({List interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -97,4 +97,4 @@ class {{clientName}} { } {{/apis}}{{/apiInfo}} -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache index 09985cf77d2a..0ee26193bba5 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache @@ -10,7 +10,12 @@ part '{{classFilename}}.jser.dart'; class {{classname}} { {{#vars}}{{#description}} /* {{{description}}} */{{/description}} - @Alias('{{{baseName}}}') + @Alias('{{{baseName}}}', isNullable:{{#isNullable}} true{{/isNullable}}{{^isNullable}} false{{/isNullable}},{{#allowableValues}} + {{^enumVars.empty}}{{^isString}}{{! isString because inline enums are not handled for now }} + processor: const {{{datatype}}}FieldProcessor(), + {{/isString}}{{/enumVars.empty}} + {{/allowableValues}} + ) final {{{datatype}}} {{name}}; {{#allowableValues}}{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{{/allowableValues}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache index 0698e149412b..ef2c35e2c2ad 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache @@ -1,6 +1,5 @@ -part '{{classFilename}}.jser.dart'; -@Entity() +{{#jsonFormat}} class {{classname}} { /// The underlying value of this enum member. final {{dataType}} value; @@ -12,27 +11,27 @@ class {{classname}} { {{#description}} /// {{description}} {{/description}} - static const {{classname}} {{{name}}}} = const {{classname}}._internal({{{value}}}); + static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} {{/allowableValues}} } -class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> { +class {{classname}}FieldProcessor implements FieldProcessor<{{classname}}, {{dataType}}> { + const {{classname}}FieldProcessor(); - @override - dynamic encode({{classname}} data) { - return data.value; - } + {{classname}} deserialize({{dataType}} data) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{{value}}}: return {{classname}}.{{{name}}}; + {{/enumVars}} + {{/allowableValues}} + default: throw('Unknown enum value to decode: $data'); + } + } - @override - {{classname}} decode(dynamic data) { - switch (data) { - {{#allowableValues}} - {{#enumVars}} - case {{{value}}}: return {{classname}}.{{{name}}}}; - {{/enumVars}} - {{/allowableValues}} - default: throw('Unknown enum value to decode: $data'); + {{dataType}} serialize({{classname}} item) { + return item.value; } - } } +{{/jsonFormat}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache index 92d71b84970d..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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 swagger-petstore "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache index 222eef07d295..2f33bb93d3fa 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache @@ -4,17 +4,17 @@ description: {{pubDescription}} environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.8.2' + jaguar_retrofit: ^2.8.8 {{#jsonFormat}} - jaguar_serializer: '^2.2.6' + jaguar_serializer: ^2.2.12 {{/jsonFormat}} {{#protoFormat}} - jaguar_serializer_protobuf: '^2.2.2' - jaguar_mimetype: '^1.0.1' + jaguar_serializer_protobuf: ^2.2.2 + jaguar_mimetype: ^1.0.1 {{/protoFormat}} dev_dependencies: - jaguar_retrofit_gen: '^2.8.5' + jaguar_retrofit_gen: ^2.8.10 {{#jsonFormat}} - jaguar_serializer_cli: '^2.2.5' + jaguar_serializer_cli: ^2.2.8 {{/jsonFormat}} - build_runner: '^1.1.1' \ No newline at end of file + build_runner: ^1.6.5 diff --git a/modules/openapi-generator/src/main/resources/dart/README.mustache b/modules/openapi-generator/src/main/resources/dart/README.mustache index 1766ea72105e..02c6cd2116ae 100644 --- a/modules/openapi-generator/src/main/resources/dart/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart/README.mustache @@ -31,7 +31,7 @@ version: {{pubVersion}} description: {{pubDescription}} dependencies: {{pubName}}: - git: https://github.com/{{gitUserId}}/{{gitRepoId}}.git + git: https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git version: 'any' ``` diff --git a/modules/openapi-generator/src/main/resources/dart/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/dart/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/dart2/README.mustache b/modules/openapi-generator/src/main/resources/dart2/README.mustache index eab8ee0ea7ac..76261fa04673 100644 --- a/modules/openapi-generator/src/main/resources/dart2/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/README.mustache @@ -19,24 +19,20 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements -Dart 1.20.0 or later OR Flutter 0.0.20 or later +Dart 2.0 or later ## Installation & Usage ### Github -If this Dart package is published to Github, please include the following in pubspec.yaml +If this Dart package is published to Github, add the following dependency to your pubspec.yaml ``` -name: {{pubName}} -version: {{pubVersion}} -description: {{pubDescription}} dependencies: {{pubName}}: - git: https://github.com/{{gitUserId}}/{{gitRepoId}}.git - version: 'any' + git: https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git ``` ### Local -To use the package in your local drive, please include the following in pubspec.yaml +To use the package in your local drive, add the following dependency to your pubspec.yaml ``` dependencies: {{pubName}}: diff --git a/modules/openapi-generator/src/main/resources/dart2/api.mustache b/modules/openapi-generator/src/main/resources/dart2/api.mustache index 9ecac421b67d..c5acc6314dfc 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api.mustache @@ -9,10 +9,10 @@ class {{classname}} { {{classname}}([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; {{#operation}} - /// {{summary}} + /// {{summary}} with HTTP info returned /// /// {{notes}} - {{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { + {{#returnType}}Future {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { Object postBody{{#bodyParam}} = {{paramName}}{{/bodyParam}}; // verify required params are set @@ -87,7 +87,14 @@ class {{classname}} { formParams, contentType, authNames); + return response; + } + /// {{summary}} + /// + /// {{notes}} + {{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { + Response response = await {{nickname}}WithHttpInfo({{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} {{/hasOptionalParams}}); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -112,6 +119,7 @@ class {{classname}} { return{{#returnType}} null{{/returnType}}; } } + {{/operation}} } {{/operations}} 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 bbb354648f99..7a668fc31475 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_client.mustache @@ -10,7 +10,7 @@ class QueryParam { class ApiClient { String basePath; - var client = {{#browserClient}}Browser{{/browserClient}}Client(); + var client = Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; @@ -44,11 +44,7 @@ class ApiClient { {{#model}} case '{{classname}}': {{#isEnum}} - // Enclose the value in a list so that Dartson can use a transformer - // to decode it. - final listValue = [value]; - final List listResult = dson.map(listValue, []); - return listResult[0]; + return new {{classname}}TypeTransformer().decode(value); {{/isEnum}} {{^isEnum}} return {{classname}}.fromJson(value); diff --git a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache index 577330e54cb6..720ac0b0dbf5 100644 --- a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache @@ -1,8 +1,7 @@ library {{pubName}}.api; import 'dart:async'; -import 'dart:convert';{{#browserClient}} -import 'package:http/browser_client.dart';{{/browserClient}} +import 'dart:convert'; import 'package:http/http.dart'; part 'api_client.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 9f9af4e51a78..d64dc80606aa 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -16,51 +16,70 @@ class {{classname}} { {{classname}}.fromJson(Map json) { if (json == null) return; {{#vars}} - if (json['{{baseName}}'] == null) { - {{name}} = null; - } else { {{#isDateTime}} - {{name}} = DateTime.parse(json['{{baseName}}']); + {{name}} = (json['{{baseName}}'] == null) ? + null : + DateTime.parse(json['{{baseName}}']); {{/isDateTime}} {{#isDate}} - {{name}} = DateTime.parse(json['{{baseName}}']); + {{name}} = (json['{{baseName}}'] == null) ? + null : + DateTime.parse(json['{{baseName}}']); {{/isDate}} {{^isDateTime}} {{^isDate}} {{#complexType}} {{#isListContainer}} - {{name}} = {{complexType}}.listFromJson(json['{{baseName}}']); + {{name}} = (json['{{baseName}}'] == null) ? + null : + {{complexType}}.listFromJson(json['{{baseName}}']); {{/isListContainer}} {{^isListContainer}} {{#isMapContainer}} - {{name}} = {{complexType}}.mapFromJson(json['{{baseName}}']); + {{#items.isListContainer}} + {{name}} = (json['{{baseName}}'] == null) ? + null : + {{items.complexType}}.mapListFromJson(json['{{baseName}}']); + {{/items.isListContainer}} + {{^items.isListContainer}} + {{name}} = (json['{{baseName}}'] == null) ? + null : + {{complexType}}.mapFromJson(json['{{baseName}}']); + {{/items.isListContainer}} {{/isMapContainer}} {{^isMapContainer}} - {{name}} = {{complexType}}.fromJson(json['{{baseName}}']); + {{name}} = (json['{{baseName}}'] == null) ? + null : + {{complexType}}.fromJson(json['{{baseName}}']); {{/isMapContainer}} {{/isListContainer}} {{/complexType}} {{^complexType}} {{#isListContainer}} - {{name}} = (json['{{baseName}}'] as List).cast<{{items.datatype}}>(); + {{name}} = (json['{{baseName}}'] == null) ? + null : + (json['{{baseName}}'] as List).cast<{{items.datatype}}>(); {{/isListContainer}} {{^isListContainer}} {{#isMapContainer}} - {{name}} = (json['{{baseName}}'] as Map).cast(); + {{name}} = (json['{{baseName}}'] == null) ? + null : + (json['{{baseName}}'] as Map).cast(); {{/isMapContainer}} {{^isMapContainer}} - {{#isDouble}} - {{name}} = json['{{baseName}}'].toDouble(); - {{/isDouble}} - {{^isDouble}} - {{name}} = json['{{baseName}}']; - {{/isDouble}} + {{#isDouble}} + {{name}} = (json['{{baseName}}'] == null) ? + null : + json['{{baseName}}'].toDouble(); + {{/isDouble}} + {{^isDouble}} + {{name}} = json['{{baseName}}']; + {{/isDouble}} {{/isMapContainer}} {{/isListContainer}} {{/complexType}} {{/isDate}} {{/isDateTime}} - } {{/vars}} } @@ -96,4 +115,15 @@ class {{classname}} { } return map; } + + // maps a json object with a list of {{classname}}-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = {{classname}}.listFromJson(value); + }); + } + return map; + } } diff --git a/modules/openapi-generator/src/main/resources/dart2/enum.mustache b/modules/openapi-generator/src/main/resources/dart2/enum.mustache index d4a4d2b8d111..df8d8ff90352 100644 --- a/modules/openapi-generator/src/main/resources/dart2/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/enum.mustache @@ -1,4 +1,3 @@ -@Entity() class {{classname}} { /// The underlying value of this enum member. final {{dataType}} value; @@ -13,16 +12,18 @@ class {{classname}} { static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} {{/allowableValues}} + + static {{classname}} fromJson(String value) { + return new {{classname}}TypeTransformer().decode(value); + } } -class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> { +class {{classname}}TypeTransformer { - @override dynamic encode({{classname}} data) { return data.value; } - @override {{classname}} decode(dynamic data) { switch (data) { {{#allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/dart2/model_test.mustache b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache index 49f403ef6955..6e9402d4473c 100644 --- a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache @@ -5,7 +5,9 @@ import 'package:test/test.dart'; // tests for {{classname}} void main() { - var instance = {{classname}}(); + {{^isEnum}} + var instance = new {{classname}}(); + {{/isEnum}} group('test {{classname}}', () { {{#vars}} diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index 43bb64bb55e1..59801210034b 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -4,6 +4,6 @@ description: {{pubDescription}} environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.13.0' + http: '>=0.12.0 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/flash/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache new file mode 100644 index 000000000000..8c8aebc852a5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache @@ -0,0 +1,65 @@ +namespace {{packageName}} + +open {{classname}}HandlerParams +open {{classname}}ServiceImplementation +open Microsoft.AspNetCore.Mvc +open Microsoft.AspNetCore.Http +open Newtonsoft.Json +open Microsoft.Azure.WebJobs +open System.IO + +module {{classname}}Handlers = + + {{#operations}} + /// + /// {{description}} + /// + + {{#operation}} + //#region {{operationId}} + /// + /// {{#summary}}{{summary}}{{/summary}} + /// + [] + let {{operationId}} + ([] + req:HttpRequest ) = + + {{#hasBodyParam}} + use reader = StreamReader(req.Body) + + let mediaTypes = [{{#consumes}}"{{mediaType}}";{{/consumes}}] // currently unused + + {{#bodyParam}} + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject<{{operationId}}BodyParams> + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + {{/bodyParam}} + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = {{classname}}Service.{{operationId}} bodyParams + {{/hasBodyParam}} + {{^hasBodyParam}} + let result = {{classname}}Service.{{operationId}} () + {{/hasBodyParam}} + match result with + {{#responses}} + | {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} resolved -> + {{^primitiveType}} + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + {{/primitiveType}} + {{#primitiveType}} + let content = resolved.content + let responseContentType = "text/plain" + {{/primitiveType}} + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable({{code}})) + {{/responses}} + + {{/operation}} + {{/operations}} + + + diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache new file mode 100644 index 000000000000..336ef2d55cf3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache @@ -0,0 +1,147 @@ +namespace {{packageName}} + +{{#imports}} +{{#import}} +open {{import}} +{{/import}} +{{/imports}} +open System.Collections.Generic +open System + +module {{classname}}HandlerParams = + + {{#operations}} + {{#operation}} + {{#pathParams}} + {{#-first}} + //#region Path parameters + [] + type {{operationId}}PathParams = { + {{/-first}} + {{paramName}} : {{dataType}} {{^required}}option{{/required}}; + {{#-last}} + } + {{/-last}} + //#endregion + {{/pathParams}} + {{#queryParams}} + + {{#-first}} + //#region Query parameters + [] + type {{operationId}}QueryParams = { + {{/-first}} + {{paramName}} : {{dataType}} {{^required}}option{{/required}}; + + {{#-last}} + } + //#endregion + {{/-last}} + {{/queryParams}} + {{#bodyParams}} + + {{#-first}} + //#region Body parameters + [] + {{^hasMore}} + type {{operationId}}BodyParams = {{dataType}} + {{/hasMore}} + {{#hasMore}} + type {{operationId}}BodyParams = { + {{paramName}} : {{dataType}}; + {{/hasMore}} + {{/-first}} + {{^-first}} + {{paramName}} : {{dataType}}; + {{/-first}} + {{#-last}} + {{^-first}} + } + {{/-first}} + //#endregion + {{/-last}} + {{/bodyParams}} + {{#formParams}} + + //#region Form parameters + {{#-first}} + [] + type {{operationId}}FormParams = { + {{/-first}} + {{paramName}} : {{dataType}} {{^required}}option{{/required}}; + {{#-last}} + } + {{/-last}} + //#endregion + {{/formParams}} + {{#headerParams}} + + //#region Header parameters + {{#-first}} + [] + type {{operationId}}HeaderParams = { + {{/-first}} + {{paramName}} : {{dataType}} {{^required}}option{{/required}}; + {{#-last}} + } + {{/-last}} + //#endregion + {{/headerParams}} + {{#cookieParams}} + + //#region Cookie parameters + {{#-first}} + type {{operationId}}CookieParams = { + {{/-first}} + {{paramName}} : {{dataType}} {{^required}}option{{/required}}; + {{#-last}} + } + {{/-last}} + //#endregion + {{/cookieParams}} + + {{#responses}} + + type {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response = { + content:{{#dataType}}{{{.}}}{{/dataType}}{{^dataType}}string{{/dataType}}; + {{^code}}code:int{{/code}} + } + {{/responses}} + type {{operationId}}Result = {{#responses}}{{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} of {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response{{#hasMore}}|{{/hasMore}}{{/responses}} + + {{#allParams}} + {{#-first}} + type {{operationId}}Args = { + {{/-first}} + {{/allParams}} + {{#hasHeaderParams}} + headerParams:{{operationId}}HeaderParams; + {{/hasHeaderParams}} + {{#pathParams}} + {{#-first}} + pathParams:{{operationId}}PathParams; + {{/-first}} + {{/pathParams}} + {{#queryParams}} + {{#-first}} + queryParams:Result<{{operationId}}QueryParams,string>; + {{/-first}} + {{/queryParams}} + {{#bodyParams}} + {{#-first}} + bodyParams:{{operationId}}BodyParams + {{/-first}} + {{/bodyParams}} + {{#formParams}} + {{#-first}} + formParams:Result<{{operationId}}FormParams,string> + {{/-first}} + {{/formParams}} + {{#allParams}} + {{#-first}} + } + {{/-first}} + {{/allParams}} + {{/operation}} + {{/operations}} + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache new file mode 100644 index 000000000000..8084cc0cf8f8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache @@ -0,0 +1,35 @@ +namespace {{packageName}}.{{modelPackage}} + +open System +open System.Collections.Generic +open Newtonsoft.Json +{{#imports}} +open {{import}} +{{/imports}} + +module {{classname}} = + + {{#models}} + {{#model}} + //#region {{classname}} + + {{^allowableValues}} + [] + type {{classname}} = { + {{#vars}} + [] + {{name}} : {{#isDateTime}}{{^required}}Nullable<{{/required}}{{/isDateTime}}{{{dataType}}}{{#isDateTime}}{{^required}}>{{/required}}{{/isDateTime}}; + {{/vars}} + } + {{/allowableValues}} + {{#allowableValues}} + {{#enumVars}} + let {{name}} = {{#isString}}"{{value}}"{{/isString}}{{#isInteger}}"{{value}}"{{/isInteger}} + {{/enumVars}} + type {{classname}} = {{#isString}}string{{/isString}}{{#isInteger}}int{{/isInteger}} + {{/allowableValues}} + + //#endregion + {{/model}} + {{/models}} + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache new file mode 100644 index 000000000000..c0b479a470f2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache @@ -0,0 +1,41 @@ + + + {{packageName}} + {{packageName}} + netcoreapp2.1 + v2 + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + + + + {{#models}} + {{#model}} + + {{/model}} + {{/models}} + {{#apiInfo}} + {{#apis}} + {{#operations}} + + + + + {{/operations}} + {{/apis}} + {{/apiInfo}} + + + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache new file mode 100644 index 000000000000..9441f3981f6f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache @@ -0,0 +1,143 @@ +# {{packageName}} + +An [F# Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-fsharp) server stub for the {{packageName}} package, created via the [OpenAPI generator](https://github.com/OpenAPITools/openapi-generator/). + +## Models + +The following models have been auto-generated from the provided OpenAPI schema: + +{{#apiInfo}} +{{#models}} +{{#model}} +- model/{{classname}}Model.fs +{{/model}} +{{/models}} +{{/apiInfo}} + +## Operations + +Handlers have been auto-generated from the operations specified in the OpenAPI schema as follows: + +{{#apiInfo}} +{{#operations}} +{{#operation}} +- api/{{classname}}Handler.fs +{{/operation}} +{{/operations}} +{{/apiInfo}} + +## Operation Parameters + +Types have been generated for the URL, query, form, header and cookie parameters passed to each handler in the following files: + +{{#apiInfo}} +{{#apis}} +- api/{{classname}}HandlerParams.fs +{{/apis}} +{{/apiInfo}} + +## Service Interfaces + +Handlers will attempt to bind parameters to the applicable type and pass to a Service specific to that Handler. Service interfaces have been generated as follows: + +{{#apiInfo}} +{{#apis}} +- api/{{classname}}ServiceInterface.fs +{{/apis}} +{{/apiInfo}} + +Each Service contains functions for each [OperationId], each accepting a [OperationId]Params object that wraps the operation's parameters. + +If a requestBody is a ref type (i.e. a Model) or a single simple type, the operation parameter will be typed as the expected Model: + +`type AddPetBodyParams = Pet` + +If a requestBody is a simple type with named properties, the operation parameters will be typed to reflect those properties: + +`type AddFooBodyParams = { + Name:string; + Age:int +} + +Each Service/operation function must accept the [OperationId]Params object and return a [OperationId]Result type. For example: + +`type AddPetArgs = { bodyParams:AddPetBodyParams } +type IPetApiService = abstract member AddPet:HttpContext -> AddPetArgs->AddPetResult` + +[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. + +This means that service implementations can only return status codes that have been declared in the OpenAPI specification. +However, if the OpenAPI spec declares a default Response for an operation, the service can manually set the status code. + +For example: + +`type FindPetsByStatusDefaultStatusCodeResponse = { content:Pet[];} +type FindPetsByStatusStatusCode400Response = { content:string; } +type FindPetsByStatusResult = FindPetsByStatusDefaultStatusCode of FindPetsByStatusDefaultStatusCodeResponse | FindPetsByStatusStatusCode400 of FindPetsByStatusStatusCode400Response` + +## Service Implementations + +Stubbed service implementations of those interfaces have been generated as follows: + +{{#apiInfo}} +{{#apis}} +- impl/{{classname}}Service.fs +{{/apis}} +{{/apiInfo}} + +You should manually edit these files to implement your business logic. + +## Additional Handlers + +Additional handlers can be configured in the Customization.fs + +`let handlers : HttpHandler list = [ + // insert your handlers here + GET >=> + choose [ + route "/login" >=> redirectToLogin + route "/logout" >=> logout + ] + ]` + +## TODO/currently unsupported + +- form request bodies (URL-encoded or multipart) +- limit handler access to specified oAuth scheme when multiple oAuth schemes defined +- XML content/response types +- http authentication +- testing header params + +## .openapi-generator-ignore + +It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. + +This will allow you to regenerate model, operation and parameter files without overriding your implementations of business logic, authentication, data layers, and so on. + +## Build and test the application + +### Windows + +Run the `build.bat` script in order to restore, build and test (if you've selected to include tests) the application: + +``` +> ./build.bat +``` + +### Linux/macOS + +Run the `build.sh` script in order to restore, build and test (if you've selected to include tests) the application: + +``` +$ ./build.sh +``` + +## Run the application + +After a successful build you can start the web application by executing the following command in your terminal: + +``` +dotnet run --project src/{{packageName} +``` + +After the application has started visit [http://localhost:5000](http://localhost:5000) in your preferred browser. \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache new file mode 100644 index 000000000000..18050015f8ce --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache @@ -0,0 +1,43 @@ +namespace {{packageName}} +{{#imports}} +{{#import}} +open {{import}} +{{/import}} +{{/imports}} +open {{classname}}HandlerParams +open {{classname}}ServiceInterface +open System.Collections.Generic +open System + +module {{classname}}ServiceImplementation = + + //#region Service implementation + type {{classname}}ServiceImpl() = + interface I{{classname}}Service with + + {{#operations}} + {{#operation}} + member this.{{operationId}} {{^hasBodyParam}}(){{/hasBodyParam}}{{#hasBodyParam}}(parameters:{{operationId}}BodyParams){{/hasBodyParam}} = + {{#responses}} + {{#-first}} + {{#hasMore}} + if true then + {{/hasMore}} + {{/-first}} + {{^-first}} + {{#hasMore}} + else if true then + {{/hasMore}} + {{^hasMore}} + else + {{/hasMore}} + {{/-first}} + let content = "{{message}}" {{#dataType}}:> obj :?> {{{.}}} // this cast is obviously wrong, and is only intended to allow generated project to compile {{/dataType}} + {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} { content = content } + {{/responses}} + + {{/operation}} + {{/operations}} + //#endregion + + let {{classname}}Service = {{classname}}ServiceImpl() :> I{{classname}}Service \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache new file mode 100644 index 000000000000..c57b01778fd9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache @@ -0,0 +1,16 @@ +namespace {{packageName}} +open {{classname}}HandlerParams +open System +open Microsoft.AspNetCore.Http + + +module {{classname}}ServiceInterface = + + //#region Service interface + type I{{classname}}Service = + {{#operations}} + {{#operation}} + abstract member {{operationId}} : {{^hasBodyParam}}unit{{/hasBodyParam}}{{#hasBodyParam}}{{operationId}}BodyParams{{/hasBodyParam}} -> {{operationId}}Result + {{/operation}} + {{/operations}} + //#endregion \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache new file mode 100644 index 000000000000..9e7afd0a272f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache @@ -0,0 +1,3 @@ +dotnet restore {{packageName}}.fsproj +dotnet build {{packageName}}.fsproj + diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache new file mode 100644 index 000000000000..ab63b07a1420 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache @@ -0,0 +1,4 @@ +#!/bin/sh +dotnet restore {{packageName}}.fsproj +dotnet build {{packageName}}.fsproj + diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/gitignore.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/gitignore.mustache new file mode 100644 index 000000000000..ab071890fc85 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/gitignore.mustache @@ -0,0 +1,265 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# Azure Functions localsettings file +local.settings.json + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +**/packages/** +# except build/, which is used as an MSBuild target. +#!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +mercury_server/.paket/paket.exe +mercury_server/paket-files/ + +# FAKE - F# Make +mercury_server/.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/host.json b/modules/openapi-generator/src/main/resources/fsharp-functions-server/host.json new file mode 100644 index 000000000000..ccd1678a5e12 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/host.json @@ -0,0 +1,8 @@ +{ + "version": "2.0", + "extensions":{ + "http": { + "routePrefix": "" + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/local.settings.json b/modules/openapi-generator/src/main/resources/fsharp-functions-server/local.settings.json new file mode 100644 index 000000000000..3cdc862b5226 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/local.settings.json @@ -0,0 +1,7 @@ +{ + "IsEncrypted": false, + "Values": { + "AzureWebJobsStorage": "", + "FUNCTIONS_WORKER_RUNTIME": "dotnet" + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache index 869443a26edf..2f51e5cbccf0 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache @@ -31,7 +31,7 @@ go get github.com/antihax/optional Put the package under your project folder and add the following in import: ```golang -import "./{{packageName}}" +import sw "./{{packageName}}" ``` ## Documentation for API Endpoints @@ -54,19 +54,14 @@ Class | Method | HTTP request | Description {{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} {{#authMethods}} -## {{{name}}} +### {{{name}}} -{{#isApiKey}}- **Type**: API key +{{#isApiKey}} +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` +Note, each API key must be added to a map of `map[string]APIKey` where the key is: {{keyParamName}} and passed in as the auth context for each request. {{/isApiKey}} {{#isBasic}}- **Type**: HTTP basic authentication diff --git a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache index 2b04681ac91a..41a990f9e50c 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache @@ -3,28 +3,50 @@ package {{packageName}} {{#operations}} import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" {{#imports}} "{{import}}" {{/imports}} ) // Linger please var ( - _ context.Context + _ _context.Context ) +// {{classname}}Service {{classname}} service type {{classname}}Service service {{#operation}} +{{#hasOptionalParams}} +// {{{nickname}}}Opts Optional parameters for the method '{{{nickname}}}' +type {{{nickname}}}Opts struct { +{{#allParams}} +{{^required}} +{{#isPrimitiveType}} +{{^isBinary}} + {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}} +{{/isBinary}} +{{#isBinary}} + {{vendorExtensions.x-exportParamName}} optional.Interface +{{/isBinary}} +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{vendorExtensions.x-exportParamName}} optional.Interface +{{/isPrimitiveType}} +{{/required}} +{{/allParams}} +} + +{{/hasOptionalParams}} /* -{{{classname}}}Service{{#summary}} {{{.}}}{{/summary}} +{{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} {{#notes}} {{notes}} {{/notes}} - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). {{#allParams}} {{#required}} * @param {{paramName}}{{#description}} {{{.}}}{{/description}} @@ -42,30 +64,9 @@ type {{classname}}Service service @return {{{returnType}}} {{/returnType}} */ -{{#hasOptionalParams}} - -type {{{nickname}}}Opts struct { -{{#allParams}} -{{^required}} -{{#isPrimitiveType}} -{{^isBinary}} - {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}} -{{/isBinary}} -{{#isBinary}} - {{vendorExtensions.x-exportParamName}} optional.Interface -{{/isBinary}} -{{/isPrimitiveType}} -{{^isPrimitiveType}} - {{vendorExtensions.x-exportParamName}} optional.Interface -{{/isPrimitiveType}} -{{/required}} -{{/allParams}} -} - -{{/hasOptionalParams}} -func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) { var ( - localVarHttpMethod = http.Method{{httpMethod}} + localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -77,11 +78,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} // create path and map variables localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}} + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", {{paramName}})), -1){{/pathParams}} localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} {{#allParams}} {{#required}} {{#minItems}} @@ -132,35 +133,61 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{#hasQueryParams}} {{#queryParams}} {{#required}} + {{#isCollectionFormatMulti}} + t:={{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + {{/isCollectionFormatMulti}} {{/required}} {{^required}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() { + {{#isCollectionFormatMulti}} + t:=localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + {{/isCollectionFormatMulti}} } {{/required}} {{/queryParams}} {{/hasQueryParams}} // to determine the Content-Type header {{=<% %>=}} - localVarHttpContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} + localVarHTTPContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} <%={{ }}=%> // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header {{=<% %>=}} - localVarHttpHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} + localVarHTTPHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} <%={{ }}=%> // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } {{#hasHeaderParams}} {{#headerParams}} @@ -192,7 +219,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} } {{/required}} if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -249,74 +276,76 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{^isKeyInCookie}} if ctx != nil { // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key + if auth, ok := ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := auth["{{keyParamName}}"]; ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + {{#isKeyInHeader}} + localVarHeaderParams["{{keyParamName}}"] = key + {{/isKeyInHeader}} + {{#isKeyInQuery}} + localVarQueryParams.Add("{{keyParamName}}", key) + {{/isKeyInQuery}} } - {{#isKeyInHeader}} - localVarHeaderParams["{{keyParamName}}"] = key - {{/isKeyInHeader}} - {{#isKeyInQuery}} - localVarQueryParams.Add("{{keyParamName}}", key) - {{/isKeyInQuery}} } } {{/isKeyInCookie}} {{/isApiKey}} {{/authMethods}} - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } {{#responses}} {{#dataType}} - if localVarHttpResponse.StatusCode == {{{code}}} { + if localVarHTTPResponse.StatusCode == {{{code}}} { var v {{{dataType}}} - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } newErr.model = v - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } {{/dataType}} {{/responses}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } {{#returnType}} - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } {{/returnType}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, nil } {{/operation}} {{/operations}} 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 1c4241ff043b..c3af45341201 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/client.mustache @@ -164,7 +164,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } -// Change base path to allow switching to mocks +// ChangeBasePath changes base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } diff --git a/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache b/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache index 81d3a41b7bdf..0b74d83401f7 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache @@ -25,8 +25,8 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -41,6 +41,7 @@ type APIKey struct { Prefix string } +// Configuration stores the configuration of the API client type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` @@ -50,6 +51,7 @@ type Configuration struct { HTTPClient *http.Client } +// NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "{{{basePath}}}", @@ -59,6 +61,7 @@ func NewConfiguration() *Configuration { return cfg } +// AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } diff --git a/modules/openapi-generator/src/main/resources/go-experimental/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go-experimental/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/go-experimental/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache b/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache index ec4310dd5932..e02a1be201ba 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache @@ -1,4 +1,4 @@ -module github.com/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}} +module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}} require ( github.com/antihax/optional v0.0.0-20180406194304-ca021399b1a6 diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache index 17833f918b59..2b97b31b3cfa 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache @@ -12,9 +12,7 @@ import ( {{/imports}} {{#model}} {{#isEnum}} -{{#description}} -// {{{classname}}} : {{{description}}} -{{/description}} +// {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} // List of {{{name}}} @@ -23,11 +21,13 @@ const ( {{#enumVars}} {{^-first}} {{/-first}} - {{name}} {{{classname}}} = "{{{value}}}" + {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = "{{{value}}}" {{/enumVars}} {{/allowableValues}} -){{/isEnum}}{{^isEnum}}{{#description}} -// {{{description}}}{{/description}} +) +{{/isEnum}} +{{^isEnum}} +// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} type {{classname}} struct { {{#vars}} {{^-first}} @@ -36,7 +36,7 @@ type {{classname}} struct { // {{{description}}} {{/description}} {{name}} *{{{dataType}}} `json:"{{baseName}},omitempty"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` -{{#isNullable}} isExplicitNull{{name}} bool `json:"-"{{#withXml}} xml:"-"{{/withXml}}`{{/isNullable}} +{{#isNullable}} isExplicitNull{{name}} bool `json:"-"{{#withXml}} xml:"-"{{/withXml}}`{{/isNullable}} {{/vars}} } {{/isEnum}} @@ -87,6 +87,7 @@ func (o *{{classname}}) Set{{name}}ExplicitNull(b bool) { {{/isNullable}} {{/vars}} +// MarshalJSON returns the JSON representation of the model. func (o {{classname}}) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} {{#vars}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/response.mustache b/modules/openapi-generator/src/main/resources/go-experimental/response.mustache index e15d7e6a7835..1a8765bae8f1 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/response.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/response.mustache @@ -5,6 +5,7 @@ import ( "net/http" ) +// APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` @@ -22,12 +23,14 @@ type APIResponse struct { Payload []byte `json:"-"` } +// NewAPIResponse returns a new APIResonse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 2b04681ac91a..dc0a2f4dc8b1 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -3,28 +3,50 @@ package {{packageName}} {{#operations}} import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" {{#imports}} "{{import}}" {{/imports}} ) // Linger please var ( - _ context.Context + _ _context.Context ) +// {{classname}}Service {{classname}} service type {{classname}}Service service {{#operation}} +{{#hasOptionalParams}} +// {{{nickname}}}Opts Optional parameters for the method '{{{nickname}}}' +type {{{nickname}}}Opts struct { +{{#allParams}} +{{^required}} +{{#isPrimitiveType}} +{{^isBinary}} + {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}} +{{/isBinary}} +{{#isBinary}} + {{vendorExtensions.x-exportParamName}} optional.Interface +{{/isBinary}} +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{vendorExtensions.x-exportParamName}} optional.Interface +{{/isPrimitiveType}} +{{/required}} +{{/allParams}} +} + +{{/hasOptionalParams}} /* -{{{classname}}}Service{{#summary}} {{{.}}}{{/summary}} +{{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} {{#notes}} {{notes}} {{/notes}} - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). {{#allParams}} {{#required}} * @param {{paramName}}{{#description}} {{{.}}}{{/description}} @@ -42,30 +64,9 @@ type {{classname}}Service service @return {{{returnType}}} {{/returnType}} */ -{{#hasOptionalParams}} - -type {{{nickname}}}Opts struct { -{{#allParams}} -{{^required}} -{{#isPrimitiveType}} -{{^isBinary}} - {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}} -{{/isBinary}} -{{#isBinary}} - {{vendorExtensions.x-exportParamName}} optional.Interface -{{/isBinary}} -{{/isPrimitiveType}} -{{^isPrimitiveType}} - {{vendorExtensions.x-exportParamName}} optional.Interface -{{/isPrimitiveType}} -{{/required}} -{{/allParams}} -} - -{{/hasOptionalParams}} -func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) { var ( - localVarHttpMethod = http.Method{{httpMethod}} + localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -77,11 +78,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} // create path and map variables localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}} + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", {{paramName}})), -1){{/pathParams}} localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} {{#allParams}} {{#required}} {{#minItems}} @@ -132,35 +133,61 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{#hasQueryParams}} {{#queryParams}} {{#required}} + {{#isCollectionFormatMulti}} + t:={{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + {{/isCollectionFormatMulti}} {{/required}} {{^required}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() { + {{#isCollectionFormatMulti}} + t:=localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + {{/isCollectionFormatMulti}} } {{/required}} {{/queryParams}} {{/hasQueryParams}} // to determine the Content-Type header {{=<% %>=}} - localVarHttpContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} + localVarHTTPContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} <%={{ }}=%> // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header {{=<% %>=}} - localVarHttpHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} + localVarHTTPHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} <%={{ }}=%> // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } {{#hasHeaderParams}} {{#headerParams}} @@ -192,7 +219,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} } {{/required}} if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -267,56 +294,56 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{/isKeyInCookie}} {{/isApiKey}} {{/authMethods}} - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } {{#responses}} {{#dataType}} - if localVarHttpResponse.StatusCode == {{{code}}} { + if localVarHTTPResponse.StatusCode == {{{code}}} { var v {{{dataType}}} - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } newErr.model = v - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } {{/dataType}} {{/responses}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } {{#returnType}} - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } {{/returnType}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, nil } {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 1c4241ff043b..c3af45341201 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -164,7 +164,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } -// Change base path to allow switching to mocks +// ChangeBasePath changes base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } diff --git a/modules/openapi-generator/src/main/resources/go/configuration.mustache b/modules/openapi-generator/src/main/resources/go/configuration.mustache index 81d3a41b7bdf..98f9d8fee26f 100644 --- a/modules/openapi-generator/src/main/resources/go/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go/configuration.mustache @@ -41,6 +41,7 @@ type APIKey struct { Prefix string } +// Configuration stores the configuration of the API client type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` @@ -50,6 +51,7 @@ type Configuration struct { HTTPClient *http.Client } +// NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "{{{basePath}}}", @@ -59,6 +61,7 @@ func NewConfiguration() *Configuration { return cfg } +// AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } diff --git a/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/go/go.mod.mustache b/modules/openapi-generator/src/main/resources/go/go.mod.mustache index ec4310dd5932..e02a1be201ba 100644 --- a/modules/openapi-generator/src/main/resources/go/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go/go.mod.mustache @@ -1,4 +1,4 @@ -module github.com/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}} +module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}} require ( github.com/antihax/optional v0.0.0-20180406194304-ca021399b1a6 diff --git a/modules/openapi-generator/src/main/resources/go/model.mustache b/modules/openapi-generator/src/main/resources/go/model.mustache index 1a9f8d1c5aaf..72359c5700c3 100644 --- a/modules/openapi-generator/src/main/resources/go/model.mustache +++ b/modules/openapi-generator/src/main/resources/go/model.mustache @@ -12,9 +12,7 @@ import ( {{/imports}} {{#model}} {{#isEnum}} -{{#description}} -// {{{classname}}} : {{{description}}} -{{/description}} +// {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} // List of {{{name}}} @@ -23,11 +21,13 @@ const ( {{#enumVars}} {{^-first}} {{/-first}} - {{name}} {{{classname}}} = "{{{value}}}" + {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = "{{{value}}}" {{/enumVars}} {{/allowableValues}} -){{/isEnum}}{{^isEnum}}{{#description}} -// {{{description}}}{{/description}} +) +{{/isEnum}} +{{^isEnum}} +// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} type {{classname}} struct { {{#vars}} {{^-first}} diff --git a/modules/openapi-generator/src/main/resources/go/response.mustache b/modules/openapi-generator/src/main/resources/go/response.mustache index e15d7e6a7835..1a8765bae8f1 100644 --- a/modules/openapi-generator/src/main/resources/go/response.mustache +++ b/modules/openapi-generator/src/main/resources/go/response.mustache @@ -5,6 +5,7 @@ import ( "net/http" ) +// APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` @@ -22,12 +23,14 @@ type APIResponse struct { Payload []byte `json:"-"` } +// NewAPIResponse returns a new APIResonse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache index 981cdc6ac281..d0698f18fecd 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache @@ -48,9 +48,9 @@ library , deepseq >= 1.4 && <1.6 , exceptions >= 0.4 , http-api-data >= 0.3.4 && <0.5 - , http-client >=0.5 && <0.6 + , http-client >=0.5 && <0.7 , http-client-tls - , http-media >= 0.4 && < 0.8 + , http-media >= 0.4 && < 0.9 , http-types >=0.8 && <0.13 , iso8601-time >=0.1.3 && <0.2.0 , microlens >= 0.4.3 && <0.5 diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache index f1bb05947c87..ef3c63b223ee 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache @@ -1,8 +1,8 @@ -resolver: lts-13.9 +resolver: lts-14.3 build: haddock-arguments: haddock-args: - "--odir=./docs" -extra-deps: [ katip-0.8.0.0 ] +extra-deps: [ katip-0.8.3.0 ] packages: - '.' 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 8938a5ad3f3a..d11a2ce7c898 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 @@ -16,8 +16,8 @@ 1.8 UTF-8 0.1.1 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 1.7.21 0.5.2 4.5.3 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache index b3d790c19ca4..725ac257c096 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache @@ -2,11 +2,17 @@ ## Requires +{{#jvm}} * Kotlin 1.3.41 * Gradle 4.9 +{{/jvm}} +{{#multiplatform}} +* Kotlin 1.3.50 +{{/multiplatform}} ## Build +{{#jvm}} First, create the gradle wrapper script: ``` @@ -15,6 +21,7 @@ gradle wrapper Then, run: +{{/jvm}} ``` ./gradlew check assemble ``` @@ -26,7 +33,7 @@ This runs all tests and packages the library. * 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. +{{#jvm}}* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.{{/jvm}} {{#generateApiDocs}} 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 6a38138788e9..9ee04616e1db 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache @@ -44,8 +44,8 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base return when (response.responseType) { ResponseType.Success -> {{#returnType}}(response as Success<*>).data as {{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 d288470ca886..09ccc14758c3 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 @@ -54,7 +54,29 @@ Name | Type | Description | Notes ### Authorization -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} +{{^authMethods}}No authorization required{{/authMethods}} +{{#authMethods}} +{{#isApiKey}} +Configure {{name}}: + ApiClient.apiKey["{{keyParamName}}"] = "" + ApiClient.apiKeyPrefix["{{keyParamName}}"] = "" +{{/isApiKey}} +{{#isBasic}} +{{^isBasicBearer}} +Configure {{name}}: + ApiClient.username = "" + ApiClient.password = "" +{{/isBasicBearer}} +{{#isBasicBearer}} +Configure {{name}}: + ApiClient.accessToken = "" +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}} +Configure {{name}}: + ApiClient.accessToken = "" +{{/isOAuth}} +{{/authMethods}} ### HTTP request headers 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 05954bb78a60..e735dc05a205 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 @@ -32,6 +32,9 @@ 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" + {{#gson}} + implementation "com.google.code.gson:gson:2.8.5" + {{/gson}} compile "com.squareup.okhttp3:okhttp:4.0.1" {{#threetenbp}} compile "org.threeten:threetenbp:1.3.8" diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index 35b32bc12aab..0cece22bb0b7 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -1,35 +1,64 @@ +{{#jvm}} +{{#gson}} +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} import com.squareup.moshi.Json +{{/moshi}} {{#parcelizeModels}} import android.os.Parcelable import kotlinx.android.parcel.Parcelize {{/parcelizeModels}} +{{/jvm}} +{{#multiplatform}} +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +{{/multiplatform}} /** * {{{description}}} {{#vars}} - * @param {{name}} {{{description}}} + * @param {{{vendorExtensions.x-escapedName}}} {{{description}}} {{/vars}} */ {{#parcelizeModels}} @Parcelize {{/parcelizeModels}} +{{#multiplatform}}@Serializable{{/multiplatform}} data class {{classname}} ( {{#requiredVars}} {{>data_class_req_var}}{{^-last}}, {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, {{/-last}}{{/optionalVars}} -){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} { -{{#hasEnums}}{{#vars}}{{#isEnum}} +){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} +{{#hasEnums}} +{ +{{#vars}}{{#isEnum}} /** * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ + {{#multiplatform}}@Serializable(with = {{nameInCamelCase}}.Serializer::class){{/multiplatform}} enum class {{{nameInCamelCase}}}(val value: {{#isListContainer}}{{{ nestedType }}}{{/isListContainer}}{{^isListContainer}}{{{dataType}}}{{/isListContainer}}){ {{#allowableValues}}{{#enumVars}} - @Json(name = {{{value}}}) + {{#jvm}} + {{#moshi}} + @Json(name = {{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/moshi}} + {{#gson}} + @SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/gson}} + {{/jvm}} + {{#multiplatform}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/multiplatform}} {{/enumVars}}{{/allowableValues}} + + {{#multiplatform}} + object Serializer : CommonEnumSerializer<{{nameInCamelCase}}>("{{nameInCamelCase}}", values(), values().map { it.value }.toTypedArray()) + {{/multiplatform}} } -{{/isEnum}}{{/vars}}{{/hasEnums}} +{{/isEnum}}{{/vars}} } +{{/hasEnums}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache index 03cbd718c34a..e77b8b2b2bac 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache @@ -1,5 +1,12 @@ {{#description}} /* {{{description}}} */ {{/description}} + {{#jvm}} + {{#moshi}} @Json(name = "{{{baseName}}}") - val {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file + {{/moshi}} + {{#gson}} + @SerializedName("{{name}}") + {{/gson}} + {{/jvm}} + {{#multiplatform}}@SerialName(value = "{{name}}") {{/multiplatform}}val {{{vendorExtensions.x-escapedName}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache index 6682bc8170c7..0097d0702a9f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache @@ -1,5 +1,12 @@ {{#description}} /* {{{description}}} */ {{/description}} + {{#jvm}} + {{#moshi}} @Json(name = "{{{baseName}}}") - val {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file + {{/moshi}} + {{#gson}} + @SerializedName("{{name}}") + {{/gson}} + {{/jvm}} + {{#multiplatform}}@SerialName(value = "{{name}}") @Required {{/multiplatform}}val {{{vendorExtensions.x-escapedName}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache index 80b040f6b7c0..ccf8eb0c89f6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache @@ -1,13 +1,32 @@ +{{#jvm}} +{{#gson}} +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} import com.squareup.moshi.Json +{{/moshi}} +{{/jvm}} +{{#multiplatform}} +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +{{/multiplatform}} /** * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ +{{#multiplatform}}@Serializable(with = {{classname}}.Serializer::class){{/multiplatform}} enum class {{classname}}(val value: {{{dataType}}}){ {{#allowableValues}}{{#enumVars}} + {{#jvm}} + {{#moshi}} @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) + {{/gson}} + {{/jvm}} {{#isListContainer}} {{#isList}} {{&name}}(listOf({{{value}}})){{^-last}},{{/-last}}{{#-last}};{{/-last}} @@ -21,4 +40,8 @@ enum class {{classname}}(val value: {{{dataType}}}){ {{/isListContainer}} {{/enumVars}}{{/allowableValues}} + +{{#multiplatform}} + object Serializer : CommonEnumSerializer<{{classname}}>("{{classname}}", values(), values().map { it.value }.toTypedArray()) +{{/multiplatform}} } 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 0a42ce534d3d..6123c8b01b14 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 @@ -12,9 +12,12 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } -fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { +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.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache similarity index 67% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache index 20a0e6a54f7b..e57a0addfd46 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache @@ -15,11 +15,18 @@ 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() @@ -46,9 +53,9 @@ open class ApiClient(val baseUrl: String) { mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") } protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { @@ -61,12 +68,67 @@ open class ApiClient(val baseUrl: String) { } return when(mediaType) { JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> TODO("responseBody currently only supports JSON body.") + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + {{#hasAuthMethods}} + protected fun updateAuthParams(requestConfig: RequestConfig) { + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInHeader}} + if (requestConfig.headers["{{keyParamName}}"].isNullOrEmpty()) { + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (requestConfig.query["{{keyParamName}}"].isNullOrEmpty()) { + {{/isKeyInQuery}} + if (apiKey["{{keyParamName}}"] != null) { + if (apiKeyPrefix["{{keyParamName}}"] != null) { + {{#isKeyInHeader}} + requestConfig.headers["{{keyParamName}}"] = apiKeyPrefix["{{keyParamName}}"]!! + " " + apiKey["{{keyParamName}}"]!! + {{/isKeyInHeader}} + {{#isKeyInQuery}} + requestConfig.query["{{keyParamName}}"] = apiKeyPrefix["{{keyParamName}}"]!! + " " + apiKey["{{keyParamName}}"]!! + {{/isKeyInQuery}} + } else { + {{#isKeyInHeader}} + requestConfig.headers["{{keyParamName}}"] = apiKey["{{keyParamName}}"]!! + {{/isKeyInHeader}} + {{#isKeyInQuery}} + requestConfig.query["{{keyParamName}}"] = apiKey["{{keyParamName}}"]!! + {{/isKeyInQuery}} + } + } + } + {{/isApiKey}} + {{#isBasic}} + {{^isBasicBearer}} + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + requestConfig.headers[Authorization] = Credentials.basic(username, password) + } + {{/isBasicBearer}} + {{#isBasicBearer}} + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + requestConfig.headers[Authorization] = "Bearer " + accessToken } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + requestConfig.headers[Authorization] = "Bearer " + accessToken + } + {{/isOAuth}} + {{/authMethods}} } + {{/hasAuthMethods}} protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + {{#hasAuthMethods}} + + // take authMethod from operation + updateAuthParams(requestConfig) + {{/hasAuthMethods}} val url = httpUrl.newBuilder() .addPathSegments(requestConfig.path.trimStart('/')) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiInfrastructureResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiInfrastructureResponse.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiInfrastructureResponse.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiInfrastructureResponse.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApplicationDelegates.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApplicationDelegates.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApplicationDelegates.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApplicationDelegates.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ByteArrayAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ByteArrayAdapter.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ByteArrayAdapter.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ByteArrayAdapter.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/Errors.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Errors.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/Errors.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Errors.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/LocalDateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateAdapter.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/LocalDateAdapter.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateAdapter.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/LocalDateTimeAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateTimeAdapter.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/LocalDateTimeAdapter.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/LocalDateTimeAdapter.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ResponseExtensions.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ResponseExtensions.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ResponseExtensions.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ResponseExtensions.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Serializer.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/Serializer.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/Serializer.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/UUIDAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/UUIDAdapter.kt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/UUIDAdapter.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/UUIDAdapter.kt.mustache diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache new file mode 100644 index 000000000000..bab78f865b07 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -0,0 +1,122 @@ +{{>licenseInfo}} +package {{apiPackage}} + +{{#imports}}import {{import}} +{{/imports}} + +import {{packageName}}.infrastructure.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +{{#operations}} +class {{classname}} @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "{{{basePath}}}", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "{{{basePath}}}", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + {{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + {{#returnType}} + @Suppress("UNCHECKED_CAST") + {{/returnType}} + suspend fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : HttpResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { + + val localVariableBody = {{#hasBodyParam}}{{#bodyParam}}{{#isListContainer}}{{operationIdCamelCase}}Request({{paramName}}.asList()){{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{operationIdCamelCase}}Request({{paramName}}){{/isMapContainer}}{{^isMapContainer}}{{paramName}}{{/isMapContainer}}{{/isListContainer}}{{/bodyParam}}{{/hasBodyParam}} + {{^hasBodyParam}} + {{#hasFormParams}} + {{#isMultipart}} + formData { + {{#formParams}} + {{paramName}}?.apply { append("{{{baseName}}}", {{paramName}}) } + {{/formParams}} + } + {{/isMultipart}} + {{^isMultipart}} + ParametersBuilder().also { + {{#formParams}} + {{paramName}}?.apply { it.append("{{{baseName}}}", {{paramName}}.toString()) } + {{/formParams}} + }.build() + {{/isMultipart}} + {{/hasFormParams}} + {{^hasFormParams}} + io.ktor.client.utils.EmptyContent + {{/hasFormParams}} + {{/hasBodyParam}} + + val localVariableQuery = mutableMapOf>() + {{#queryParams}} + {{paramName}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}} } + {{/queryParams}} + + val localVariableHeaders = mutableMapOf() + {{#headerParams}} + {{paramName}}?.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } + {{/headerParams}} + + val localVariableConfig = RequestConfig( + RequestMethod.{{httpMethod}}, + "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}}, + query = localVariableQuery, + headers = localVariableHeaders + ) + + return {{#hasBodyParam}}jsonRequest{{/hasBodyParam}}{{^hasBodyParam}}{{#hasFormParams}}{{#isMultipart}}multipartFormRequest{{/isMultipart}}{{^isMultipart}}urlEncodedFormRequest{{/isMultipart}}{{/hasFormParams}}{{^hasFormParams}}request{{/hasFormParams}}{{/hasBodyParam}}( + localVariableConfig, + localVariableBody + ).{{#isListContainer}}wrap<{{operationIdCamelCase}}Response>().map { value.toTypedArray() }{{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}wrap<{{operationIdCamelCase}}Response>().map { value }{{/isMapContainer}}{{^isMapContainer}}wrap(){{/isMapContainer}}{{/isListContainer}} + } + + {{#hasBodyParam}} + {{#bodyParam}} + {{#isListContainer}}{{>serial_wrapper_request_list}}{{/isListContainer}}{{#isMapContainer}}{{>serial_wrapper_request_map}}{{/isMapContainer}} + {{/bodyParam}} + {{/hasBodyParam}} + {{#isListContainer}} + {{>serial_wrapper_response_list}} + {{/isListContainer}} + {{#isMapContainer}} + {{>serial_wrapper_response_map}} + {{/isMapContainer}} + + {{/operation}} + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + {{#operation}} + {{#hasBodyParam}} + {{#bodyParam}} + {{#isListContainer}}serializer.setMapper({{operationIdCamelCase}}Request::class, {{operationIdCamelCase}}Request.serializer()){{/isListContainer}}{{#isMapContainer}}serializer.setMapper({{operationIdCamelCase}}Request::class, {{operationIdCamelCase}}Request.serializer()){{/isMapContainer}} + {{/bodyParam}} + {{/hasBodyParam}} + {{#isListContainer}} + serializer.setMapper({{operationIdCamelCase}}Response::class, {{operationIdCamelCase}}Response.serializer()) + {{/isListContainer}} + {{#isMapContainer}} + serializer.setMapper({{operationIdCamelCase}}Response::class, {{operationIdCamelCase}}Response.serializer()) + {{/isMapContainer}} + {{/operation}} + } + } +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.mustache new file mode 100644 index 000000000000..1e309cc464a4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.mustache @@ -0,0 +1,138 @@ +apply plugin: 'kotlin-multiplatform' +apply plugin: 'kotlinx-serialization' + +group '{{groupId}}' +version '{{artifactVersion}}' + +ext { + kotlin_version = '1.3.50' + kotlinx_version = '1.1.0' + coroutines_version = '1.3.1' + serialization_version = '0.12.0' + ktor_version = '1.2.4' +} + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50" // $kotlin_version + classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.50" // $kotlin_version + } +} + +repositories { + jcenter() +} + +kotlin { + jvm() + iosArm64() { binaries { framework { freeCompilerArgs.add("-Xobjc-generics") } } } + iosX64() { binaries { framework { freeCompilerArgs.add("-Xobjc-generics") } } } + + sourceSets { + commonMain { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version" + implementation "io.ktor:ktor-client-core:$ktor_version" + implementation "io.ktor:ktor-client-json:$ktor_version" + implementation "io.ktor:ktor-client-serialization:$ktor_version" + } + } + + commonTest { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-test-common" + implementation "org.jetbrains.kotlin:kotlin-test-annotations-common" + implementation "io.ktor:ktor-client-mock:$ktor_version" + } + } + + jvmMain { + dependsOn commonMain + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version" + implementation "io.ktor:ktor-client-core-jvm:$ktor_version" + implementation "io.ktor:ktor-client-json-jvm:$ktor_version" + implementation "io.ktor:ktor-client-serialization-jvm:$ktor_version" + } + } + + jvmTest { + dependsOn commonTest + dependencies { + implementation "org.jetbrains.kotlin:kotlin-test" + implementation "org.jetbrains.kotlin:kotlin-test-junit" + implementation "io.ktor:ktor-client-mock-jvm:$ktor_version" + } + } + + iosMain { + dependsOn commonMain + dependencies { + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version" + implementation "io.ktor:ktor-client-ios:$ktor_version" + } + } + + iosTest { + dependsOn commonTest + dependencies { + implementation "io.ktor:ktor-client-mock-native:$ktor_version" + } + } + + iosArm64().compilations.main.defaultSourceSet { + dependsOn iosMain + dependencies { + implementation "io.ktor:ktor-client-ios-iosarm64:$ktor_version" + implementation "io.ktor:ktor-client-json-iosarm64:$ktor_version" + implementation "io.ktor:ktor-client-serialization-iosarm64:$ktor_version" + } + } + + iosArm64().compilations.test.defaultSourceSet { + dependsOn iosTest + } + + iosX64().compilations.main.defaultSourceSet { + dependsOn iosMain + dependencies { + implementation "io.ktor:ktor-client-ios-iosx64:$ktor_version" + implementation "io.ktor:ktor-client-json-iosx64:$ktor_version" + implementation "io.ktor:ktor-client-serialization-iosx64:$ktor_version" + } + } + + iosX64().compilations.test.defaultSourceSet { + dependsOn iosTest + } + + all { + languageSettings { + useExperimentalAnnotation('kotlin.Experimental') + } + } + } +} + +task iosTest { + def device = project.findProperty("device")?.toString() ?: "iPhone 8" + dependsOn 'linkDebugTestIosX64' + group = JavaBasePlugin.VERIFICATION_GROUP + description = "Execute unit tests on ${device} simulator" + doLast { + def binary = kotlin.targets.iosX64.binaries.getTest('DEBUG') + exec { commandLine 'xcrun', 'simctl', 'spawn', device, binary.outputFile } + } +} + +configurations { // workaround for https://youtrack.jetbrains.com/issue/KT-27170 + compileClasspath +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/commonTest/coroutine.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/commonTest/coroutine.mustache new file mode 100644 index 000000000000..c3bd8b18461c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/commonTest/coroutine.mustache @@ -0,0 +1,13 @@ +{{>licenseInfo}} + +package util + +import kotlinx.coroutines.CoroutineScope + +/** +* Block the current thread until execution of the given coroutine is complete. +* +* @param block The coroutine code. +* @return The result of the coroutine. +*/ +internal expect fun runTest(block: suspend CoroutineScope.() -> T): T diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradle-wrapper.jar new file mode 100644 index 000000000000..2c6137b87896 Binary files /dev/null and b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradle-wrapper.jar differ diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradle-wrapper.properties.mustache new file mode 100644 index 000000000000..ce3ca77db54b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradle-wrapper.properties.mustache @@ -0,0 +1,6 @@ +#Tue May 17 23:08:05 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradlew.bat.mustache new file mode 100644 index 000000000000..5f192121eb4f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradlew.bat.mustache @@ -0,0 +1,90 @@ +@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 + +@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= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@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 +if "%@eval[2+2]" == "4" goto 4NT_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=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +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/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradlew.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradlew.mustache new file mode 100755 index 000000000000..9d82f7891513 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/gradlew.mustache @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# 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 + +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" ] ; 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, switch paths to Windows format before running java +if $cygwin ; 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=$((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 + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache new file mode 100644 index 000000000000..fdb83114b7b7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache @@ -0,0 +1,122 @@ +package {{packageName}}.infrastructure + +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.call.call +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.JsonFeature +import io.ktor.client.features.json.JsonSerializer +import io.ktor.client.features.json.serializer.KotlinxSerializer +import io.ktor.client.request.accept +import io.ktor.client.request.forms.FormDataContent +import io.ktor.client.request.forms.MultiPartFormDataContent +import io.ktor.client.request.header +import io.ktor.client.request.parameter +import io.ktor.client.response.HttpResponse +import io.ktor.client.utils.EmptyContent +import io.ktor.http.* +import io.ktor.http.content.OutgoingContent +import io.ktor.http.content.PartData +import kotlinx.serialization.UnstableDefault +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration + +import {{apiPackage}}.* +import {{modelPackage}}.* + +open class ApiClient( + private val baseUrl: String, + httpClientEngine: HttpClientEngine?, + serializer: KotlinxSerializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: String, + httpClientEngine: HttpClientEngine?, + jsonConfiguration: JsonConfiguration) : + this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + private val serializer: JsonSerializer by lazy { + serializer.apply { setMappers(this) }.ignoreOutgoingContent() + } + + private val client: HttpClient by lazy { + val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } + val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } + httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) + } + + companion object { + protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) + + private fun setMappers(serializer: KotlinxSerializer) { + {{#apiInfo}}{{#apis}} + {{classname}}.setMappers(serializer) + {{/apis}}{{/apiInfo}} + {{#models}} + {{#model}}{{^isAlias}}serializer.setMapper({{classname}}::class, {{classname}}.serializer()){{/isAlias}}{{/model}} + {{/models}} + } + } + + protected suspend fun multipartFormRequest(requestConfig: RequestConfig, body: List?): HttpResponse { + return request(requestConfig, MultiPartFormDataContent(body ?: listOf())) + } + + protected suspend fun urlEncodedFormRequest(requestConfig: RequestConfig, body: Parameters?): HttpResponse { + return request(requestConfig, FormDataContent(body ?: Parameters.Empty)) + } + + protected suspend fun jsonRequest(requestConfig: RequestConfig, body: Any? = null): HttpResponse { + val contentType = (requestConfig.headers[HttpHeaders.ContentType]?.let { ContentType.parse(it) } + ?: ContentType.Application.Json) + return if (body != null) request(requestConfig, serializer.write(body, contentType)) + else request(requestConfig) + } + + protected suspend fun request(requestConfig: RequestConfig, body: OutgoingContent = EmptyContent): HttpResponse { + val headers = requestConfig.headers + + return client.call { + this.url { + this.takeFrom(URLBuilder(baseUrl)) + appendPath(requestConfig.path.trimStart('/').split('/')) + requestConfig.query.forEach { query -> + query.value.forEach { value -> + parameter(query.key, value) + } + } + } + this.method = requestConfig.method.httpMethod + headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + this.body = body + + }.response + } + + private fun URLBuilder.appendPath(components: List): URLBuilder = apply { + encodedPath = encodedPath.trimEnd('/') + components.joinToString("/", prefix = "/") { it.encodeURLQueryComponent() } + } + + private val RequestMethod.httpMethod: HttpMethod + get() = when (this) { + RequestMethod.DELETE -> HttpMethod.Delete + RequestMethod.GET -> HttpMethod.Get + RequestMethod.HEAD -> HttpMethod.Head + RequestMethod.PATCH -> HttpMethod.Patch + RequestMethod.PUT -> HttpMethod.Put + RequestMethod.POST -> HttpMethod.Post + RequestMethod.OPTIONS -> HttpMethod.Options + } +} + +// https://github.com/ktorio/ktor/issues/851 +private fun JsonSerializer.ignoreOutgoingContent() = IgnoreOutgoingContentJsonSerializer(this) + +private class IgnoreOutgoingContentJsonSerializer(private val delegate: JsonSerializer) : JsonSerializer by delegate { + override fun write(data: Any): OutgoingContent { + if (data is OutgoingContent) return data + return delegate.write(data) + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/HttpResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/HttpResponse.kt.mustache new file mode 100644 index 000000000000..6bf43085b735 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/HttpResponse.kt.mustache @@ -0,0 +1,51 @@ +package {{packageName}}.infrastructure + +import io.ktor.client.call.TypeInfo +import io.ktor.client.call.typeInfo +import io.ktor.http.Headers +import io.ktor.http.isSuccess + +open class HttpResponse(val response: io.ktor.client.response.HttpResponse, val provider: BodyProvider) { + val status: Int = response.status.value + val success: Boolean = response.status.isSuccess() + val headers: Map> = response.headers.mapEntries() + suspend fun body(): T = provider.body(response) + suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type) + + companion object { + private fun Headers.mapEntries(): Map> { + val result = mutableMapOf>() + entries().forEach { result[it.key] = it.value } + return result + } + } +} + +interface BodyProvider { + suspend fun body(response: io.ktor.client.response.HttpResponse): T + suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V +} + +class TypedBodyProvider(private val type: TypeInfo) : BodyProvider { + @Suppress("UNCHECKED_CAST") + override suspend fun body(response: io.ktor.client.response.HttpResponse): T = + response.call.receive(type) as T + + @Suppress("UNCHECKED_CAST") + override suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V = + response.call.receive(type) as V +} + +class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider { + override suspend fun body(response: io.ktor.client.response.HttpResponse): T = + block(provider.body(response)) + + override suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V = + provider.typedBody(response, type) +} + +inline fun io.ktor.client.response.HttpResponse.wrap(): HttpResponse = + HttpResponse(this, TypedBodyProvider(typeInfo())) + +fun HttpResponse.map(block: T.() -> V): HttpResponse = + HttpResponse(response, MappedBodyProvider(provider, block)) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/iosTest/coroutine.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/iosTest/coroutine.mustache new file mode 100644 index 000000000000..351c0120b7b1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/iosTest/coroutine.mustache @@ -0,0 +1,8 @@ +{{>licenseInfo}} + +package util + +import kotlinx.coroutines.CoroutineScope +import kotlin.coroutines.EmptyCoroutineContext + +internal actual fun runTest(block: suspend CoroutineScope.() -> T): T = kotlinx.coroutines.runBlocking(EmptyCoroutineContext, block) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/jvmTest/coroutine.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/jvmTest/coroutine.mustache new file mode 100644 index 000000000000..351c0120b7b1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/jvmTest/coroutine.mustache @@ -0,0 +1,8 @@ +{{>licenseInfo}} + +package util + +import kotlinx.coroutines.CoroutineScope +import kotlin.coroutines.EmptyCoroutineContext + +internal actual fun runTest(block: suspend CoroutineScope.() -> T): T = kotlinx.coroutines.runBlocking(EmptyCoroutineContext, block) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_request_list.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_request_list.mustache new file mode 100644 index 000000000000..1e240683b80a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_request_list.mustache @@ -0,0 +1,10 @@ +@Serializable +private class {{operationIdCamelCase}}Request(val value: List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>) { + @Serializer({{operationIdCamelCase}}Request::class) + companion object : KSerializer<{{operationIdCamelCase}}Request> { + private val serializer: KSerializer> = {{#bodyParam}}{{baseType}}{{/bodyParam}}.serializer().list + override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Request") + override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Request) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Request(serializer.deserialize(decoder)) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_request_map.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_request_map.mustache new file mode 100644 index 000000000000..7da90c9974b9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_request_map.mustache @@ -0,0 +1,10 @@ +@Serializable +private class {{operationIdCamelCase}}Request(val value: Map) { + @Serializer({{operationIdCamelCase}}Request::class) + companion object : KSerializer<{{operationIdCamelCase}}Request> { + private val serializer: KSerializer> = (kotlin.String.serializer() to {{#bodyParam}}{{baseType}}{{/bodyParam}}.serializer()).map + override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Request") + override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Request) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Request(serializer.deserialize(decoder)) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_response_list.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_response_list.mustache new file mode 100644 index 000000000000..91403ee50b4b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_response_list.mustache @@ -0,0 +1,10 @@ +@Serializable +private class {{operationIdCamelCase}}Response(val value: List<{{returnBaseType}}>) { + @Serializer({{operationIdCamelCase}}Response::class) + companion object : KSerializer<{{operationIdCamelCase}}Response> { + private val serializer: KSerializer> = {{returnBaseType}}.serializer().list + override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Response") + override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Response) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Response(serializer.deserialize(decoder)) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_response_map.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_response_map.mustache new file mode 100644 index 000000000000..730e0b672c5e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/serial_wrapper_response_map.mustache @@ -0,0 +1,10 @@ +@Serializable +private class {{operationIdCamelCase}}Response(val value: Map) { + @Serializer({{operationIdCamelCase}}Response::class) + companion object : KSerializer<{{operationIdCamelCase}}Response> { + private val serializer: KSerializer> = (kotlin.String.serializer() to {{returnBaseType}}.serializer()).map + override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Response") + override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Response) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Response(serializer.deserialize(decoder)) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache index 448dc07602e2..2a789fe8d043 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache @@ -1 +1,2 @@ +{{#multiplatform}}enableFeaturePreview('GRADLE_METADATA'){{/multiplatform}} rootProject.name = '{{artifactId}}' \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache new file mode 100644 index 000000000000..f4db05742d00 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/README.mustache @@ -0,0 +1,76 @@ +# {{packageName}} - Kotlin Server library for {{appName}} + +## Requires + +* Kotlin 1.3.10 +* Maven 3.3 + +## Build + +``` +mvn clean package +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs 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. + +{{#generateApiDocs}} + + ## Documentation for API Endpoints + + All URIs are relative to *{{{basePath}}}* + + Class | Method | HTTP request | Description + ------------ | ------------- | ------------- | ------------- + {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} + {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/generateApiDocs}} + +{{#generateModelDocs}} + + ## Documentation for Models + + {{#modelPackage}} + {{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) + {{/model}}{{/models}} + {{/modelPackage}} + {{^modelPackage}} + No model defined in this package + {{/modelPackage}} +{{/generateModelDocs}} + +{{! TODO: optional documentation for authorization? }} +## Documentation for Authorization + +{{^authMethods}} + All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} + {{#last}} + Authentication schemes defined for the API: + {{/last}} +{{/authMethods}} +{{#authMethods}} + + ### {{name}} + + {{#isApiKey}}- **Type**: API key + - **API key parameter name**: {{keyParamName}} + - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} + {{/isApiKey}} + {{#isBasic}}- **Type**: HTTP basic authentication + {{/isBasic}} + {{#isOAuth}}- **Type**: OAuth + - **Flow**: {{flow}} + - **Authorization URL**: {{authorizationUrl}} + - **Scopes**: {{^scopes}}N/A{{/scopes}} + {{#scopes}} - {{scope}}: {{description}} + {{/scopes}} + {{/isOAuth}} + +{{/authMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api.mustache new file mode 100644 index 000000000000..279271960743 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api.mustache @@ -0,0 +1,53 @@ +package {{package}} + +{{#imports}}import {{import}} +{{/imports}} +import io.vertx.core.Vertx +import io.vertx.core.json.JsonObject +import io.vertx.core.json.JsonArray +import com.github.wooyme.openapi.Response +import io.vertx.ext.web.api.OperationRequest +import io.vertx.kotlin.ext.web.api.contract.openapi3.OpenAPI3RouterFactory +import io.vertx.serviceproxy.ServiceBinder +import io.vertx.ext.web.handler.CookieHandler +import io.vertx.ext.web.handler.SessionHandler +import io.vertx.ext.web.sstore.LocalSessionStore +import java.util.List +import java.util.Map + + +interface {{classname}} { + fun init(vertx:Vertx,config:JsonObject) +{{#operations}} + {{#operation}} + /* {{operationId}} + * {{summary}} */ + suspend fun {{operationId}}({{#allParams}}{{paramName}}:{{^isFile}}{{{dataType}}}{{/isFile}}{{#isFile}}kotlin.collections.List{{/isFile}}{{^isRequired}}?{{/isRequired}},{{/allParams}}context:OperationRequest):Response<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + {{/operation}} +{{/operations}} + companion object { + const val address = "{{classname}}-service" + suspend fun createRouterFactory(vertx: Vertx,path:String): io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory { + val routerFactory = OpenAPI3RouterFactory.createAwait(vertx,path) + routerFactory.addGlobalHandler(CookieHandler.create()) + routerFactory.addGlobalHandler(SessionHandler.create(LocalSessionStore.create(vertx))) + routerFactory.setExtraOperationContextPayloadMapper{ + JsonObject().put("files",JsonArray(it.fileUploads().map { it.uploadedFileName() })) + } + val opf = routerFactory::class.java.getDeclaredField("operations") + opf.isAccessible = true + val operations = opf.get(routerFactory) as Map + for (m in {{classname}}::class.java.methods) { + val methodName = m.name + val op = operations[methodName] + if (op != null) { + val method = op::class.java.getDeclaredMethod("mountRouteToService",String::class.java,String::class.java) + method.isAccessible = true + method.invoke(op,address,methodName) + } + } + routerFactory.mountServiceInterface({{classname}}::class.java, address) + return routerFactory + } + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache new file mode 100644 index 000000000000..8c6f81f1b43f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/apiProxy.mustache @@ -0,0 +1,179 @@ +package {{package}} + +import io.vertx.core.Vertx +import io.vertx.core.eventbus.Message +import io.vertx.core.json.JsonObject +import io.vertx.ext.web.api.OperationRequest +import io.vertx.ext.web.api.OperationResponse +import io.vertx.ext.web.api.generator.ApiHandlerUtils +import io.vertx.serviceproxy.ProxyHandler +import io.vertx.serviceproxy.ServiceException +import io.vertx.serviceproxy.ServiceExceptionMessageCodec +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.vertx.kotlin.coroutines.dispatcher +import io.vertx.core.json.Json +import io.vertx.core.json.JsonArray +import com.google.gson.reflect.TypeToken +import com.google.gson.Gson +{{#imports}}import {{import}} +{{/imports}} + +class {{classname}}VertxProxyHandler(private val vertx: Vertx, private val service: {{classname}}, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { + private val timerID: Long + private var lastAccessed: Long = 0 + init { + try { + this.vertx.eventBus().registerDefaultCodec(ServiceException::class.java, + ServiceExceptionMessageCodec()) + } catch (ex: IllegalStateException) {} + + if (timeoutSeconds != (-1).toLong() && !topLevel) { + var period = timeoutSeconds * 1000 / 2 + if (period > 10000) { + period = 10000 + } + this.timerID = vertx.setPeriodic(period) { this.checkTimedOut(it) } + } else { + this.timerID = -1 + } + accessed() + } + private fun checkTimedOut(id: Long) { + val now = System.nanoTime() + if (now - lastAccessed > timeoutSeconds * 1000000000) { + close() + } + } + + override fun close() { + if (timerID != (-1).toLong()) { + vertx.cancelTimer(timerID) + } + super.close() + } + + private fun accessed() { + this.lastAccessed = System.nanoTime() + } + override fun handle(msg: Message) { + try { + val json = msg.body() + val action = msg.headers().get("action") ?: throw IllegalStateException("action not specified") + accessed() + val contextSerialized = json.getJsonObject("context") ?: throw IllegalStateException("Received action $action without OperationRequest \"context\"") + val context = OperationRequest(contextSerialized) + when (action) { + {{#operations}}{{#operation}} + "{{#vendorExtensions}}{{operationId}}{{/vendorExtensions}}" -> { + {{#hasParams}} + val params = context.params + {{#allParams}} + {{#isListContainer}} + val {{paramName}}Param = ApiHandlerUtils.searchJsonArrayInJson(params,"{{#isBodyParam}}body{{/isBodyParam}}{{^isBodyParam}}{{baseName}}{{/isBodyParam}}") + {{#required}} + if({{paramName}}Param == null){ + throw IllegalArgumentException("{{paramName}} is required") + } + val {{paramName}}:{{{dataType}}} = Gson().fromJson({{paramName}}Param.encode() + , object : TypeToken>(){}.type) + {{/required}} + {{^required}} + val {{paramName}}:{{{dataType}}}? = if({{paramName}}Param == null) {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} + else Gson().fromJson({{paramName}}Param.encode(), + , object : TypeToken>(){}.type) + {{/required}} + {{/isListContainer}} + {{^isListContainer}} + {{#isFile}} + val {{paramName}}Param = context.extra.getJsonArray("files") + {{#required}} + if ({{paramName}}Param == null) { + throw IllegalArgumentException("{{paramName}} is required") + } + val {{paramName}} = {{paramName}}Param.map{ java.io.File(it as String) } + {{/required}} + {{^required}} + val {{paramName}} = {{paramName}}Param?.map{ java.io.File(it as String) } + {{/required}} + {{/isFile}} + {{#isPrimitiveType}} + {{#isString}} + val {{paramName}} = ApiHandlerUtils.searchStringInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isString}} + {{#isDate}} + val {{paramName}} = java.time.LocalDate.parse(ApiHandlerUtils.searchStringInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}")) + {{/isDate}} + {{#isDateTime}} + val {{paramName}} = java.time.LocalDateTime.parse(ApiHandlerUtils.searchStringInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}")) + {{/isDateTime}} + {{#isEmail}} + val {{paramName}} = ApiHandlerUtils.searchStringInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isEmail}} + {{#isUuid}} + val {{paramName}} = ApiHandlerUtils.searchStringInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isUuid}} + {{#isNumber}} + val {{paramName}} = ApiHandlerUtils.searchDoubleInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isNumber}} + {{#isLong}} + val {{paramName}} = ApiHandlerUtils.searchLongInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isLong}} + {{#isInteger}} + val {{paramName}} = ApiHandlerUtils.searchIntegerInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isInteger}} + {{#isFloat}} + val {{paramName}} = ApiHandlerUtils.searchDoubleInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}")?.toFloat() + {{/isFloat}} + {{#isDouble}} + val {{paramName}} = ApiHandlerUtils.searchDoubleInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isDouble}} + {{#isBoolean}} + val {{paramName}} = ApiHandlerUtils.searchStringInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}")?.toBoolean() + {{/isBoolean}} + {{#isFreeFormObject}} + val {{paramName}} = ApiHandlerUtils.searchJsonObjectInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{/isFreeFormObject}} + {{#required}} + if({{paramName}} == null){ + throw IllegalArgumentException("{{paramName}} is required") + } + {{/required}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + val {{paramName}}Param = ApiHandlerUtils.searchJsonObjectInJson(params,"{{^isBodyParam}}{{baseName}}{{/isBodyParam}}{{#isBodyParam}}body{{/isBodyParam}}") + {{#required}} + if ({{paramName}}Param == null) { + throw IllegalArgumentException("{{paramName}} is required") + } + val {{paramName}} = Gson().fromJson({{paramName}}Param.encode(), {{{dataType}}}::class.java) + {{/required}} + {{^required}} + val {{paramName}} = if({{paramName}}Param ==null) null else Gson().fromJson({{paramName}}Param.encode(), {{{dataType}}}::class.java) + {{/required}} + {{/isPrimitiveType}} + {{/isListContainer}} + {{/allParams}} + GlobalScope.launch(vertx.dispatcher()){ + val result = service.{{operationId}}({{#hasParams}}{{#allParams}}{{paramName}},{{/allParams}}{{/hasParams}}context) + {{#isListContainer}} + val payload = JsonArray(Json.encode(result.payload)).toBuffer() + {{/isListContainer}} + {{^isListContainer}} + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + {{/isListContainer}} + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + {{/hasParams}} + } + {{/operation}}{{/operations}} + } + }catch (t: Throwable) { + msg.reply(ServiceException(500, t.message)) + throw t + } + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache new file mode 100644 index 000000000000..5a41503df5b9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache @@ -0,0 +1,42 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{operationId}}** +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_verticle.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_verticle.mustache new file mode 100644 index 000000000000..c168d12e03a3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_verticle.mustache @@ -0,0 +1,19 @@ +package {{package}} +import io.vertx.core.Vertx +import io.vertx.core.AbstractVerticle +import io.vertx.serviceproxy.ServiceBinder + +fun main(){ + Vertx.vertx().deployVerticle({{classname}}Verticle()) +} + +class {{classname}}Verticle:AbstractVerticle() { + + override fun start() { + val instance = (javaClass.classLoader.loadClass("{{package}}.{{classname}}Impl").newInstance() as {{classname}}) + instance.init(vertx,config()) + ServiceBinder(vertx) + .setAddress({{classname}}.address) + .register({{classname}}::class.java,instance) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache new file mode 100644 index 000000000000..b363fc5a61f2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache @@ -0,0 +1,15 @@ +# {{classname}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#readOnly}} [readonly]{{/readOnly}} +{{/vars}} +{{#vars}}{{#isEnum}} + +{{!NOTE: see java's resources "pojo_doc.mustache" once enums are fully implemented}} +## Enum: {{baseName}} +Name | Value +---- | -----{{#allowableValues}} +{{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} +{{/isEnum}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache new file mode 100644 index 000000000000..d4c099d64ea7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache @@ -0,0 +1,42 @@ + +{{#parcelizeModels}} +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize +{{/parcelizeModels}} +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * {{{description}}} +{{#vars}} + * @param {{name}} {{{description}}} +{{/vars}} + */ +{{#parcelizeModels}} +@Parcelize +{{/parcelizeModels}} +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class {{classname}} ( +{{#requiredVars}} +{{>data_class_req_var}}{{^-last}}, +{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, +{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, +{{/-last}}{{/optionalVars}} +){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} { +{{#hasEnums}}{{#vars}}{{#isEnum}} + /** + * {{{description}}} + * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + */ + enum class {{nameInCamelCase}}(val value: {{dataType}}){ + {{#allowableValues}}{{#enumVars}} + {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/enumVars}}{{/allowableValues}} + } +{{/isEnum}}{{/vars}}{{/hasEnums}} + {{#requiredVars}} + var {{{name}}} get() = _{{{name}}} ?: throw IllegalArgumentException("{{{name}}} is required") + set(value){ _{{{name}}} = value } + {{/requiredVars}} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache new file mode 100644 index 000000000000..809b00758683 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache @@ -0,0 +1,4 @@ +{{#description}} + /* {{{description}}} */ +{{/description}} + var {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache new file mode 100644 index 000000000000..66ec56120bea --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache @@ -0,0 +1,4 @@ +{{#description}} + /* {{{description}}} */ +{{/description}} + @SerializedName("{{{name}}}") private var _{{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enumClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enumClass.mustache new file mode 100644 index 000000000000..0867107d9930 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enumClass.mustache @@ -0,0 +1,17 @@ + + public enum {{{datatypeWithEnum}}} { + {{#allowableValues}}{{#enumVars}}{{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private String value; + + {{{datatypeWithEnum}}}(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return value; + } + } diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enum_class.mustache new file mode 100644 index 000000000000..791398b97894 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enum_class.mustache @@ -0,0 +1,9 @@ +/** +* {{{description}}} +* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} +*/ +enum class {{classname}}(val value: {{dataType}}){ +{{#allowableValues}}{{#enumVars}} + {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} +{{/enumVars}}{{/allowableValues}} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enum_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enum_doc.mustache new file mode 100644 index 000000000000..fcb3d7e61aa6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/enum_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} + * `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/licenseInfo.mustache new file mode 100644 index 000000000000..3a547de74bb7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** +* {{{appName}}} +* {{{appDescription}}} +* +* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} +* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/model.mustache new file mode 100644 index 000000000000..74b63c00c6f5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/model.mustache @@ -0,0 +1,11 @@ +{{>licenseInfo}} +package {{modelPackage}} + +{{#imports}}import {{import}} +{{/imports}} + +{{#models}} + {{#model}} + {{#isEnum}}{{>enum_class}}{{/isEnum}}{{^isEnum}}{{>data_class}}{{/isEnum}} + {{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache new file mode 100644 index 000000000000..9ed4aa1b9605 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache @@ -0,0 +1,190 @@ + + 4.0.0 + + {{groupId}} + {{artifactId}} + {{artifactVersion}} + jar + + {{appName}} + + + UTF-8 + 1.8 + 1.3.10 + true + 4.12 + 3.4.1 + 3.8.1 + 1.0.2 + 2.3 + 2.7.4 + 3.6.0 + + + + + junit + junit + ${junit.version} + test + + + + io.vertx + vertx-unit + ${vertx.version} + test + + + + com.github.wooyme + vertx-openapi-router + ${vertx-openapi-router.version} + + + + com.google.code.gson + gson + 2.8.5 + + + + javax.annotation + javax.annotation-api + 1.2 + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlinx + kotlinx-coroutines-core + RELEASE + + + + io.vertx + vertx-core + ${vertx.version} + + + io.vertx + vertx-web + ${vertx.version} + + + + io.vertx + vertx-lang-kotlin + ${vertx.version} + + + + io.vertx + vertx-lang-kotlin-coroutines + ${vertx.version} + + + + io.swagger.parser.v3 + swagger-parser + 2.0.5 + + + + io.vertx + vertx-web-api-contract + ${vertx.version} + + + + io.vertx + vertx-service-proxy + ${vertx.version} + + + + io.vertx + vertx-web-api-service + ${vertx.version} + + + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + compile + + compile + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + 1.8 + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + ${project.basedir}/src/test/java + + 1.8 + + + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + package + + shade + + + + + + {{apiPackage}}.DefaultApiVerticleKt + + + + + ${project.build.directory}/${project.artifactId}-${project.version}-fat.jar + + + + + + + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/lua/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/lua/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/lua/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/lua/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/nim-client/README.mustache b/modules/openapi-generator/src/main/resources/nim-client/README.mustache new file mode 100644 index 000000000000..f879aee9e0a4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/README.mustache @@ -0,0 +1,43 @@ +# Nim API client for {{{appName}}} (Package: {{{packageName}}}) + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: {{{appVersion}}} +- Package version: {{{packageVersion}}} +{{^hideGenerationTimestamp}} + - Build date: {{{generatedDate}}} +{{/hideGenerationTimestamp}} +- Build package: {{{generatorClass}}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Installation + +Put the package under your project folder and add the following to the nimble file of your project: + +``` +import {{{packageName}}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Module | Proc | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{{classFilename}}} | {{{operationId}}} | **{{#lambda.uppercase}}{{{httpMethod}}}{{/lambda.uppercase}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +To generate documentation with Nim DocGen, use: + +``` +nim doc --project --index:on {{{packageName}}}.nim +``` + diff --git a/modules/openapi-generator/src/main/resources/nim-client/api.mustache b/modules/openapi-generator/src/main/resources/nim-client/api.mustache new file mode 100644 index 000000000000..1fcd06f7cfde --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/api.mustache @@ -0,0 +1,55 @@ +{{>header}} +import httpclient +import json +import logging +import marshal +import options +import strformat +import strutils +import tables +import typetraits +import uri + +{{#imports}}import ../models/{{import}} +{{/imports}} +{{#description}}# {{{description}}}{{/description}} +const basepath = "{{{basePath}}}" + +template constructResult[T](response: Response): untyped = + if response.code in {Http200, Http201, Http202, Http204, Http206}: + try: + when name(stripGenericParams(T.typedesc).typedesc) == name(Table): + (some(json.to(parseJson(response.body), T.typedesc)), response) + else: + (some(marshal.to[T](response.body)), response) + except JsonParsingError: + # The server returned a malformed response though the response code is 2XX + # TODO: need better error handling + error("JsonParsingError") + (none(T.typedesc), response) + else: + (none(T.typedesc), response) + +{{#operations}}{{#operation}} +proc {{{operationId}}}*(httpClient: HttpClient{{#allParams}}, {{{paramName}}}: {{#isString}}string{{/isString}}{{#isUuid}}string{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}{{/isContainer}}{{/isPrimitiveType}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isUuid}}{{/isString}}{{/allParams}}): {{^returnType}}Response{{/returnType}}{{#returnType}}(Option[{{{returnType}}}], Response){{/returnType}}{{#isDeprecated}} {.deprecated.}{{/isDeprecated}} = + ## {{{summary}}}{{#hasBodyParam}} + httpClient.headers["Content-Type"] = "application/json"{{/hasBodyParam}}{{#hasFormParams}}{{^isMultipart}} + httpClient.headers["Content-Type"] = "application/x-www-form-urlencoded"{{/isMultipart}}{{#isMultipart}} + httpClient.headers["Content-Type"] = "multipart/form-data"{{/isMultipart}}{{/hasFormParams}}{{#hasHeaderParams}}{{#headerParams}} + httpClient.headers["{{{baseName}}}"] = {{{paramName}}}{{#isListContainer}}.join(","){{/isListContainer}}{{/headerParams}}{{#description}} ## {{{description}}}{{/description}}{{/hasHeaderParams}}{{#hasQueryParams}} + let query_for_api_call = encodeQuery([{{#queryParams}} + ("{{{baseName}}}", ${{{paramName}}}{{#isListContainer}}.join(","){{/isListContainer}}), # {{{description}}}{{/queryParams}} + ]){{/hasQueryParams}}{{#hasFormParams}}{{^isMultipart}} + let query_for_api_call = encodeQuery([{{#formParams}} + ("{{{baseName}}}", ${{{paramName}}}{{#isListContainer}}.join(","){{/isListContainer}}), # {{{description}}}{{/formParams}} + ]){{/isMultipart}}{{#isMultipart}} + let query_for_api_call = newMultipartData({ +{{#formParams}} "{{{baseName}}}": ${{{paramName}}}{{#isListContainer}}.join(","){{/isListContainer}}, # {{{description}}} +{{/formParams}} + }){{/isMultipart}}{{/hasFormParams}}{{#returnType}} + + let response = httpClient.{{{httpMethod}}}(basepath & {{^pathParams}}"{{{path}}}"{{/pathParams}}{{#pathParams}}fmt"{{{path}}}"{{/pathParams}}{{#hasQueryParams}} & "?" & query_for_api_call{{/hasQueryParams}}{{#hasBodyParam}}{{#bodyParams}}, $(%{{{paramName}}}){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}, {{^isMultipart}}$query_for_api_call{{/isMultipart}}{{#isMultipart}}multipart=query_for_api_call{{/isMultipart}}{{/hasFormParams}}) + constructResult[{{{returnType}}}](response){{/returnType}}{{^returnType}} + httpClient.{{{httpMethod}}}(basepath & {{^pathParams}}"{{{path}}}"{{/pathParams}}{{#pathParams}}fmt"{{{path}}}"{{/pathParams}}{{#hasQueryParams}} & "?" & query_for_api_call{{/hasQueryParams}}{{#hasBodyParam}}{{#bodyParams}}, $(%{{{paramName}}}){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}, {{^isMultipart}}$query_for_api_call{{/isMultipart}}{{#isMultipart}}multipart=query_for_api_call{{/isMultipart}}{{/hasFormParams}}){{/returnType}} + +{{/operation}}{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/nim-client/config.mustache b/modules/openapi-generator/src/main/resources/nim-client/config.mustache new file mode 100644 index 000000000000..0bc5445daa31 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/config.mustache @@ -0,0 +1 @@ +const useragent* = "{{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{version}}}/nim"{{/httpUserAgent}} diff --git a/modules/openapi-generator/src/main/resources/nim-client/header.mustache b/modules/openapi-generator/src/main/resources/nim-client/header.mustache new file mode 100644 index 000000000000..6418a7495c4c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/header.mustache @@ -0,0 +1,8 @@ +#{{#appName}} +# {{{appName}}}{{/appName}} +# {{#appDescription}} +# {{{appDescription}}}{{/appDescription}} +# {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} +# {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +# Generated by: https://openapi-generator.tech +# diff --git a/modules/openapi-generator/src/main/resources/nim-client/lib.mustache b/modules/openapi-generator/src/main/resources/nim-client/lib.mustache new file mode 100644 index 000000000000..3876476cbf72 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/lib.mustache @@ -0,0 +1,11 @@ +{{>header}} +# Models +{{#models}}{{#model}}import {{packageName}}/models/{{classFilename}} +{{/model}}{{/models}}{{#models}} +{{#model}}export {{classFilename}}{{/model}}{{/models}} + +# APIs +{{#apiInfo}}{{#apis}}import {{packageName}}/apis/{{classFilename}} +{{/apis}}{{/apiInfo}}{{#apiInfo}} +{{#apis}}export {{classFilename}} +{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/nim-client/model.mustache b/modules/openapi-generator/src/main/resources/nim-client/model.mustache new file mode 100644 index 000000000000..9595469d3fd1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/model.mustache @@ -0,0 +1,23 @@ +{{>header}} +import json +import tables + +{{#imports}}import {{import}} +{{/imports}}{{#models}}{{#model}}{{#vars}}{{#isEnum}} +type {{{enumName}}}* {.pure.} = enum{{#allowableValues}}{{#enumVars}} + {{{name}}}{{/enumVars}}{{/allowableValues}} +{{/isEnum}}{{/vars}} +type {{{classname}}}* = object + ## {{{description}}}{{#vars}} + {{{name}}}*: {{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#description}} ## {{{description}}}{{/description}}{{/vars}} +{{#vars}}{{#isEnum}} +func `%`*(v: {{{enumName}}}): JsonNode = + let str = case v:{{#allowableValues}}{{#enumVars}} + of {{{enumName}}}.{{{name}}}: {{{value}}}{{/enumVars}}{{/allowableValues}} + + JsonNode(kind: JString, str: str) + +func `$`*(v: {{{enumName}}}): string = + result = case v:{{#allowableValues}}{{#enumVars}} + of {{{enumName}}}.{{{name}}}: {{{value}}}{{/enumVars}}{{/allowableValues}} +{{/isEnum}}{{/vars}}{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/nim-client/sample_client.mustache b/modules/openapi-generator/src/main/resources/nim-client/sample_client.mustache new file mode 100644 index 000000000000..9504d5c0db67 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nim-client/sample_client.mustache @@ -0,0 +1,14 @@ +{{>header}} +import httpclient +import logging +import options + +import {{{packageName}}} + +import config + +let logger = newConsoleLogger() +addHandler(logger) + +let client = newHttpClient() +client.headers["User-Agent"] = config.useragent diff --git a/modules/openapi-generator/src/main/resources/objc/README.mustache b/modules/openapi-generator/src/main/resources/objc/README.mustache index d516140f735b..e353062783e7 100644 --- a/modules/openapi-generator/src/main/resources/objc/README.mustache +++ b/modules/openapi-generator/src/main/resources/objc/README.mustache @@ -26,7 +26,7 @@ The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.c Add the following to the Podfile: ```ruby -pod '{{podName}}', :git => 'https://github.com/{{gitUserId}}/{{gitRepoId}}.git' +pod '{{podName}}', :git => 'https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git' ``` To specify a particular branch, append `, :branch => 'branch-name-here'` diff --git a/modules/openapi-generator/src/main/resources/objc/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/objc/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100644 --- a/modules/openapi-generator/src/main/resources/objc/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/objc/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/perl/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/perl/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/perl/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/perl/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache b/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache index cf4230d3c7f2..c8b27057bb92 100644 --- a/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim-server/SlimRouter.mustache @@ -71,18 +71,29 @@ class SlimRouter {{#hasAuthMethods}} {{#authMethods}} // {{type}} security schema named '{{name}}' - {{#isBasic}} + {{#isBasicBasic}} [ 'type' => '{{type}}', 'isBasic' => true, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => false, ], - {{/isBasic}} + {{/isBasicBasic}} + {{#isBasicBearer}} + [ + 'type' => '{{type}}', + 'isBasic' => true, + 'isBearer' => true, + 'isApiKey' => false, + 'isOAuth' => false, + ], + {{/isBasicBearer}} {{#isApiKey}} [ 'type' => '{{type}}', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => true, 'isOAuth' => false, 'keyParamName' => '{{keyParamName}}', @@ -95,6 +106,7 @@ class SlimRouter [ 'type' => '{{type}}', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -167,7 +179,7 @@ class SlimRouter $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ 'authenticator' => $basicAuthenticator, - 'regex' => '/Basic\s+(.*)$/i', + 'regex' => $authMethod['isBearer'] ? '/Bearer\s+(.*)$/i' : '/Basic\s+(.*)$/i', 'header' => 'Authorization', 'parameter' => null, 'cookie' => null, @@ -266,4 +278,4 @@ class SlimRouter return $this->slimApp; } } -{{/apiInfo}} +{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache b/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache index 91b9f80bdf17..8c3a1d5e361a 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache @@ -67,10 +67,10 @@ {{/minimum}} {{#maximum}} {{#exclusiveMaximum}} - $asserts[] = new Assert\LessThan({{minimum}}); + $asserts[] = new Assert\LessThan({{maximum}}); {{/exclusiveMaximum}} {{^exclusiveMaximum}} - $asserts[] = new Assert\LessThanOrEqual({{minimum}}); + $asserts[] = new Assert\LessThanOrEqual({{maximum}}); {{/exclusiveMaximum}} {{/maximum}} {{#pattern}} diff --git a/modules/openapi-generator/src/main/resources/php-symfony/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/php-symfony/git_push.sh.mustache index e9c7bdb802b1..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/php-symfony/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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-petstore-perl "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/php/README.mustache b/modules/openapi-generator/src/main/resources/php/README.mustache index b32337e9c7d8..688fcf2370fa 100644 --- a/modules/openapi-generator/src/main/resources/php/README.mustache +++ b/modules/openapi-generator/src/main/resources/php/README.mustache @@ -33,7 +33,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi "repositories": [ { "type": "vcs", - "url": "https://github.com/{{gitUserId}}/{{gitRepoId}}.git" + "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" } ], "require": { diff --git a/modules/openapi-generator/src/main/resources/php/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/php/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/php/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/php/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache new file mode 100644 index 000000000000..a516dff1de99 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache @@ -0,0 +1,39 @@ +# gPRC for {{packageName}} + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Go +``` +# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` +mkdir /var/tmp/go/{{{pacakgeName}}} +protoc --go_out=/var/tmp/go/{{{pacakgeName}}} services/* +protoc --go_out=/var/tmp/go/{{{pacakgeName}}} models/* +``` + +### Ruby +``` +# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` +RUBY_OUTPUT_DIR="/var/tmp/ruby/{{{packageName}}}" +mkdir $RUBY_OUTPUT_DIR +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* +``` diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache new file mode 100644 index 000000000000..3236d010ccd6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache @@ -0,0 +1,46 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{{packageName}}}; + +import "google/protobuf/empty.proto"; +{{#imports}} +{{#import}} +import public "{{{modelPackage}}}/{{{.}}}.proto"; +{{/import}} +{{/imports}} + +service {{classname}} { +{{#operations}} +{{#operation}} + {{#description}} + // {{{.}}} + {{/description}} + rpc {{operationId}} ({{#hasParams}}{{operationId}}Request{{/hasParams}}{{^hasParams}}google.protobuf.Empty{{/hasParams}}) returns ({{#vendorExtensions.x-grpc-response}}{{.}}{{/vendorExtensions.x-grpc-response}}{{^vendorExtensions.x-grpc-response}}{{operationId}}Response{{/vendorExtensions.x-grpc-response}}); + +{{/operation}} +{{/operations}} +} + +{{#operations}} +{{#operation}} +{{#hasParams}} +message {{operationId}}Request { + {{#allParams}} + {{#description}} + // {{{.}}} + {{/description}} + {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{paramName}} = {{vendorExtensions.x-index}}; + {{/allParams}} + +} + +{{/hasParams}} +{{^vendorExtensions.x-grpc-response}} +message {{operationId}}Response { + {{{vendorExtensions.x-grpc-response-type}}} data = 1; +} + +{{/vendorExtensions.x-grpc-response}} +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/git_push.sh.mustache new file mode 100755 index 000000000000..c344020eab5e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/git_push.sh.mustache @@ -0,0 +1,52 @@ +#!/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" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + 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://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${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://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/gitignore.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/gitignore.mustache new file mode 100644 index 000000000000..180988936c56 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/gitignore.mustache @@ -0,0 +1,40 @@ +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache new file mode 100644 index 000000000000..5362485d3a55 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -0,0 +1,36 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{{packageName}}}; + +{{#imports}} +{{#import}} +import public "{{{modelPackage}}}/{{{import}}}.proto"; +{{/import}} +{{/imports}} + +{{#models}} +{{#model}} +message {{classname}} { + + {{#vars}} + {{#description}} + // {{{.}}} + {{/description}} + {{^isEnum}} + {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{name}} = {{vendorExtensions.x-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}}; + {{/isEnum}} + {{#isEnum}} + enum {{name}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{protobuf-enum-index}}}; + {{/enumVars}} + {{/allowableValues}} + } + {{/isEnum}} + + {{/vars}} +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache new file mode 100644 index 000000000000..0ade1e5273e2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/partial_header.mustache @@ -0,0 +1,13 @@ +/* + {{#appName}} + {{{appName}}} + + {{/appName}} + {{#appDescription}} + {{{appDescription}}} + + {{/appDescription}} + {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} + {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/root.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/root.mustache new file mode 100644 index 000000000000..091a85131133 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/root.mustache @@ -0,0 +1,22 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{{packageName}}}; + +{{#vendorExtensions.x-grpc-options}} +option {{{.}}}; +{{/vendorExtensions.x-grpc-options}} + +// Models +{{#models}} +{{#model}} +import public "{{modelPackage}}/{{classFilename}}.proto"; +{{/model}} +{{/models}} + +// APIs +{{#apiInfo}} +{{#apis}} +import public "{{apiPackage}}/{{classFilename}}.proto"; +{{/apis}} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-flask/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python-flask/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/python-flask/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/python-flask/util.mustache b/modules/openapi-generator/src/main/resources/python-flask/util.mustache index 30ba3247eee8..f2b90009a466 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/util.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/util.mustache @@ -16,7 +16,7 @@ def _deserialize(data, klass): if data is None: return None - if klass in six.integer_types or klass in (float, str, bool): + if klass in six.integer_types or klass in (float, str, bool, bytearray): return _deserialize_primitive(data, klass) elif klass == object: return _deserialize_object(data) diff --git a/modules/openapi-generator/src/main/resources/python/README.mustache b/modules/openapi-generator/src/main/resources/python/README.mustache index be8353390638..144f72427e9b 100644 --- a/modules/openapi-generator/src/main/resources/python/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/README.mustache @@ -22,12 +22,12 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh -pip install git+https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}.git +pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git ``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}.git`) +(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) Then import the package: ```python diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 6d0d5c62e1c2..2afcb7478ef4 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -61,6 +61,9 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ self.username = username """Username for HTTP basic authentication """ @@ -238,11 +241,15 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/modules/openapi-generator/src/main/resources/python/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/python/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/python/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index edf76be03bba..dd650b37d7f2 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -10,10 +10,14 @@ import re # noqa: F401 import six from {{packageName}}.api_client import ApiClient -from {{packageName}}.exceptions import ( # noqa: F401 +from {{packageName}}.exceptions import ( ApiTypeError, ApiValueError ) +from {{packageName}}.model_utils import ( + check_allowed_values, + check_validations +) {{#operations}} @@ -30,265 +34,384 @@ class {{classname}}(object): self.api_client = api_client {{#operation}} - def {{operationId}}(self{{#requiredParams}}{{^defaultValue}}, {{paramName}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}, {{paramName}}={{{defaultValue}}}{{/defaultValue}}{{/requiredParams}}, **kwargs): # noqa: E501 - """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + def __{{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 + """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 {{#notes}} - {{{notes}}} # noqa: E501 + {{{notes}}} # noqa: E501 {{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() - -{{#requiredParams}} -{{^hasMore}} - Args: -{{/hasMore}} -{{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}}{{/requiredParams}} + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True +{{#sortParamsByRequiredFlag}} + >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) +{{/sortParamsByRequiredFlag}} +{{^sortParamsByRequiredFlag}} + >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) +{{/sortParamsByRequiredFlag}} + >>> result = thread.get() - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}} - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param async_req bool: execute request asynchronously +{{#allParams}} + :param {{dataType}} {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} +{{/allParams}} + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{paramName}}, {{/defaultValue}}{{/requiredParams}}**kwargs) # noqa: E501 - else: - (data) = self.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{paramName}}, {{/defaultValue}}{{/requiredParams}}**kwargs) # noqa: E501 - return data - - def {{operationId}}_with_http_info(self{{#requiredParams}}{{^defaultValue}}, {{paramName}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}, {{paramName}}=None{{/defaultValue}}{{/requiredParams}}, **kwargs): # noqa: E501 - """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{notes}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() - + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) {{#requiredParams}} -{{^hasMore}} - Args: -{{/hasMore}} + kwargs['{{paramName}}'] = {{paramName}} {{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}}{{/requiredParams}} - - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}} - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}: - """ + return self.call_with_http_info(**kwargs) - {{#servers.0}} - local_var_hosts = [{{#servers}} - '{{{url}}}'{{^-last}},{{/-last}}{{/servers}} - ] - local_var_host = local_var_hosts[0] - if kwargs.get('_host_index'): - if (int(kwargs.get('_host_index')) < 0 or - int(kwargs.get('_host_index')) >= len(local_var_hosts)): - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(local_var_host) - ) - local_var_host = local_var_hosts[int(kwargs.get('_host_index'))] - {{/servers.0}} - local_var_params = locals() - - all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params{{#servers.0}} and key != "_host_index"{{/servers.0}}: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method {{operationId}}" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] + self.{{operationId}} = Endpoint( + settings={ + 'response_type': {{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, +{{#authMethods}} +{{#-first}} + 'auth': [ +{{/-first}} + '{{name}}'{{#hasMore}}, {{/hasMore}} +{{#-last}} + ], +{{/-last}} +{{/authMethods}} +{{^authMethods}} + 'auth': [], +{{/authMethods}} + 'endpoint_path': '{{{path}}}', + 'operation_id': '{{operationId}}', + 'http_method': '{{httpMethod}}', +{{#servers}} +{{#-first}} + 'servers': [ +{{/-first}} + '{{{url}}}'{{^-last}},{{/-last}} +{{#-last}} + ] +{{/-last}} +{{/servers}} +{{^servers}} + 'servers': [], +{{/servers}} + }, + params_map={ + 'all': [ {{#allParams}} -{{^isNullable}} -{{#required}} - # verify the required parameter '{{paramName}}' is set - if ('{{paramName}}' not in local_var_params or - local_var_params['{{paramName}}'] is None): - raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 -{{/required}} -{{/isNullable}} + '{{paramName}}', +{{/allParams}} + ], +{{#requiredParams}} +{{#-first}} + 'required': [ +{{/-first}} + '{{paramName}}', {{#-last}} + ], {{/-last}} +{{/requiredParams}} +{{^requiredParams}} + 'required': [], +{{/requiredParams}} + 'nullable': [ +{{#allParams}} +{{#isNullable}} + '{{paramName}}', +{{/isNullable}} {{/allParams}} + ], + 'enum': [ {{#allParams}} {{#isEnum}} -{{#isContainer}} - allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 -{{#isListContainer}} - if ('{{{paramName}}}' in local_var_params and - not set(local_var_params['{{{paramName}}}']).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `{{{paramName}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(local_var_params['{{{paramName}}}']) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isListContainer}} -{{#isMapContainer}} - if ('{{{paramName}}}' in local_var_params and - not set(local_var_params['{{{paramName}}}'].keys()).issubset(set(allowed_values))): - raise ValueError( - "Invalid keys in `{{{paramName}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(local_var_params['{{{paramName}}}'].keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isMapContainer}} -{{/isContainer}} -{{^isContainer}} - allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if ('{{{paramName}}}' in local_var_params and - local_var_params['{{{paramName}}}'] not in allowed_values): - raise ValueError( - "Invalid value for `{{{paramName}}}` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['{{{paramName}}}'], allowed_values) - ) -{{/isContainer}} + '{{paramName}}', {{/isEnum}} {{/allParams}} + ], + 'validation': [ {{#allParams}} {{#hasValidation}} - {{#maxLength}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) > {{maxLength}}): - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 - {{/maxLength}} - {{#minLength}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) < {{minLength}}): - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 - {{/minLength}} - {{#maximum}} - if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 - {{/maximum}} - {{#minimum}} - if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 - {{/minimum}} - {{#pattern}} - if '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 - {{/pattern}} - {{#maxItems}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) > {{maxItems}}): - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 - {{/maxItems}} - {{#minItems}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) < {{minItems}}): - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 - {{/minItems}} + '{{paramName}}', {{/hasValidation}} {{/allParams}} + ] + }, + root_map={ + 'validations': { +{{#allParams}} +{{#hasValidation}} + ('{{paramName}}',): { +{{#maxLength}} + 'max_length': {{maxLength}},{{/maxLength}}{{#minLength}} + 'min_length': {{minLength}},{{/minLength}}{{#maxItems}} + 'max_items': {{maxItems}},{{/maxItems}}{{#minItems}} + 'min_items': {{minItems}},{{/minItems}}{{#maximum}} + {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}} + {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}} + 'regex': { + 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} + {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} + },{{/pattern}} + }, +{{/hasValidation}} +{{/allParams}} + }, + 'allowed_values': { +{{#allParams}} +{{#isEnum}} + ('{{paramName}}',): { +{{#isNullable}} + 'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}} + "{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + }, +{{/isEnum}} +{{/allParams}} + }, + 'openapi_types': { +{{#allParams}} + '{{paramName}}': '{{dataType}}', +{{/allParams}} + }, + 'attribute_map': { +{{#allParams}} +{{^isBodyParam}} + '{{paramName}}': '{{baseName}}', +{{/isBodyParam}} +{{/allParams}} + }, + 'location_map': { +{{#allParams}} + '{{paramName}}': '{{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isCookieParam}}cookie{{/isCookieParam}}{{#isBodyParam}}body{{/isBodyParam}}', +{{/allParams}} + }, + 'collection_format_map': { +{{#allParams}} +{{#collectionFormat}} + '{{paramName}}': '{{collectionFormat}}', +{{/collectionFormat}} +{{/allParams}} + } + }, + headers_map={ +{{#hasProduces}} + 'accept': [ +{{#produces}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} +{{/produces}} + ], +{{/hasProduces}} +{{^hasProduces}} + 'accept': [], +{{/hasProduces}} +{{#hasConsumes}} + 'content_type': [ +{{#consumes}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} +{{/consumes}} + ] +{{/hasConsumes}} +{{^hasConsumes}} + 'content_type': [], +{{/hasConsumes}} + }, + api_client=api_client, + callable=__{{operationId}} + ) +{{/operation}} +{{/operations}} + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } - collection_formats = {} + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format - path_params = {} -{{#pathParams}} - if '{{paramName}}' in local_var_params: - path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/pathParams}} + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + else: + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - query_params = [] -{{#queryParams}} - if '{{paramName}}' in local_var_params: - query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/queryParams}} + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) - header_params = {} -{{#headerParams}} - if '{{paramName}}' in local_var_params: - header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/headerParams}} + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - form_params = [] - local_var_files = {} -{{#formParams}} - if '{{paramName}}' in local_var_params: - {{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/formParams}} + self.__validate_inputs(kwargs) - body_params = None -{{#bodyParam}} - if '{{paramName}}' in local_var_params: - body_params = local_var_params['{{paramName}}'] -{{/bodyParam}} - {{#hasProduces}} - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501 + params = self.__gather_params(kwargs) - {{/hasProduces}} - {{#hasConsumes}} - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501 + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - {{/hasConsumes}} - # Authentication setting - auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '{{{path}}}', '{{httpMethod}}', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - {{#servers.0}} - _host=local_var_host, - {{/servers.0}} - collection_formats=collection_formats) -{{/operation}} -{{/operations}} + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) 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 e955eb05707c..0f02b445dfba 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 @@ -18,9 +18,13 @@ from six.moves.urllib.parse import quote import tornado.gen {{/tornado}} -from {{packageName}}.configuration import Configuration import {{modelPackage}} from {{packageName}} import rest +from {{packageName}}.configuration import Configuration +from {{packageName}}.model_utils import ( + ModelNormal, + ModelSimple +) from {{packageName}}.exceptions import ApiValueError @@ -224,7 +228,7 @@ class ApiClient(object): if isinstance(obj, dict): obj_dict = obj - else: + elif isinstance(obj, ModelNormal): # Convert model obj to dict except # attributes `openapi_types`, `attribute_map` # and attributes which value is not None. @@ -233,6 +237,8 @@ class ApiClient(object): obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) for attr, _ in six.iteritems(obj.openapi_types) if getattr(obj, attr) is not None} + elif isinstance(obj, ModelSimple): + return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) for key, val in six.iteritems(obj_dict)} @@ -571,6 +577,8 @@ class ApiClient(object): return six.text_type(data) except TypeError: return data + except ValueError as exc: + raise ApiValueError(str(exc)) def __deserialize_object(self, value): """Return an original value. @@ -622,14 +630,15 @@ class ApiClient(object): """Deserializes list or dict to model. :param data: dict, list. - :param klass: class literal. + :param klass: class literal, ModelSimple or ModelNormal :return: model object. """ - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): - return data + if issubclass(klass, ModelSimple): + value = self.__deserialize(data, klass.openapi_types['value']) + return klass(value) + # code to handle ModelNormal used_data = data if not isinstance(data, (list, dict)): used_data = [data] @@ -641,13 +650,11 @@ class ApiClient(object): klass.attribute_map[attr] in used_data): value = used_data[klass.attribute_map[attr]] keyword_args[attr] = self.__deserialize(value, attr_type) - end_index = None argspec = inspect.getargspec(getattr(klass, '__init__')) if argspec.defaults: end_index = -len(argspec.defaults) required_positional_args = argspec.args[1:end_index] - for index, req_positional_arg in enumerate(required_positional_args): if keyword_args and req_positional_arg in keyword_args: positional_args.append(keyword_args[req_positional_arg]) @@ -655,9 +662,7 @@ class ApiClient(object): elif (not keyword_args and index < len(used_data) and isinstance(used_data, list)): positional_args.append(used_data[index]) - instance = klass(*positional_args, **keyword_args) - if hasattr(instance, 'get_real_child_model'): klass_name = instance.get_real_child_model(data) if klass_name: diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache index 7dc8e01fa620..082f4bddc432 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -2,240 +2,34 @@ {{>partial_header}} -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 + +from {{packageName}}.exceptions import ApiValueError # noqa: F401 +from {{packageName}}.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) {{#models}} {{#model}} -class {{classname}}(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """{{#allowableValues}} - - """ - allowed enum values - """ -{{#enumVars}} - {{name}} = {{{value}}}{{^-last}} +{{^interfaces}} +{{#isAlias}} +{{> python-experimental/model_templates/model_simple }} +{{/isAlias}} +{{^isAlias}} +{{> python-experimental/model_templates/model_normal }} +{{/isAlias}} +{{/interfaces}} +{{#interfaces}} +{{#-last}} +{{> python-experimental/model_templates/model_normal }} {{/-last}} -{{/enumVars}}{{/allowableValues}} - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { -{{#requiredVars}} - '{{name}}': '{{{dataType}}}', -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{{dataType}}}', -{{/optionalVars}} - } - - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } -{{#discriminator}} - - discriminator_value_class_map = { - {{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}}, - {{/-last}}{{/children}} - } -{{/discriminator}} - - def __init__(self{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}{{#requiredVars}}{{#defaultValue}}, {{name}}={{{defaultValue}}}{{/defaultValue}}{{/requiredVars}}{{#optionalVars}}, {{name}}=None{{/optionalVars}}): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}}{{^hasMore}} Args:{{/hasMore}}{{/requiredVars}}{{#requiredVars}}{{^defaultValue}} - {{name}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredVars}} - - Keyword Args:{{#requiredVars}}{{#defaultValue}} - {{name}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}} # noqa: E501{{/requiredVars}}{{#optionalVars}} - {{name}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501{{/optionalVars}} - """ -{{#vars}}{{#-first}} -{{/-first}} - self._{{name}} = None -{{/vars}} - self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} -{{#vars}}{{#-first}} -{{/-first}} -{{#required}} - self.{{name}} = {{name}} -{{/required}} -{{^required}} -{{#isNullable}} - self.{{name}} = {{name}} -{{/isNullable}} -{{^isNullable}} - if {{name}} is not None: - self.{{name}} = {{name}} # noqa: E501 -{{/isNullable}} -{{/required}} -{{/vars}} - -{{#vars}} - @property - def {{name}}(self): - """Gets the {{name}} of this {{classname}}. # noqa: E501 - -{{#description}} - {{{description}}} # noqa: E501 -{{/description}} - - :return: The {{name}} of this {{classname}}. # noqa: E501 - :rtype: {{dataType}} - """ - return self._{{name}} - - @{{name}}.setter - def {{name}}( - self, - {{name}}): - """Sets the {{name}} of this {{classname}}. - -{{#description}} - {{{description}}} # noqa: E501 -{{/description}} - - :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 - :type: {{dataType}} - """ -{{^isNullable}} -{{#required}} - if {{name}} is None: - raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 -{{/required}} -{{/isNullable}} -{{#isEnum}} -{{#isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 -{{#isListContainer}} - if not set({{{name}}}).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isListContainer}} -{{#isMapContainer}} - if not set({{{name}}}.keys()).issubset(set(allowed_values)): - raise ValueError( - "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isMapContainer}} -{{/isContainer}} -{{^isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if {{{name}}} not in allowed_values: - raise ValueError( - "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 - .format({{{name}}}, allowed_values) - ) -{{/isContainer}} -{{/isEnum}} -{{^isEnum}} -{{#hasValidation}} -{{#maxLength}} - if {{name}} is not None and len({{name}}) > {{maxLength}}: - raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 -{{/maxLength}} -{{#minLength}} - if {{name}} is not None and len({{name}}) < {{minLength}}: - raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 -{{/minLength}} -{{#maximum}} - if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 -{{/maximum}} -{{#minimum}} - if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 -{{/minimum}} -{{#pattern}} - if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 - raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 -{{/pattern}} -{{#maxItems}} - if {{name}} is not None and len({{name}}) > {{maxItems}}: - raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 -{{/maxItems}} -{{#minItems}} - if {{name}} is not None and len({{name}}) < {{minItems}}: - raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 -{{/minItems}} -{{/hasValidation}} -{{/isEnum}} - - self._{{name}} = ( - {{name}}) - -{{/vars}} -{{#discriminator}} - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - -{{/discriminator}} - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, {{classname}}): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other +{{/interfaces}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvar_allowed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvar_allowed.mustache new file mode 100644 index 000000000000..6ed39521f66e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvar_allowed.mustache @@ -0,0 +1,16 @@ + allowed_values = { +{{#vars}} +{{#isEnum}} + ('{{name}}',): { +{{#isNullable}} + 'None': None, +{{/isNullable}} +{{#allowableValues}} +{{#enumVars}} + '{{name}}': {{{value}}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} + }, +{{/isEnum}} +{{/vars}} + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvar_openapi_validations.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvar_openapi_validations.mustache new file mode 100644 index 000000000000..7e89f83ef261 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvar_openapi_validations.mustache @@ -0,0 +1,25 @@ + openapi_types = { +{{#vars}} + '{{name}}': '{{{dataType}}}'{{#hasMore}},{{/hasMore}} +{{/vars}} + } + + validations = { +{{#vars}} +{{#hasValidation}} + ('{{name}}',): { +{{#maxLength}} + 'max_length': {{maxLength}},{{/maxLength}}{{#minLength}} + 'min_length': {{minLength}},{{/minLength}}{{#maxItems}} + 'max_items': {{maxItems}},{{/maxItems}}{{#minItems}} + 'min_items': {{minItems}},{{/minItems}}{{#maximum}} + {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}} + {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}} + 'regex': { + 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} + {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} + },{{/pattern}} + }, +{{/hasValidation}} +{{/vars}} + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_allowed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_allowed.mustache new file mode 100644 index 000000000000..ab20932b2892 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_allowed.mustache @@ -0,0 +1,4 @@ + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_openapi_validations.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_openapi_validations.mustache new file mode 100644 index 000000000000..46dc1afefc49 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_openapi_validations.mustache @@ -0,0 +1,7 @@ + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_init_properties.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_init_properties.mustache new file mode 100644 index 000000000000..447aa22cacd0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_init_properties.mustache @@ -0,0 +1,76 @@ + def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501 + """{{classname}} - a model defined in OpenAPI""" # noqa: E501 +{{#vars}}{{#-first}} +{{/-first}} + self._{{name}} = None +{{/vars}} + self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} +{{#vars}}{{#-first}} +{{/-first}} +{{#required}} + self.{{name}} = {{name}} +{{/required}} +{{^required}} +{{#isNullable}} + self.{{name}} = {{name}} +{{/isNullable}} +{{^isNullable}} + if {{name}} is not None: + self.{{name}} = ( + {{name}} + ) +{{/isNullable}} +{{/required}} +{{/vars}} +{{#vars}} + + @property + def {{name}}(self): + """Gets the {{name}} of this {{classname}}. # noqa: E501 + +{{#description}} + {{{description}}} # noqa: E501 +{{/description}} + + :return: The {{name}} of this {{classname}}. # noqa: E501 + :rtype: {{dataType}} + """ + return self._{{name}} + + @{{name}}.setter + def {{name}}(self, {{name}}): # noqa: E501 + """Sets the {{name}} of this {{classname}}. + +{{#description}} + {{{description}}} # noqa: E501 +{{/description}} + + :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 + :type: {{dataType}} + """ +{{^isNullable}} +{{#required}} + if {{name}} is None: + raise ApiValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 +{{/required}} +{{/isNullable}} +{{#isEnum}} + check_allowed_values( + self.allowed_values, + ('{{name}}',), + {{name}}, + self.validations + ) +{{/isEnum}} +{{#hasValidation}} + check_validations( + self.validations, + ('{{name}}',), + {{name}} + ) +{{/hasValidation}} + + self._{{name}} = ( + {{name}} + ) +{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache new file mode 100644 index 000000000000..bd1eaddcb40b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache @@ -0,0 +1,83 @@ +class {{classname}}(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: +{{> python-experimental/model_templates/docstring_allowed }} + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. +{{> python-experimental/model_templates/docstring_openapi_validations }} + """ + +{{> python-experimental/model_templates/classvar_allowed }} + + attribute_map = { +{{#vars}} + '{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}} # noqa: E501 +{{/vars}} + } +{{#discriminator}} + + discriminator_value_class_map = { + {{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}}, + {{/-last}}{{/children}} + } +{{/discriminator}} + +{{> python-experimental/model_templates/classvar_openapi_validations }} + +{{> python-experimental/model_templates/methods_init_properties }} +{{#discriminator}} + def get_real_child_model(self, data): + """Returns the real base class specified by the discriminator""" + discriminator_key = self.attribute_map[self.discriminator] + discriminator_value = data[discriminator_key] + return self.discriminator_value_class_map.get(discriminator_value) + +{{/discriminator}} + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, {{classname}}): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache new file mode 100644 index 000000000000..94ad6336f9c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache @@ -0,0 +1,34 @@ +class {{classname}}(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: +{{> python-experimental/model_templates/docstring_allowed }} +{{> python-experimental/model_templates/docstring_openapi_validations }} + """ + +{{> python-experimental/model_templates/classvar_allowed }} + +{{> python-experimental/model_templates/classvar_openapi_validations }} + +{{> python-experimental/model_templates/methods_init_properties }} + def to_str(self): + """Returns the string representation of the model""" + return str(self._value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, {{classname}}): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache new file mode 100644 index 000000000000..c251879b1045 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -0,0 +1,175 @@ +# coding: utf-8 + +{{>partial_header}} +import re + +from {{packageName}}.exceptions import ApiValueError + + +def check_allowed_values(allowed_values, input_variable_path, input_values, + validations): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + validations (dict): the validations dict + """ + min_collection_length = ( + validations.get(input_variable_path, {}).get('min_length') or + validations.get(input_variable_path, {}).get('min_items', 0)) + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and len(input_values) > min_collection_length + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and len(input_values) > min_collection_length + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def check_validations(validations, input_variable_path, input_values): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking + """ + current_validations = validations[input_variable_path] + if ('max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if ('min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if ('max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if ('min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + if ('exclusive_maximum' in current_validations and + input_values >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_maximum' in current_validations and + input_values > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if ('exclusive_minimum' in current_validations and + input_values <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_minimum' in current_validations and + input_values < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if ('regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + raise ApiValueError( + r"Invalid value for `%s`, must be a follow pattern or equal to " + r"`%s` with flags=`%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'], + flags + ) + ) + + +class ModelSimple(object): + # the parent class of models whose type != object in their swagger/openapi + # spec + pass + + +class ModelNormal(object): + # the parent class of models whose type == object in their swagger/openapi + # spec + pass diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache index 201b79e217cb..588851cc7b0a 100644 --- a/modules/openapi-generator/src/main/resources/python/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/setup.mustache @@ -32,7 +32,7 @@ setup( url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ {{appDescription}} # noqa: E501 diff --git a/modules/openapi-generator/src/main/resources/r/README.mustache b/modules/openapi-generator/src/main/resources/r/README.mustache index 5407aa5db643..c9dd12a935f6 100644 --- a/modules/openapi-generator/src/main/resources/r/README.mustache +++ b/modules/openapi-generator/src/main/resources/r/README.mustache @@ -32,7 +32,7 @@ install.packages("caTools") ### Build the package ```sh -git clone https://github.com/{{{gitUserId}}}/{{{gitRepoId}}} +git clone https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}} cd {{{gitRepoId}}} R CMD build . R CMD check {{{packageName}}}_{{{packageVersion}}}.tar.gz diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 04fd3634e38d..0fc38a78916b 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -164,6 +164,8 @@ resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -291,6 +293,22 @@ {{! Returning the ApiResponse object with NULL object when the endpoint doesn't return anything}} ApiResponse$new(NULL, resp) {{/returnType}} + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + {{#returnExceptionOnFailure}} + errorMsg <- toString(content(resp)) + if(errorMsg == ""){ + errorMsg <- paste("Server returned " , httr::status_code(resp) , " response status code.") + } + {{#useDefaultExceptionHandling}} + stop(errorMsg) + {{/useDefaultExceptionHandling}} + {{#useRlangExceptionHandling}} + rlang::abort(message = errorMsg, .subclass = "ApiException", ApiException = ApiException$new(http_response = resp)) + {{/useRlangExceptionHandling}} + {{/returnExceptionOnFailure}} + {{^returnExceptionOnFailure}} + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) + {{/returnExceptionOnFailure}} } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { {{#returnExceptionOnFailure}} errorMsg <- toString(content(resp)) diff --git a/modules/openapi-generator/src/main/resources/r/api_doc.mustache b/modules/openapi-generator/src/main/resources/r/api_doc.mustache index 8a3af45edd41..49c944282db2 100644 --- a/modules/openapi-generator/src/main/resources/r/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/r/api_doc.mustache @@ -95,7 +95,14 @@ Name | Type | Description | Notes - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} - +{{#responses.0}} +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/r/model.mustache b/modules/openapi-generator/src/main/resources/r/model.mustache index 3b83d4695620..ee20e432e742 100644 --- a/modules/openapi-generator/src/main/resources/r/model.mustache +++ b/modules/openapi-generator/src/main/resources/r/model.mustache @@ -23,7 +23,7 @@ local.optional.var <- list(...) {{#requiredVars}} if (!missing(`{{baseName}}`)) { - {{^isListContainer}} + {{^isContainer}} {{#isInteger}} stopifnot(is.numeric(`{{baseName}}`), length(`{{baseName}}`) == 1) {{/isInteger}} @@ -48,8 +48,8 @@ {{^isPrimitiveType}} stopifnot(R6::is.R6(`{{baseName}}`)) {{/isPrimitiveType}} - {{/isListContainer}} - {{#isListContainer}} + {{/isContainer}} + {{#isContainer}} {{#isPrimitiveType}} stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(is.character(x))) @@ -58,13 +58,13 @@ stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(R6::is.R6(x))) {{/isPrimitiveType}} - {{/isListContainer}} + {{/isContainer}} self$`{{baseName}}` <- `{{baseName}}` } {{/requiredVars}} {{#optionalVars}} if (!is.null(`{{baseName}}`)) { - {{^isListContainer}} + {{^isContainer}} {{#isInteger}} stopifnot(is.numeric(`{{baseName}}`), length(`{{baseName}}`) == 1) {{/isInteger}} @@ -89,8 +89,8 @@ {{^isPrimitiveType}} stopifnot(R6::is.R6(`{{baseName}}`)) {{/isPrimitiveType}} - {{/isListContainer}} - {{#isListContainer}} + {{/isContainer}} + {{#isContainer}} {{#isPrimitiveType}} stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(is.character(x))) @@ -99,7 +99,7 @@ stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(R6::is.R6(x))) {{/isPrimitiveType}} - {{/isListContainer}} + {{/isContainer}} self$`{{baseName}}` <- `{{baseName}}` } {{/optionalVars}} @@ -109,22 +109,32 @@ {{#vars}} if (!is.null(self$`{{baseName}}`)) { {{classname}}Object[['{{baseName}}']] <- - {{#isListContainer}} - {{#isPrimitiveType}} + {{#isContainer}} + {{#isListContainer}} + {{#isPrimitiveType}} self$`{{baseName}}` + {{/isPrimitiveType}} + {{^isPrimitiveType}} + lapply(self$`{{baseName}}`, function(x) x$toJSON()) {{/isPrimitiveType}} - {{^isPrimitiveType}} - sapply(self$`{{baseName}}`, function(x) x$toJSON()) - {{/isPrimitiveType}} - {{/isListContainer}} - {{^isListContainer}} - {{#isPrimitiveType}} + {{/isListContainer}} + {{#isMapContainer}} + {{#isPrimitiveType}} self$`{{baseName}}` - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + lapply(self$`{{baseName}}`, function(x) x$toJSON()) + {{/isPrimitiveType}} + {{/isMapContainer}} + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + self$`{{baseName}}` + {{/isPrimitiveType}} + {{^isPrimitiveType}} self$`{{baseName}}`$toJSON() - {{/isPrimitiveType}} - {{/isListContainer}} + {{/isPrimitiveType}} + {{/isContainer}} } {{/vars}} @@ -156,6 +166,7 @@ if (!is.null(self$`{{baseName}}`)) { sprintf( '"{{baseName}}": + {{#isContainer}} {{#isListContainer}} {{#isPrimitiveType}} {{#isNumeric}}[%d]{{/isNumeric}}{{^isNumeric}}[%s]{{/isNumeric}} @@ -163,31 +174,49 @@ {{^isPrimitiveType}}[%s] {{/isPrimitiveType}} {{/isListContainer}} - {{^isListContainer}} + {{#isMapContainer}} + {{#isPrimitiveType}} + {{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}}%s + {{/isPrimitiveType}} + {{/isMapContainer}} + {{/isContainer}} + {{^isContainer}} {{#isPrimitiveType}} {{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}} {{/isPrimitiveType}} {{^isPrimitiveType}}%s {{/isPrimitiveType}} - {{/isListContainer}}', + {{/isContainer}}', + {{#isContainer}} {{#isListContainer}} {{#isPrimitiveType}} paste(unlist(lapply(self$`{{{baseName}}}`, function(x) paste0('"', x, '"'))), collapse=",") {{/isPrimitiveType}} {{^isPrimitiveType}} - paste(unlist(lapply(self$`{{{baseName}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA))), collapse=",") + paste(sapply(self$`{{{baseName}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",") {{/isPrimitiveType}} {{/isListContainer}} - {{^isListContainer}} + {{#isMapContainer}} + {{#isPrimitiveType}} + jsonlite::toJSON(lapply(self$`{{{baseName}}}`, function(x){ x }), auto_unbox = TRUE, digits=NA) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + jsonlite::toJSON(lapply(self$`{{{baseName}}}`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits=NA) + {{/isPrimitiveType}} + {{/isMapContainer}} + {{/isContainer}} + {{^isContainer}} {{#isPrimitiveType}} self$`{{baseName}}` {{/isPrimitiveType}} {{^isPrimitiveType}} jsonlite::toJSON(self$`{{baseName}}`$toJSON(), auto_unbox=TRUE, digits = NA) {{/isPrimitiveType}} - {{/isListContainer}} + {{/isContainer}} )}{{#hasMore}},{{/hasMore}} - {{/vars}} + {{/vars}} ) jsoncontent <- paste(jsoncontent, collapse = ",") paste('{', jsoncontent, '}', sep = "") diff --git a/modules/openapi-generator/src/main/resources/ruby-client/README.mustache b/modules/openapi-generator/src/main/resources/ruby-client/README.mustache index 182bb34f4f50..5303a2f7797f 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/README.mustache @@ -44,9 +44,9 @@ Finally add this to the Gemfile: ### Install from Git -If the Ruby gem is hosted at a git repository: https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}, then add the following in the Gemfile: +If the Ruby gem is hosted at a git repository: https://{{gitHost}}/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}, then add the following in the Gemfile: - gem '{{{gemName}}}', :git => 'https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}.git' + gem '{{{gemName}}}', :git => 'https://{{gitHost}}/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}.git' ### Include the Ruby code directly diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache index 7fc08ee0fce1..fec52da71b2f 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache @@ -6,7 +6,7 @@ ssl_options = { :ca_file => @config.ssl_ca_file, :verify => @config.ssl_verify, - :verify => @config.ssl_verify_mode, + :verify_mode => @config.ssl_verify_mode, :client_cert => @config.ssl_client_cert, :client_key => @config.ssl_client_key } diff --git a/modules/openapi-generator/src/main/resources/ruby-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/ruby-client/git_push.sh.mustache index 5807579d6eff..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/ruby-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/git_push.sh.mustache @@ -1,14 +1,17 @@ #!/bin/sh -# -# Generated by: https://openapi-generator.tech -# # 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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -40,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -50,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/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 65351bad6e5c..f0d7c40a5bce 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 @@ -246,14 +246,14 @@ {{#anyOf}} {{#-first}} _any_of_found = false - openapi_any_of.each do |_class| + self.class.openapi_any_of.each do |_class| _any_of = {{moduleName}}.const_get(_class).build_from_hash(self.to_hash) if _any_of.valid? _any_of_found = true end end - if !_any_of_found? + if !_any_of_found return false end @@ -262,10 +262,10 @@ {{#oneOf}} {{#-first}} _one_of_found = false - openapi_one_of.each do |_class| + self.class.openapi_one_of.each do |_class| _one_of = {{moduleName}}.const_get(_class).build_from_hash(self.to_hash) if _one_of.valid? - if _one_of_found? + if _one_of_found return false else _one_of_found = true @@ -273,7 +273,7 @@ end end - if !_one_of_found? + if !_one_of_found return false end diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index 2bd053e1b699..8dd7eea26eb5 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -9,42 +9,69 @@ license = "Unlicense" [features] default = ["client", "server"] -client = ["serde_json", {{#usesUrlEncodedForm}}"serde_urlencoded", {{/usesUrlEncodedForm}} {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] -server = ["serde_json", {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] +client = [{{#usesUrlEncodedForm}}"serde_urlencoded", {{/usesUrlEncodedForm}}"serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url"] +server = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url"] +conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"] [dependencies] -# Required by example server. -# +# Common chrono = { version = "0.4", features = ["serde"] } futures = "0.1" -hyper = {version = "0.11", optional = true} -hyper-tls = {version = "0.1.2", optional = true} swagger = "2" - -# Not required by example server. -# lazy_static = "0.2" log = "0.3.0" mime = "0.2.6" -multipart = {version = "0.13.3"} -native-tls = {version = "0.1.4", optional = true} -openssl = {version = "0.9.14", optional = true} -percent-encoding = {version = "1.0.0", optional = true} -regex = {version = "0.2", optional = true} +multipart = "0.13.3" serde = "1.0" serde_derive = "1.0" +serde_json = "1.0" + +# Crates included if required by the API definition +{{#apiUsesUuid}} +uuid = {version = "0.5", features = ["serde", "v4"]} +{{/apiUsesUuid}} +{{#usesXml}} +# TODO: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} +{{/usesXml}} + +# Common between server and client features +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} serde_ignored = {version = "0.0.4", optional = true} -serde_json = {version = "1.0", optional = true} -serde_urlencoded = {version = "0.5.1", optional = true} tokio-core = {version = "0.1.6", optional = true} +url = {version = "1.5", optional = true} + +# Client-specific +{{#usesUrlEncodedForm}}serde_urlencoded = {version = "0.5.1", optional = true}{{/usesUrlEncodedForm}} + +# Server-specific +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} tokio-proto = {version = "0.1.1", optional = true} tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} -url = {version = "1.5", optional = true} -uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} -# ToDo: this should be updated to point at the official crate once -# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -{{#usesXml}}serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master", optional = true}{{/usesXml}} + +# Other optional crates +frunk = { version = "0.3.0", optional = true } +frunk_derives = { version = "0.3.0", optional = true } +frunk_core = { version = "0.3.0", optional = true } +frunk-enum-derive = { version = "0.2.0", optional = true } +frunk-enum-core = { version = "0.2.0", optional = true } [dev-dependencies] clap = "2.25" error-chain = "0.12" +{{^apiUsesUuid}} +uuid = {version = "0.5", features = ["serde", "v4"]} +{{/apiUsesUuid}} + +[[example]] +name = "client" +required-features = ["client"] + +[[example]] +name = "server" +required-features = ["server"] diff --git a/modules/openapi-generator/src/main/resources/rust-server/README.mustache b/modules/openapi-generator/src/main/resources/rust-server/README.mustache index 5dd9da66c196..57146ddc4ca8 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/README.mustache @@ -5,22 +5,20 @@ {{/appDescription}} ## Overview + This client/server 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 a server stub. -- +(https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote +server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: {{{appVersion}}} -{{^hideGenerationTimestamp}} -- Build date: {{{generatedDate}}} -{{/hideGenerationTimestamp}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} +{{^hideGenerationTimestamp}}- Build date: {{{generatedDate}}}{{/hideGenerationTimestamp}} + +{{#infoUrl}}For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}){{/infoUrl}} This autogenerated project defines an API crate `{{{packageName}}}` which contains: * An `Api` trait defining the API in Rust. @@ -29,15 +27,17 @@ This autogenerated project defines an API crate `{{{packageName}}}` which contai * A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. It also contains an example server and client which make use of `{{{packageName}}}`: -* The example server starts up a web server using the `{{{packageName}}}` router, - and supplies a trivial implementation of `Api` which returns failure for every operation. -* The example client provides a CLI which lets you invoke any single operation on the - `{{{packageName}}}` client by passing appropriate arguments on the command line. + +* The example server starts up a web server using the `{{{packageName}}}` + router, and supplies a trivial implementation of `Api` which returns failure + for every operation. +* The example client provides a CLI which lets you invoke + any single operation on the `{{{packageName}}}` client by passing appropriate + arguments on the command line. You can use the example server and client as a basis for your own code. See below for [more detail on implementing a server](#writing-a-server). - ## Examples Run examples with: @@ -52,14 +52,14 @@ To pass in arguments to the examples, put them after `--`, for example: cargo run --example client -- --help ``` -### Running the server +### Running the example server To run the server, follow these simple steps: ``` cargo run --example server ``` -### Running a client +### Running the example client To run a client, follow one of the following simple steps: ```{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} @@ -73,43 +73,23 @@ The examples can be run in HTTPS mode by passing in the flag `--https`, for exam cargo run --example server -- --https ``` -This will use the keys/certificates from the examples directory. Note that the server chain is signed with -`CN=localhost`. - - -## Writing a server - -The server example is designed to form the basis for implementing your own server. Simply follow these steps. - -* Set up a new Rust project, e.g., with `cargo init --bin`. -* Insert `{{{packageName}}}` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "{{{packageName}}}" ]`. -* Add `{{{packageName}}} = {version = "{{{appVersion}}}", path = "{{{packageName}}}"}` under `[dependencies]` in the root `Cargo.toml`. -* Copy the `[dependencies]` and `[dev-dependencies]` from `{{{packageName}}}/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. - * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. - * Remove `"optional = true"` from each of these lines if present. - -Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: -``` -cp {{{packageName}}}/examples/server.rs src/main.rs -cp {{{packageName}}}/examples/server_lib/mod.rs src/lib.rs -cp {{{packageName}}}/examples/server_lib/server.rs src/server.rs -``` - -Now +This will use the keys/certificates from the examples directory. Note that the +server chain is signed with `CN=localhost`. -* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. -* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. -* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. -* Run `cargo build` to check it builds. -* Run `cargo fmt` to reformat the code. -* Commit the result before making any further changes (lest format changes get confused with your own updates). +## Using the generated library -Now replace the implementations in `src/server.rs` with your own code as required. +The generated library has a few optional features that can be activated through Cargo. -## Updating your server to track API changes +* `server` + * This defaults to enabled and creates the basic skeleton of a server implementation based on hyper + * To create the server stack you'll need to provide an implementation of the API trait to provide the server function. +* `client` + * This defaults to enabled and creates the basic skeleton of a client implementation based on hyper + * The constructed client implements the API trait by making remote API call. +* `conversions` + * This defaults to disabled and creates extra derives on models to allow "transmogrification" between objects of structurally similar types. -Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. -Alternatively, implement the now-missing methods based on the compiler's error messages. +See https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section for how to use features in your `Cargo.toml`. ## Documentation for API Endpoints diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache index f09a9c09a6e9..9c1bd23e0c9c 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache @@ -12,10 +12,10 @@ extern crate serde_urlencoded; {{#apiUsesMultipart}} extern crate multipart; {{/apiUsesMultipart}} - {{#apiUsesUuid}} -use uuid; +extern crate uuid; {{/apiUsesUuid}} + use hyper; use hyper::header::{Headers, ContentType}; use hyper::Uri; @@ -417,29 +417,53 @@ impl Api for Client where {{/vendorExtensions}} request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); -{{#authMethods}} - {{#isBasic}} - if let Some(auth_data) = (context as &Has>).get().as_ref() { - if let AuthData::Basic(ref basic_header) = *auth_data { - request.headers_mut().set(hyper::header::Authorization( - basic_header.clone(), - )) - } - } - {{/isBasic}} - {{#isApiKey}} - {{#isKeyInHeader}} - header! { ({{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}, "{{keyParamName}}") => [String] } - if let Some(auth_data) = (context as &Has>).get().as_ref() { - if let AuthData::ApiKey(ref api_key) = *auth_data { - request.headers_mut().set({{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}(api_key.to_string())); +{{#vendorExtensions.hasHeaderAuthMethods}} + + (context as &Has>).get().as_ref().map(|auth_data| { + // Currently only authentication with Basic, API Key, and Bearer are supported + match auth_data { + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInHeader}} + &AuthData::ApiKey(ref api_key) => { + header! { ({{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}, "{{keyParamName}}") => [String] } + request.headers_mut().set( + {{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}(api_key.to_string()) + ) + }, + {{/isKeyInHeader}} + {{/isApiKey}} + {{#isBasicBasic}} + &AuthData::Basic(ref basic_header) => { + request.headers_mut().set(hyper::header::Authorization( + basic_header.clone(), + )) + }, + {{/isBasicBasic}} + {{#isBasicBearer}} + &AuthData::Bearer(ref bearer_header) => { + request.headers_mut().set(hyper::header::Authorization( + bearer_header.clone(), + )) + }, + {{/isBasicBearer}} + {{#isOAuth}} + {{^isBasicBearer}} + &AuthData::Bearer(ref bearer_header) => { + request.headers_mut().set(hyper::header::Authorization( + bearer_header.clone(), + )) + }, + {{/isBasicBearer}} + {{/isOAuth}} + {{/authMethods}} + _ => {} } - } - {{/isKeyInHeader}} - {{/isApiKey}} -{{/authMethods}} + }); +{{/vendorExtensions.hasHeaderAuthMethods}} {{#headerParams}} {{#-first}} + // Header parameters {{/-first}}{{^isMapContainer}} header! { (Request{{vendorExtensions.typeName}}, "{{{baseName}}}") => {{#isListContainer}}({{{baseType}}})*{{/isListContainer}}{{^isListContainer}}[{{{dataType}}}]{{/isListContainer}} } {{#required}} request.headers_mut().set(Request{{vendorExtensions.typeName}}(param_{{{paramName}}}{{#isListContainer}}.clone(){{/isListContainer}})); @@ -490,7 +514,16 @@ impl Api for Client where }) {{/dataType}}{{^dataType}} future::ok( - {{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}}{{#headers}}{{#-first}}{ {{/-first}}{{^-first}}, {{/-first}}{{{name}}}: response_{{{name}}}{{#-last}} }{{/-last}}{{/headers}} + {{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}} +{{#headers}} + {{#-first}} + { + {{/-first}} + {{{name}}}: response_{{{name}}}, + {{#-last}} + } + {{/-last}} +{{/headers}} ) {{/dataType}} ) as Box> diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache index 00b3ef959247..4657024c6256 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-client.mustache @@ -7,9 +7,9 @@ extern crate futures; #[macro_use] extern crate swagger; #[allow(unused_extern_crates)] -extern crate uuid; extern crate clap; extern crate tokio_core; +extern crate uuid; use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server.mustache index eb68fedc54db..03b0cca619ac 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server.mustache @@ -20,7 +20,9 @@ extern crate futures; extern crate chrono; #[macro_use] extern crate error_chain; -{{#apiUsesUuid}}extern crate uuid;{{/apiUsesUuid}} +{{#apiUsesUuid}} +extern crate uuid; +{{/apiUsesUuid}} use openssl::x509::X509_FILETYPE_PEM; use openssl::ssl::{SslAcceptorBuilder, SslMethod}; diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache index 3245228d9d12..89bf5d89224a 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server_server.mustache @@ -6,9 +6,11 @@ use futures::{self, Future}; use chrono; use std::collections::HashMap; use std::marker::PhantomData; -{{#apiUsesUuid}}use uuid;{{/apiUsesUuid}} use swagger; use swagger::{Has, XSpanIdString}; +{{#apiUsesUuid}} +use uuid; +{{/apiUsesUuid}} use {{{externCrateName}}}::{Api, ApiError{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, {{{operationId}}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index b1c055176ff3..218f2b0579fe 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -1,40 +1,53 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -extern crate serde; -#[macro_use] -extern crate serde_derive; -extern crate serde_json; -{{#apiUsesUuid}}extern crate uuid;{{/apiUsesUuid}} -{{#usesXml}}extern crate serde_xml_rs;{{/usesXml}} -extern crate futures; -extern crate chrono; + #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; -extern crate mime; +#[macro_use] +extern crate serde_derive; -// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate hyper; - -extern crate swagger; - +#[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate url; +// Crates for conversion support +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_derives; +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_enum_derive; +#[cfg(feature = "conversion")] +extern crate frunk_core; + +extern crate mime; +extern crate serde; +extern crate serde_json; +{{#usesXml}}extern crate serde_xml_rs;{{/usesXml}} +extern crate futures; +extern crate chrono; +extern crate swagger; +{{#apiUsesUuid}} +extern crate uuid; +{{/apiUsesUuid}} + use futures::Stream; use std::io::Error; #[allow(unused_imports)] use std::collections::HashMap; -pub use futures::Future; - #[cfg(any(feature = "client", feature = "server"))] mod mimetypes; +#[deprecated(note = "Import swagger-rs directly")] pub use swagger::{ApiError, ContextWrapper}; +#[deprecated(note = "Import futures directly")] +pub use futures::Future; pub const BASE_PATH: &'static str = "{{{basePathWithoutHost}}}"; pub const API_VERSION: &'static str = "{{{appVersion}}}"; @@ -43,9 +56,35 @@ pub const API_VERSION: &'static str = "{{{appVersion}}}"; #[derive(Debug, PartialEq)] pub enum {{{operationId}}}Response { {{#responses}} -{{#message}} /// {{{message}}}{{/message}} - {{#vendorExtensions}}{{{x-responseId}}}{{/vendorExtensions}} {{#dataType}}{{^hasHeaders}}( {{{dataType}}} ) {{/hasHeaders}}{{#hasHeaders}}{{#-first}}{ body: {{{dataType}}}{{/-first}}{{/hasHeaders}}{{/dataType}}{{#dataType}}{{#hasHeaders}}, {{/hasHeaders}}{{/dataType}}{{^dataType}}{{#hasHeaders}} { {{/hasHeaders}}{{/dataType}}{{#headers}}{{^-first}}, {{/-first}}{{{name}}}: {{{datatype}}}{{#-last}} } {{/-last}}{{/headers}}, - {{/responses}} + {{#message}} + /// {{{message}}}{{/message}} + {{#vendorExtensions}} + {{{x-responseId}}} + {{/vendorExtensions}} + {{^dataType}} + {{#hasHeaders}} + { + {{/hasHeaders}} + {{/dataType}} + {{#dataType}} + {{^hasHeaders}} + ({{{dataType}}}) + {{/hasHeaders}} + {{#hasHeaders}} + { + body: {{{dataType}}}, + {{/hasHeaders}} + {{/dataType}} + {{#headers}} + {{{name}}}: {{{datatype}}}, + {{#-last}} + } + {{/-last}} + {{/headers}} + {{^-last}} + , + {{/-last}} +{{/responses}} } {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/models.mustache b/modules/openapi-generator/src/main/resources/rust-server/models.mustache index 2de3e517ca34..1dc24bdbbebf 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/models.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/models.mustache @@ -1,6 +1,5 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; {{#usesXml}} use serde_xml_rs; @@ -16,7 +15,9 @@ use std::collections::HashMap; use models; use swagger; use std::string::ParseError; - +{{#apiUsesUuid}} +use uuid; +{{/apiUsesUuid}} {{#models}}{{#model}} {{#description}}/// {{{description}}} @@ -25,7 +26,8 @@ use std::string::ParseError; /// which helps with FFI. #[allow(non_camel_case_types)] #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)]{{#xmlName}} +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGenericEnum))]{{#xmlName}} #[serde(rename = "{{{xmlName}}}")]{{/xmlName}} pub enum {{{classname}}} { {{#allowableValues}}{{#enumVars}} #[serde(rename = {{{value}}})] @@ -49,8 +51,19 @@ impl ::std::str::FromStr for {{{classname}}} { } } } -{{/isEnum}}{{^isEnum}}{{#dataType}}{{! newtype}}#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] -{{#xmlName}}#[serde(rename = "{{{xmlName}}}")]{{/xmlName}} +{{/isEnum}} +{{^isEnum}} +{{#dataType}} +{{#isMapModel}} +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +{{/isMapModel}} +{{^isMapModel}} +#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] +{{/isMapModel}} +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] +{{#xmlName}} +#[serde(rename = "{{{xmlName}}}")] +{{/xmlName}} pub struct {{{classname}}}({{{dataType}}}); impl ::std::convert::From<{{{dataType}}}> for {{{classname}}} { @@ -97,6 +110,7 @@ where } {{/itemXmlName}}{{/vendorExtensions}}{{! vec}}#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct {{{classname}}}({{#vendorExtensions}}{{#itemXmlName}}#[serde(serialize_with = "wrap_in_{{{itemXmlName}}}")]{{/itemXmlName}}{{/vendorExtensions}}Vec<{{{arrayModelType}}}>); impl ::std::convert::From> for {{{classname}}} { @@ -157,7 +171,8 @@ impl ::std::ops::DerefMut for {{{classname}}} { } } -{{/arrayModelType}}{{^arrayModelType}}{{! general struct}}#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]{{#xmlName}} +{{/arrayModelType}}{{^arrayModelType}}{{! general struct}}#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))]{{#xmlName}} #[serde(rename = "{{{xmlName}}}")]{{/xmlName}} pub struct {{{classname}}} { {{#vars}}{{#description}} /// {{{description}}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache index afe2744e04d7..1806ac1208b7 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache @@ -8,7 +8,7 @@ extern crate mime; extern crate chrono; extern crate percent_encoding; extern crate url; -{{^apiUsesUuid}} +{{#apiUsesUuid}} extern crate uuid; {{/apiUsesUuid}} {{#apiUsesMultipart}} @@ -32,9 +32,6 @@ use serde_json; {{#usesXml}} use serde_xml_rs; {{/usesXml}} -{{#apiUsesUuid}} -use uuid; -{{/apiUsesUuid}} #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; diff --git a/modules/openapi-generator/src/main/resources/rust/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/rust/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/rust/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/rust/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache index bab80595cc07..b9211855b8b6 100644 --- a/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache @@ -21,7 +21,7 @@ class {{classname}}(baseUrl: String) { {{>javadoc}} {{/javadocRenderer}} def {{operationId}}({{>methodParameters}}): ApiRequest[{{>operationReturnType}}] = - ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, "{{{basePath}}}", "{{{path}}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}) + ApiRequest[{{>operationReturnType}}](ApiMethods.{{httpMethod.toUpperCase}}, baseUrl, "{{{path}}}", {{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}) {{#authMethods}}{{#isApiKey}}.withApiKey(apiKey, "{{keyParamName}}", {{#isKeyInQuery}}QUERY{{/isKeyInQuery}}{{#isKeyInHeader}}HEADER{{/isKeyInHeader}}) {{/isApiKey}}{{#isBasic}}.withCredentials(basicAuth) {{/isBasic}}{{/authMethods}}{{#bodyParam}}.withBody({{paramName}}) diff --git a/modules/openapi-generator/src/main/resources/scala-httpclient/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/scala-httpclient/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/scala-httpclient/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache index c344020eab5e..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 96c92290b4e3..1db1321381b4 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 @@ -66,13 +66,14 @@ export class {{classname}} { {{/useHttpClient}} constructor(protected {{#useHttpClient}}httpClient: HttpClient{{/useHttpClient}}{{^useHttpClient}}http: Http{{/useHttpClient}}, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } {{#useHttpClient}} this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); @@ -342,7 +343,7 @@ export class {{classname}} { {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}){{#useHttpClient}} as any || formParams{{/useHttpClient}}; + {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{^isModel}}{{paramName}}{{/isModel}}{{#isModel}}useForm ? new Blob([JSON.stringify({{paramName}})], {type: 'application/json'}) : {{paramName}}{{/isModel}}){{#useHttpClient}} as any || formParams{{/useHttpClient}}; } {{/isListContainer}} {{/formParams}} diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-angular/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-angularjs/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-angularjs/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-angularjs/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angularjs/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-aurelia/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-aurelia/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-aurelia/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-aurelia/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache index 74e605829982..8165cd51077c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -6,6 +6,8 @@ import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; {{#models}} @@ -17,4 +19,4 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr {{/withSeparateModelsAndApi}}{{#withSeparateModelsAndApi}} {{#apiInfo}}{{#apis}}{{#operations}}export * from './{{apiPackage}}/{{classFilename}}'; {{/operations}}{{/apis}}{{/apiInfo}} -{{/withSeparateModelsAndApi}} \ No newline at end of file +{{/withSeparateModelsAndApi}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 62103f4c7db0..36f29be6f684 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -6,6 +6,8 @@ import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '{{apiRelativeToRoot}}configuration'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '{{apiRelativeToRoot}}base'; {{#imports}}import { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}'; @@ -223,7 +225,7 @@ export const {{classname}}Fp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}> { + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { const localVarAxiosArgs = {{classname}}AxiosParamCreator(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache index acd6198b3350..b5536db72b6d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache @@ -3,6 +3,8 @@ {{>licenseInfo}} import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, ""); diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache index 575a42c020ff..d89aadaac29c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache @@ -59,5 +59,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/git_push.sh.mustache index 4db97099b751..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-axios/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index d1751f7135d8..5149d534b8c0 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -15,10 +15,10 @@ import { {{#operations}} {{#operation}} {{#allParams.0}} -export interface {{operationIdCamelCase}}Request { - {{#allParams}} - {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}; - {{/allParams}} +export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request { +{{#allParams}} + {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}; +{{/allParams}} } {{/allParams.0}} @@ -39,7 +39,7 @@ export class {{classname}} extends runtime.BaseAPI { * {{&summary}} {{/summary}} */ - async {{nickname}}Raw({{#allParams.0}}requestParameters: {{operationIdCamelCase}}Request{{/allParams.0}}): Promise> { + async {{nickname}}Raw({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{/allParams.0}}): Promise> { {{#allParams}} {{#required}} if (requestParameters.{{paramName}} === null || requestParameters.{{paramName}} === undefined) { @@ -150,29 +150,50 @@ export class {{classname}} extends runtime.BaseAPI { {{/isOAuth}} {{/authMethods}} {{#hasFormParams}} - const formData = new FormData(); - {{/hasFormParams}} + const consumes: runtime.Consume[] = [ + {{#consumes}} + { contentType: '{{{mediaType}}}' }, + {{/consumes}} + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + {{#formParams}} + {{#isFile}} + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + {{/isFile}} + {{/formParams}} + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + {{#formParams}} {{#isListContainer}} if (requestParameters.{{paramName}}) { {{#isCollectionFormatMulti}} requestParameters.{{paramName}}.forEach((element) => { - formData.append('{{baseName}}', element as any); + formParams.append('{{baseName}}', element as any); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - formData.append('{{baseName}}', requestParameters.{{paramName}}.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"])); + formParams.append('{{baseName}}', requestParameters.{{paramName}}.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"])); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if (requestParameters.{{paramName}} !== undefined) { - formData.append('{{baseName}}', requestParameters.{{paramName}} as any); + formParams.append('{{baseName}}', requestParameters.{{paramName}} as any); } {{/isListContainer}} {{/formParams}} + {{/hasFormParams}} const response = await this.request({ path: `{{{path}}}`{{#pathParams}}.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters.{{paramName}}))){{/pathParams}}, method: '{{httpMethod}}', @@ -194,7 +215,7 @@ export class {{classname}} extends runtime.BaseAPI { {{/bodyParam}} {{/hasBodyParam}} {{#hasFormParams}} - body: formData, + body: formParams, {{/hasFormParams}} }); @@ -229,16 +250,16 @@ export class {{classname}} extends runtime.BaseAPI { {{/returnType}} } - /** - {{#notes}} - * {{¬es}} - {{/notes}} - {{#summary}} - * {{&summary}} - {{/summary}} - */ + /** + {{#notes}} + * {{¬es}} + {{/notes}} + {{#summary}} + * {{&summary}} + {{/summary}} + */ {{^useSingleRequestParameter}} - async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { + async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { {{#returnType}} const response = await this.{{nickname}}Raw({{#allParams.0}}{ {{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}} }{{/allParams.0}}); return await response.value(); @@ -249,7 +270,7 @@ export class {{classname}} extends runtime.BaseAPI { } {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} - async {{nickname}}({{#allParams.0}}requestParameters: {{operationIdCamelCase}}Request{{/allParams.0}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { + async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{/allParams.0}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { {{#returnType}} const response = await this.{{nickname}}Raw({{#allParams.0}}requestParameters{{/allParams.0}}); return await response.value(); 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 f3ded52fdb59..0db1d9a5a805 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache @@ -12,6 +12,10 @@ export enum {{classname}} { } export function {{classname}}FromJSON(json: any): {{classname}} { + return {{classname}}FromJSONTyped(json, false); +} + +export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} { return json as {{classname}}; } 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 af08282facb1..b2975124edb3 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -4,11 +4,20 @@ import { {{#imports}} {{{.}}}, {{.}}FromJSON, + {{.}}FromJSONTyped, {{.}}ToJSON, {{/imports}} } from './'; {{/hasImports}} +{{#discriminator}} +import { +{{#discriminator.mappedModels}} + {{modelName}}FromJSONTyped{{^-last}},{{/-last}} +{{/discriminator.mappedModels}} +} from './'; + +{{/discriminator}} /** * {{{description}}} * @export @@ -24,13 +33,30 @@ 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}} } export function {{classname}}FromJSON(json: any): {{classname}} { + return {{classname}}FromJSONTyped(json, false); +} + +export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} { {{#hasVars}} + if ((json === undefined) || (json === null)) { + return json; + } +{{#discriminator}} + if (!ignoreDiscriminator) { +{{#discriminator.mappedModels}} + if (json['{{discriminator.propertyName}}'] === '{{modelName}}') { + return {{modelName}}FromJSONTyped(json, true); + } +{{/discriminator.mappedModels}} + } +{{/discriminator}} return { + {{#parent}}...{{{parent}}}FromJSONTyped(json, ignoreDiscriminator),{{/parent}} {{#additionalPropertiesType}} ...json, {{/additionalPropertiesType}} @@ -74,26 +100,30 @@ export function {{classname}}FromJSON(json: any): {{classname}} { {{/hasVars}} } -export function {{classname}}ToJSON(value?: {{classname}}): any { +export function {{classname}}ToJSON(value?: {{classname}} | null): any { {{#hasVars}} if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + {{#parent}}...{{{parent}}}ToJSON(value),{{/parent}} {{#additionalPropertiesType}} ...value, {{/additionalPropertiesType}} {{#vars}} {{^isReadOnly}} {{#isPrimitiveType}} - '{{baseName}}': {{#isDate}}{{^required}}value.{{name}} === undefined ? undefined : {{/required}}value.{{name}}.toISOString().substr(0,10){{/isDate}}{{#isDateTime}}{{^required}}value.{{name}} === undefined ? undefined : {{/required}}value.{{name}}.toISOString(){{/isDateTime}}{{^isDate}}{{^isDateTime}}value.{{name}}{{/isDateTime}}{{/isDate}}, + '{{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}}, {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isListContainer}} - '{{baseName}}': {{^required}}value.{{name}} === undefined ? undefined : {{/required}}(value.{{name}} as Array).map({{#items}}{{datatype}}{{/items}}ToJSON), + '{{baseName}}': {{^required}}value.{{name}} == null ? undefined : {{/required}}(value.{{name}} as Array).map({{#items}}{{datatype}}{{/items}}ToJSON), {{/isListContainer}} {{#isMapContainer}} - '{{baseName}}': {{^required}}value.{{name}} === undefined ? undefined : {{/required}}mapValues(value.{{name}}, {{#items}}{{datatype}}{{/items}}ToJSON), + '{{baseName}}': {{^required}}value.{{name}} == null ? undefined : {{/required}}mapValues(value.{{name}}, {{#items}}{{datatype}}{{/items}}ToJSON), {{/isMapContainer}} {{^isListContainer}} {{^isMapContainer}} diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache index 1c9d9e55bbf6..b7c3d544af15 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache @@ -5,12 +5,12 @@ "author": "OpenAPI-Generator", "main": "./dist/index.js", "typings": "./dist/index.d.ts", - "scripts" : { + "scripts": { "build": "tsc", "prepare": "npm run build" }, "devDependencies": { - "typescript": "^2.4" + "typescript": "^{{#typescriptThreePlus}}3.6{{/typescriptThreePlus}}{{^typescriptThreePlus}}2.4{{/typescriptThreePlus}}" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index 0b42e5e8629a..bd53174f179c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -113,7 +113,7 @@ export const COLLECTION_FORMATS = { pipes: "|", }; -export type FetchAPI = GlobalFetch['fetch']; +export type FetchAPI = {{#typescriptThreePlus}}WindowOrWorkerGlobalScope{{/typescriptThreePlus}}{{^typescriptThreePlus}}GlobalFetch{{/typescriptThreePlus}}['fetch']; export interface ConfigurationParameters { basePath?: string; // override base path @@ -184,7 +184,7 @@ export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; -export type HTTPBody = Json | FormData; +export type HTTPBody = Json | FormData | URLSearchParams; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface FetchParams { @@ -231,6 +231,19 @@ export function mapValues(data: any, fn: (item: any) => any) { ); } +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + export interface RequestContext { fetch: FetchAPI; url: string; diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache index 2599345d141e..a44d76453ca8 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache @@ -19,15 +19,15 @@ class HttpClient implements IHttpClient { return this.performNetworkCall(url, "GET", undefined, headers); } - post(url: string, body: {}|FormData, headers?: Headers): Observable { + post(url: string, body?: {}|FormData, headers?: Headers): Observable { return this.performNetworkCall(url, "POST", this.getJsonBody(body), this.addJsonHeaders(headers)); } - put(url: string, body: {}, headers?: Headers): Observable { + put(url: string, body?: {}, headers?: Headers): Observable { return this.performNetworkCall(url, "PUT", this.getJsonBody(body), this.addJsonHeaders(headers)); } - patch(url: string, body: {}, headers?: Headers): Observable { + patch(url: string, body?: {}, headers?: Headers): Observable { return this.performNetworkCall(url, "PATCH", this.getJsonBody(body), this.addJsonHeaders(headers)); } @@ -36,11 +36,14 @@ class HttpClient implements IHttpClient { return this.performNetworkCall(url, "DELETE", undefined, headers); } - private getJsonBody(body: {}|FormData) { - return !(body instanceof FormData) ? JSON.stringify(body) : body; + private getJsonBody(body?: {}|FormData) { + if (body === undefined || body instanceof FormData) { + return body; + } + return JSON.stringify(body); } - private addJsonHeaders(headers: Headers) { + private addJsonHeaders(headers?: Headers) { return Object.assign({}, { "Accept": "application/json", "Content-Type": "application/json" @@ -77,4 +80,4 @@ class HttpClient implements IHttpClient { } } -export default HttpClient \ No newline at end of file +export default HttpClient diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache index 8f8984819039..211d881ba5eb 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache @@ -9,9 +9,9 @@ import { Headers } from "./Headers"; interface IHttpClient { get(url:string, headers?: Headers):Observable - post(url:string, body:{}|FormData, headers?: Headers):Observable - put(url:string, body:{}, headers?: Headers):Observable - patch(url:string, body:{}, headers?: Headers):Observable + post(url:string, body?:{}|FormData, headers?: Headers):Observable + put(url:string, body?:{}, headers?: Headers):Observable + patch(url:string, body?:{}, headers?: Headers):Observable delete(url:string, headers?: Headers):Observable } diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache index 547055863b76..033de44d80b7 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache @@ -60,7 +60,7 @@ export class {{classname}} { public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}observe: any = 'body', headers: Headers = {}): {{#usePromise}}Promise{{/usePromise}}{{^usePromise}}Observable{{/usePromise}} { {{#allParams}} {{#required}} - if (!{{paramName}}){ + if ({{paramName}} === null || {{paramName}} === undefined){ throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } @@ -139,7 +139,7 @@ export class {{classname}} { headers['Accept'] = 'application/json'; {{/produces}} {{#produces.0}} - headers['Accept'] = '{{{mediaType}}}'; + headers['Accept'] = '{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}'; {{/produces.0}} {{#bodyParam}} {{^consumes}} diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-jquery/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-jquery/git_push.sh.mustache index b2cb1cdd4e8c..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-jquery/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-jquery/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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-petstore-typescript-jquery "minor update" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-node/api-all.mustache b/modules/openapi-generator/src/main/resources/typescript-node/api-all.mustache index 514b5e0d10fd..adac7f8cacb1 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/api-all.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/api-all.mustache @@ -8,5 +8,12 @@ import { {{ classname }} } from './{{ classFilename }}'; export * from './{{ classFilename }}Interface' {{/withInterfaces}} {{/apis}} +import http = require('http'); +export class HttpError extends Error { + constructor (public response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}, public body: any, public statusCode?: number) { + super('HTTP request failed'); + this.name = 'HttpError'; + } +} export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^-last}}, {{/-last}}{{/apis}}]; {{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache b/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache index 91b263cb5d22..5c96b388c5a1 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache @@ -9,19 +9,11 @@ import { {{classname}} } from '../{{filename}}'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; {{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -import { HttpBasicAuth } from '../model/models'; -{{/isBasic}} -{{#isApiKey}} -import { ApiKeyAuth } from '../model/models'; -{{/isApiKey}} -{{#isOAuth}} -import { OAuth } from '../model/models'; -{{/isOAuth}} -{{/authMethods}} +import { HttpBasicAuth, ApiKeyAuth, OAuth } from '../model/models'; {{/hasAuthMethods}} +import { HttpError } from './apis'; + let defaultBasePath = '{{{basePath}}}'; // =============================================== @@ -55,7 +47,7 @@ export class {{classname}} { '{{name}}': new HttpBasicAuth(), {{/isBasic}} {{#isApiKey}} - '{{name}}': new ApiKeyAuth({{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{^isKeyInHeader}}'query'{{/isKeyInHeader}}, '{{keyParamName}}'), + '{{name}}': new ApiKeyAuth({{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}{{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}, '{{keyParamName}}'), {{/isApiKey}} {{#isOAuth}} '{{name}}': new OAuth(), @@ -222,7 +214,7 @@ export class {{classname}} { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/modules/openapi-generator/src/main/resources/typescript-node/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-node/git_push.sh.mustache index 8a32e53995d6..8b3f689c9121 100755 --- a/modules/openapi-generator/src/main/resources/typescript-node/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/git_push.sh.mustache @@ -1,11 +1,17 @@ #!/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" +# 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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="{{{gitUserId}}}" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/modules/openapi-generator/src/main/resources/typescript-node/models.mustache b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache index 59e86fe445d0..963faeb22942 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache @@ -23,7 +23,7 @@ let primitives = [ "number", "any" ]; - + let enumsMap: {[index: string]: any} = { {{#models}} {{#model}} @@ -110,7 +110,7 @@ export class ObjectSerializer { if (!typeMap[type]) { // in case we dont know the type return data; } - + // Get the actual type of this object type = this.findCorrectType(data, type); @@ -191,6 +191,13 @@ export class ApiKeyAuth implements Authentication { (requestOptions.qs)[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { requestOptions.headers[this.paramName] = this.apiKey; + } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { + if (requestOptions.headers['Cookie']) { + requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey); + } + else { + requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey); + } } } } 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 70614d7f79a2..3c548d7b547d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache @@ -175,7 +175,7 @@ export class {{classname}} extends BaseAPI { responseType: 'blob' {{/isResponseFile}} }); - } + }; {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache index 27f466a6650a..555ee5aad668 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache @@ -65,7 +65,7 @@ export class BaseAPI { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; - } + }; withPreMiddleware = (preMiddlewares: Array) => this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); @@ -73,7 +73,7 @@ export class BaseAPI { withPostMiddleware = (postMiddlewares: Array) => this.withMiddleware(postMiddlewares.map((post) => ({ post }))); - protected request = (requestOpts: RequestOpts): Observable => + protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { if (res.status >= 200 && res.status < 300) { @@ -91,17 +91,17 @@ export class BaseAPI { // do not handle correctly sometimes. url += '?' + queryString(requestOpts.query); } - + return { url, method: requestOpts.method, headers: requestOpts.headers, body: requestOpts.body instanceof FormData ? requestOpts.body : JSON.stringify(requestOpts.body), - responseType: requestOpts.responseType || 'json' + responseType: requestOpts.responseType || 'json', }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: RequestArgs): Observable => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); @@ -122,7 +122,7 @@ export class BaseAPI { * and then shallow cloning data members. */ private clone = (): T => - Object.assign(Object.create(Object.getPrototypeOf(this)), this) + Object.assign(Object.create(Object.getPrototypeOf(this)), this); } // export for not being a breaking change @@ -138,7 +138,7 @@ export const COLLECTION_FORMATS = { }; export type Json = any; -export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; export type HttpBody = Json | FormData; @@ -153,7 +153,7 @@ export interface RequestOpts { responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } -export const encodeURI = (value: any) => encodeURIComponent(String(value)) +export const encodeURI = (value: any) => encodeURIComponent(String(value)); const queryString = (params: HttpQuery): string => Object.keys(params) .map((key) => { @@ -171,7 +171,7 @@ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickn if (!params || params[key] === null || params[key] === undefined) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } -} +}; // alias for easier importing export interface RequestArgs extends AjaxRequest {} 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 9dbb5bb5c134..26ae76afc1bc 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 @@ -27,6 +27,7 @@ import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.headers.Header; import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.QueryParameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; @@ -911,6 +912,41 @@ public void modelWithSuffixDoNotContainInheritedVars() { Assert.assertEquals(codegenModel.vars.size(), 1); } + @Test + public void arrayInnerReferencedSchemaMarkedAsModel_20() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/arrayRefBody.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Set imports = new HashSet<>(); + + RequestBody body = openAPI.getPaths().get("/examples").getPost().getRequestBody(); + + CodegenParameter codegenParameter = codegen.fromRequestBody(body, imports, ""); + + Assert.assertTrue(codegenParameter.isContainer); + Assert.assertTrue(codegenParameter.items.isModel); + Assert.assertFalse(codegenParameter.items.isContainer); + } + + @Test + public void arrayInnerReferencedSchemaMarkedAsModel_30() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/arrayRefBody.yaml"); + new InlineModelResolver().flatten(openAPI); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Set imports = new HashSet<>(); + + RequestBody body = openAPI.getPaths().get("/examples").getPost().getRequestBody(); + + CodegenParameter codegenParameter = codegen.fromRequestBody(body, imports, ""); + + Assert.assertTrue(codegenParameter.isContainer); + Assert.assertTrue(codegenParameter.items.isModel); + Assert.assertFalse(codegenParameter.items.isContainer); + } + @Test @SuppressWarnings("unchecked") public void commonLambdasRegistrationTest() { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java index 26522cc4fd17..fec2422d7f48 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java @@ -804,4 +804,42 @@ public void nullable() { Schema nullableRequestBodySchema = ModelUtils.getReferencedSchema(openAPI, nullableRequestBodyReference); assertTrue(nullableRequestBodySchema.getNullable()); } + + @Test + public void callbacks() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_resolver.yaml"); + new InlineModelResolver().flatten(openAPI); + + RequestBody callbackRequestBodyReference = openAPI + .getPaths() + .get("/callback") + .getPost() + .getCallbacks() + .get("webhook") + .get("{$request.body#/callbackUri}") + .getPost() + .getRequestBody(); + assertNotNull(callbackRequestBodyReference.get$ref()); + + RequestBody resolvedCallbackRequestBody = openAPI + .getComponents() + .getRequestBodies() + .get(ModelUtils.getSimpleRef(callbackRequestBodyReference.get$ref())); + + Schema callbackRequestSchemaReference = resolvedCallbackRequestBody + .getContent() + .get("application/json") + .getSchema(); + assertNotNull(callbackRequestSchemaReference.get$ref()); + + Schema resolvedCallbackSchema = openAPI + .getComponents() + .getSchemas() + .get(ModelUtils.getSimpleRef(callbackRequestSchemaReference.get$ref())); + + Map properties = resolvedCallbackSchema.getProperties(); + assertTrue(properties.get("notificationId") instanceof StringSchema); + assertTrue(properties.get("action") instanceof StringSchema); + assertTrue(properties.get("data") instanceof StringSchema); + } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index 188d7d2b9031..6c1d9a12b1f2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -1,8 +1,12 @@ package org.openapitools.codegen; -import static org.testng.Assert.assertFalse; +import static org.testng.Assert.fail; import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertFalse; +import com.github.javaparser.ParseProblemException; +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.CompilationUnit; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; @@ -66,19 +70,38 @@ public static void ensureContainsFile(Map generatedFiles, File r File file = new File(root, filename); String absoluteFilename = file.getAbsolutePath().replace("\\", "/"); if (!generatedFiles.containsKey(absoluteFilename)) { - Assert.fail("Could not find '" + absoluteFilename + "' file in list:\n" + + fail("Could not find '" + absoluteFilename + "' file in list:\n" + generatedFiles.keySet().stream().sorted().collect(Collectors.joining(",\n"))); } - assertTrue(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was not fould in the list of generated files"); + assertTrue(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was not found in the list of generated files"); } public static void ensureDoesNotContainsFile(Map generatedFiles, File root, String filename) { File file = new File(root, filename); String absoluteFilename = file.getAbsolutePath().replace("\\", "/"); if (generatedFiles.containsKey(absoluteFilename)) { - Assert.fail("File '" + absoluteFilename + "' exists in file in list:\n" + + fail("File '" + absoluteFilename + "' exists in file in list:\n" + generatedFiles.keySet().stream().sorted().collect(Collectors.joining(",\n"))); } - assertFalse(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was fould in the list of generated files"); + assertFalse(generatedFiles.containsKey(absoluteFilename), "File '" + absoluteFilename + "' was found in the list of generated files"); + } + + public static void validateJavaSourceFiles(Map fileMap) { + fileMap.forEach( (fileName, fileContents) -> { + if (fileName.endsWith(".java")) { + assertValidJavaSourceCode(fileContents, fileName); + } + } + ); + } + + public static void assertValidJavaSourceCode(String javaSourceCode, String filename) { + try { + CompilationUnit compilation = StaticJavaParser.parse(javaSourceCode); + assertTrue(compilation.getTypes().size() > 0, "File: " + filename); + } + catch (ParseProblemException ex) { + fail("Java parse problem: " + filename, ex); + } } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java new file mode 100644 index 000000000000..746a5bd87afa --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocGeneratorTest.java @@ -0,0 +1,117 @@ +package org.openapitools.codegen.asciidoc; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.apache.commons.io.FileUtils; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.MockDefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.languages.AsciidocDocumentationCodegen; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.Test; + +import io.swagger.v3.oas.models.OpenAPI; + +/** check against ping.yaml spec. */ +public class AsciidocGeneratorTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(AsciidocGeneratorTest.class); + + @Test + public void testPingSpecTitle() throws Exception { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/ping.yaml"); + + AsciidocDocumentationCodegen codeGen = new AsciidocDocumentationCodegen(); + codeGen.preprocessOpenAPI(openAPI); + + Assert.assertEquals(openAPI.getInfo().getTitle(), "ping test"); + } + + @Test + public void testGenerateIndexAsciidocMarkupFileWithAsciidocGenerator() throws Exception { + + File output = Files.createTempDirectory("test").toFile(); + + final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("asciidoc") + .setInputSpec("src/test/resources/3_0/ping.yaml").setOutputDir(output.getAbsolutePath()) + .addAdditionalProperty(AsciidocDocumentationCodegen.SNIPPET_DIR, "MY-SNIPPET-DIR") + .addAdditionalProperty(AsciidocDocumentationCodegen.SPEC_DIR, "MY-SPEC-DIR"); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(clientOptInput).generate(); + + Map generatedFiles = generator.getFiles(); + TestUtils.ensureContainsFile(generatedFiles, output, "index.adoc"); + } + + @Test + public void testGenerateIndexAsciidocMarkupContent() throws Exception { + final File output = Files.createTempDirectory("test").toFile(); + output.mkdirs(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/ping.yaml"); + CodegenConfig codegenConfig = new AsciidocDocumentationCodegen(); + codegenConfig.setOutputDir(output.getAbsolutePath()); + ClientOptInput clientOptInput = new ClientOptInput().openAPI(openAPI).config(codegenConfig); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + boolean markupFileGenerated = false; + for (File file : files) { + if (file.getName().equals("index.adoc")) { + markupFileGenerated = true; + String markupContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8); + // check on some basic asciidoc markup content + Assert.assertTrue(markupContent.contains("= ping test"), + "expected = header in: " + markupContent.substring(0, 50)); + Assert.assertTrue(markupContent.contains(":toc: "), + "expected = :toc: " + markupContent.substring(0, 50)); + } + } + Assert.assertTrue(markupFileGenerated, "Default api file is not generated!"); + } + + @Test + public void testAdditionalDirectoriesGeneratedIntoHeaderAttributes() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + + LOGGER.info("test: generating sample markup " + output.getAbsolutePath()); + + Map props = new TreeMap(); + props.put("specDir", "spec"); + + final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("asciidoc") + .setInputSpec("src/test/resources/3_0/ping.yaml").setOutputDir(output.getAbsolutePath()) + .addAdditionalProperty(AsciidocDocumentationCodegen.SPEC_DIR, "SPEC-DIR") + .addAdditionalProperty(AsciidocDocumentationCodegen.SNIPPET_DIR, "MY/SNIPPET/DIR"); + + 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); + Assert.assertTrue(markupContent.contains(":specDir: SPEC-DIR"), + "expected :specDir: in: " + markupContent.substring(0, 250)); + Assert.assertTrue(markupContent.contains(":snippetDir: MY/SNIPPET/DIR"), + "expected :snippetDir: in: " + markupContent.substring(0, 250)); + } + } + Assert.assertTrue(markupFileGenerated, "index.adoc is not generated!"); + + } + +} 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 new file mode 100644 index 000000000000..930cab9ded20 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/AsciidocSampleGeneratorTest.java @@ -0,0 +1,85 @@ +package org.openapitools.codegen.asciidoc; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +import org.apache.commons.io.FileUtils; + +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.Test; + +public class AsciidocSampleGeneratorTest { + + /** + * ensure api-docs.json includes sample and spec files into markup. + * @throws Exception generic exception + */ + @Test + public void testSampleAsciidocMarkupGenerationFromJsonWithSpecsAndSamples() 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(snippetDir.exists(), "test cancel, not snippedDir found to use." + snippetDir.getPath()); + + final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("asciidoc") + .setInputSpec("src/test/resources/3_0/asciidoc/api-docs.json") + .setOutputDir(outputTempDirectory.getAbsolutePath()) + .addAdditionalProperty(AsciidocDocumentationCodegen.SPEC_DIR, specDir.toString()) + .addAdditionalProperty(AsciidocDocumentationCodegen.SNIPPET_DIR, snippetDir.toString()); + + 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)); + } + Files.deleteIfExists(Paths.get(file.getAbsolutePath())); + } + + Assert.assertTrue(markupFileGenerated, "index.adoc is not generated!"); + + Files.deleteIfExists(Paths.get(outputTempDirectory.getAbsolutePath(), ".openapi-generator")); + Files.deleteIfExists(Paths.get(outputTempDirectory.getAbsolutePath())); + } + +} 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 new file mode 100644 index 000000000000..7c178b495500 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/IncludeMarkupFilterTest.java @@ -0,0 +1,48 @@ +package org.openapitools.codegen.asciidoc; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import org.mockito.MockitoAnnotations; +import org.openapitools.codegen.languages.AsciidocDocumentationCodegen; +import org.openapitools.codegen.templating.mustache.LambdaTest; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import org.testng.Assert; + +public class IncludeMarkupFilterTest extends LambdaTest { + + @BeforeMethod + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testIncludeMarkupFilterDoesNotIncludeMissingFile() { + + final AsciidocDocumentationCodegen generator = new AsciidocDocumentationCodegen(); + 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[]"), + "unexpected filtered " + result); + } + + @Test + public void testIncludeMarkupFilterFoundFileOk() throws IOException { + + File tempFile = File.createTempFile("IncludeMarkupFilterTestDummyfile", "-adoc"); + tempFile.deleteOnExit(); + + final AsciidocDocumentationCodegen generator = new AsciidocDocumentationCodegen(); + final Map ctx = context("snippetinclude", + generator.new IncludeMarkupLambda(tempFile.getParent())); + + final String result = execute("{{#snippetinclude}}" + tempFile.getName() + "{{/snippetinclude}}", ctx); + Assert.assertTrue(result.contains("include::"), "unexpected filtered: " + result); + Assert.assertTrue(result.contains(tempFile.getName()), "unexpected filtered: " + result); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/LinkMarkupFilterTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/LinkMarkupFilterTest.java new file mode 100644 index 000000000000..3d04eec31108 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/asciidoc/LinkMarkupFilterTest.java @@ -0,0 +1,47 @@ +package org.openapitools.codegen.asciidoc; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import org.mockito.MockitoAnnotations; +import org.openapitools.codegen.languages.AsciidocDocumentationCodegen; +import org.openapitools.codegen.templating.mustache.LambdaTest; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import org.testng.Assert; + +public class LinkMarkupFilterTest extends LambdaTest { + + @BeforeMethod + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testLinkMarkupFilterDoesNotLinkMissingFile() { + + final AsciidocDocumentationCodegen generator = new AsciidocDocumentationCodegen(); + final Map ctx = context("link", generator.new LinkMarkupLambda("DOES_NOT_EXIST")); + + final String result = execute("{{#link}}not.an.existing.file.adoc{{/link}}", ctx); + Assert.assertTrue(result.contains("// file not found, no"), "unexpected filtered: " + result); + } + + @Test + public void testLinkMarkupFilterLinksFoundFileOk() throws IOException { + + File tempFile = File.createTempFile("LinkMarkupFilterTestDummyfile", ".adoc"); + tempFile.deleteOnExit(); + + final AsciidocDocumentationCodegen generator = new AsciidocDocumentationCodegen(); + final Map ctx = context("linkIntoMarkup", generator.new LinkMarkupLambda(tempFile.getParent())); + + final String result = execute("{{#linkIntoMarkup}}my link text, " + tempFile.getName() + "{{/linkIntoMarkup}}", + ctx); + Assert.assertTrue(result.contains("link:"), "unexpected filtered: " + result); + Assert.assertTrue(result.contains(tempFile.getName() + "[]"), "unexpected filtered: " + result); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java index 68271020ca83..a53037e0f8f2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java @@ -74,6 +74,7 @@ public void shouldSetConfiglProperties() throws IOException { .setAuth("test-auth") .setGitRepoId("git") .setGitUserId("user") + .setGitHost("test.com") .setGroupId("group") .setHttpUserAgent("agent") .setModelNamePrefix("model-prefix") @@ -108,6 +109,7 @@ public void shouldSetConfiglProperties() throws IOException { want(props, CodegenConstants.TEMPLATE_DIR, templateDir); want(props, CodegenConstants.GIT_REPO_ID, "git"); want(props, CodegenConstants.GIT_USER_ID, "user"); + want(props, CodegenConstants.GIT_HOST, "test.com"); want(props, CodegenConstants.GROUP_ID, "group"); want(props, CodegenConstants.ARTIFACT_ID, "test-artifactId"); want(props, CodegenConstants.ARTIFACT_VERSION, "test-artifactVersion"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/DynamicSettingsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/DynamicSettingsTest.java index 062f906743fc..5dd45a16a827 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/DynamicSettingsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/DynamicSettingsTest.java @@ -31,11 +31,12 @@ public void tesDynamicSettingsWithDynamicProperties() throws Exception { assertNotNull(workflowSettings); assertEquals(generatorSettings.getApiPackage(), "testing"); - assertEquals(generatorSettings.getAdditionalProperties().size(), 7); + assertEquals(generatorSettings.getAdditionalProperties().size(), 8); assertEquals(generatorSettings.getAdditionalProperties().get("gemName"), "petstore"); assertEquals(generatorSettings.getAdditionalProperties().get("moduleName"), "Petstore"); assertEquals(generatorSettings.getAdditionalProperties().get("gemVersion"), "1.0.0"); assertEquals(generatorSettings.getAdditionalProperties().get("apiPackage"), "testing"); + assertEquals(generatorSettings.getAdditionalProperties().get("gitHost"), "github.com"); assertEquals(generatorSettings.getAdditionalProperties().get("gitUserId"), "GIT_USER_ID"); assertEquals(generatorSettings.getAdditionalProperties().get("gitRepoId"), "GIT_REPO_ID"); assertEquals(generatorSettings.getAdditionalProperties().get("releaseNote"), "Minor update"); @@ -70,7 +71,8 @@ public void testDynamicSettingsWithBuilderSideEffects() throws Exception { assertEquals(workflowSettings.getTemplateDir(), current.getAbsolutePath()); assertNotEquals(workflowSettings.getTemplateDir(), input); - assertEquals(generatorSettings.getAdditionalProperties().size(), 3); + assertEquals(generatorSettings.getAdditionalProperties().size(), 4); + assertEquals(generatorSettings.getAdditionalProperties().get("gitHost"), "github.com"); assertEquals(generatorSettings.getAdditionalProperties().get("gitUserId"), "GIT_USER_ID"); assertEquals(generatorSettings.getAdditionalProperties().get("gitRepoId"), "GIT_REPO_ID"); assertEquals(generatorSettings.getAdditionalProperties().get("releaseNote"), "Minor update"); @@ -81,9 +83,11 @@ public void testDynamicSettingsSetsConstructorDefaultsOnDeserialization() throws ObjectMapper mapper = Yaml.mapper(); mapper.registerModule(new GuavaModule()); + String gitHost = "test.com"; String gitUserId = "openapitools"; String spec = "supportPython2: true" + System.lineSeparator() + + "gitHost: '" + gitHost + "'" + System.lineSeparator() + "gitUserId: '" + gitUserId + "'" + System.lineSeparator(); DynamicSettings dynamicSettings = mapper.readValue(spec, DynamicSettings.class); @@ -94,12 +98,14 @@ public void testDynamicSettingsSetsConstructorDefaultsOnDeserialization() throws assertNotNull(generatorSettings); assertNotNull(workflowSettings); + assertEquals(generatorSettings.getGitHost(), gitHost); assertEquals(generatorSettings.getGitUserId(), gitUserId); assertEquals(generatorSettings.getGitRepoId(), "GIT_REPO_ID"); assertEquals(generatorSettings.getReleaseNote(), "Minor update"); - assertEquals(generatorSettings.getAdditionalProperties().size(), 4); + assertEquals(generatorSettings.getAdditionalProperties().size(), 5); assertEquals(generatorSettings.getAdditionalProperties().get("supportPython2"), true); + assertEquals(generatorSettings.getAdditionalProperties().get("gitHost"), gitHost); assertEquals(generatorSettings.getAdditionalProperties().get("gitUserId"), gitUserId); assertEquals(generatorSettings.getAdditionalProperties().get("gitRepoId"), "GIT_REPO_ID"); assertEquals(generatorSettings.getAdditionalProperties().get("releaseNote"), "Minor update"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java index 491b4123044f..12281dc29f5d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java @@ -23,7 +23,10 @@ import org.testng.annotations.Test; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Arrays; +import java.lang.Exception; @SuppressWarnings("static-method") public class FSharpServerCodegenTest { @@ -32,37 +35,43 @@ public class FSharpServerCodegenTest { public void testModelsAreSortedAccordingToDependencyOrder() throws Exception { final AbstractFSharpCodegen codegen = new P_AbstractFSharpCodegen(); - // parent - final CodegenModel parent = new CodegenModel(); - CodegenProperty childProp = new CodegenProperty(); - childProp.complexType = "child"; - childProp.name = "child"; - parent.setVars(Collections.singletonList(childProp)); + final CodegenModel wheel = new CodegenModel(); + wheel.setImports(new HashSet(Arrays.asList())); + wheel.setClassname("wheel"); - final CodegenModel child = new CodegenModel(); - CodegenProperty carProp = new CodegenProperty(); - carProp.complexType = "car"; - carProp.name = "car"; - child.setVars(Collections.singletonList(carProp)); + final CodegenModel bike = new CodegenModel(); + bike.setImports(new HashSet(Arrays.asList("wheel"))); + bike.setClassname("bike"); + + final CodegenModel parent = new CodegenModel(); + parent.setImports(new HashSet(Arrays.asList("bike", "car"))); + parent.setClassname("parent"); - // child final CodegenModel car = new CodegenModel(); - CodegenProperty modelProp = new CodegenProperty(); - modelProp.name = "model"; - car.setVars(Collections.singletonList(modelProp)); + car.setImports(new HashSet(Arrays.asList("wheel"))); + car.setClassname("car"); + + final CodegenModel child = new CodegenModel(); + child.setImports(new HashSet(Arrays.asList("car", "bike", "parent"))); + child.setClassname("child"); Map models = new HashMap(); models.put("parent", Collections.singletonMap("models", Collections.singletonList(Collections.singletonMap("model", parent)))); models.put("child", Collections.singletonMap("models", Collections.singletonList(Collections.singletonMap("model", child)))); models.put("car", Collections.singletonMap("models", Collections.singletonList(Collections.singletonMap("model", car)))); + models.put("bike", Collections.singletonMap("models", Collections.singletonList(Collections.singletonMap("model", bike)))); + models.put("wheel", Collections.singletonMap("models", Collections.singletonList(Collections.singletonMap("model", wheel)))); Map sorted = codegen.postProcessDependencyOrders(models); Object[] keys = sorted.keySet().toArray(); - - Assert.assertEquals(keys[0], "car"); - Assert.assertEquals(keys[1], "child"); - Assert.assertEquals(keys[2], "parent"); + + Assert.assertTrue(keys[0] == "wheel"); + Assert.assertTrue(keys[1] == "bike" || keys[1] == "car"); + Assert.assertTrue(keys[2] == "bike" || keys[2] == "car"); + Assert.assertEquals(keys[3], "parent"); + Assert.assertEquals(keys[4], "child"); + } @Test(description = "modify model imports to explicit set namespace and package name") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index 634fcc455063..8a4d9cff6e61 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -50,6 +50,8 @@ protected void setExpectations() { times = 1; clientCodegen.setWithXml(GoClientOptionsProvider.WITH_XML_VALUE); times = 1; + clientCodegen.setWithXml(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE); + times = 1; clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); times = 1; clientCodegen.setIsGoSubmodule(Boolean.valueOf(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE)); 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 cd1cdbf6f8df..55cb8025f21e 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 @@ -18,6 +18,10 @@ package org.openapitools.codegen.java; import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; + import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.TestUtils; @@ -117,8 +121,11 @@ public void convertModelName() throws Exception { @Test public void testInitialConfigValues() throws Exception { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); @@ -129,17 +136,25 @@ public void testInitialConfigValues() throws Exception { Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "get"); + Assert.assertEquals(codegen.getArtifactVersion(), openAPI.getInfo().getVersion()); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), openAPI.getInfo().getVersion()); } @Test public void testSettersForConfigValues() throws Exception { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setHideGenerationTimestamp(true); codegen.setModelPackage("xyz.yyyyy.zzzzzzz.model"); codegen.setApiPackage("xyz.yyyyy.zzzzzzz.api"); codegen.setInvokerPackage("xyz.yyyyy.zzzzzzz.invoker"); codegen.setBooleanGetterPrefix("is"); + codegen.setArtifactVersion("0.9.0-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); @@ -150,17 +165,24 @@ public void testSettersForConfigValues() throws Exception { Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.invoker"); Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "is"); + Assert.assertEquals(codegen.getArtifactVersion(), "0.9.0-SNAPSHOT"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), "0.9.0-SNAPSHOT"); } @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.model.oooooo"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.api.oooooo"); codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.invoker.oooooo"); codegen.additionalProperties().put(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "getBoolean"); + codegen.additionalProperties().put(CodegenConstants.ARTIFACT_VERSION, "0.8.0-SNAPSHOT"); codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); @@ -171,6 +193,8 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.invoker.oooooo"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.invoker.oooooo"); Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "getBoolean"); + Assert.assertEquals(codegen.getArtifactVersion(), "0.8.0-SNAPSHOT"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), "0.8.0-SNAPSHOT"); } @Test @@ -302,6 +326,58 @@ public void snapshotVersionTest() { Assert.assertEquals(codegen.getArtifactVersion(), "1.0.0-SNAPSHOT"); } + @Test(description = "tests if default version with snapshot is used when OpenAPI version has been provided") + public void snapshotVersionOpenAPITest() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); + + OpenAPI api = TestUtils.createOpenAPI(); + api.getInfo().setVersion("2.0"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getArtifactVersion(), "2.0-SNAPSHOT"); + } + + @Test(description = "tests if default version with snapshot is used when setArtifactVersion is used") + public void snapshotVersionAlreadySnapshotTest() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + + codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); + + OpenAPI api = TestUtils.createOpenAPI(); + codegen.setArtifactVersion("4.1.2-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getArtifactVersion(), "4.1.2-SNAPSHOT"); + } + + @Test + public void toDefaultValueTest() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + + Schema schema = createObjectSchemaWithMinItems(); + String defaultValue = codegen.toDefaultValue(schema); + Assert.assertNull(defaultValue); + } + + @Test + public void getTypeDeclarationTest() { + final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + + Schema schema = createObjectSchemaWithMinItems(); + String defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "Object"); + } + + private static Schema createObjectSchemaWithMinItems() { + return new ObjectSchema() + .addProperties("id", new IntegerSchema().format("int32")) + .minItems(1); + } + private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { @Override public CodegenType getTag() { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index e26208de14c5..2f8a8d31c9ba 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.java; +import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; @@ -49,6 +50,7 @@ import org.openapitools.codegen.MockDefaultGenerator.WrittenTemplateBasedFile; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.languages.AbstractJavaCodegen; import org.openapitools.codegen.languages.JavaClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; @@ -149,6 +151,7 @@ public void testInitialConfigValues() throws Exception { Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.client.api"); Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.client"); + Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); } @Test @@ -158,6 +161,7 @@ public void testSettersForConfigValues() throws Exception { codegen.setModelPackage("xyz.yyyyy.zzzzzzz.model"); codegen.setApiPackage("xyz.yyyyy.zzzzzzz.api"); codegen.setInvokerPackage("xyz.yyyyy.zzzzzzz.invoker"); + codegen.setSerializationLibrary("JACKSON"); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); @@ -168,6 +172,7 @@ public void testSettersForConfigValues() throws Exception { Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.api"); Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.invoker"); + Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); // the library JavaClientCodegen.OKHTTP_GSON only supports GSON } @Test @@ -177,6 +182,8 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.zzzzzzz.aaaaa.api"); codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.zzzzzzz.iiii.invoker"); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "JACKSON"); + codegen.additionalProperties().put(CodegenConstants.LIBRARY, JavaClientCodegen.JERSEY2); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); @@ -187,6 +194,7 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa.api"); Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.iiii.invoker"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.iiii.invoker"); + Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); } @Test @@ -318,6 +326,8 @@ public void testGeneratePing() throws Exception { TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/StringUtil.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/test/java/xyz/abcdef/api/DefaultApiTest.java"); + validateJavaSourceFiles(generatedFiles); + String defaultApiFilename = new File(output, "src/main/java/xyz/abcdef/api/DefaultApi.java").getAbsolutePath().replace("\\", "/"); String defaultApiConent = generatedFiles.get(defaultApiFilename); assertTrue(defaultApiConent.contains("public class DefaultApi")); @@ -328,6 +338,116 @@ public void testGeneratePing() throws Exception { output.deleteOnExit(); } + @Test + public void testGeneratePingSomeObj() throws Exception { + Map properties = new HashMap<>(); + properties.put(JavaClientCodegen.JAVA8_MODE, true); + properties.put(CodegenConstants.MODEL_PACKAGE, "zz.yyyy.model.xxxx"); + properties.put(CodegenConstants.API_PACKAGE, "zz.yyyy.api.xxxx"); + properties.put(CodegenConstants.INVOKER_PACKAGE, "zz.yyyy.invoker.xxxx"); + properties.put(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "is"); + + File output = Files.createTempDirectory("test").toFile(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.OKHTTP_GSON) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(clientOptInput).generate(); + + Map generatedFiles = generator.getFiles(); + Assert.assertEquals(generatedFiles.size(), 37); + TestUtils.ensureContainsFile(generatedFiles, output, ".gitignore"); + TestUtils.ensureContainsFile(generatedFiles, output, ".openapi-generator-ignore"); + TestUtils.ensureContainsFile(generatedFiles, output, ".openapi-generator/VERSION"); + TestUtils.ensureContainsFile(generatedFiles, output, ".travis.yml"); + TestUtils.ensureContainsFile(generatedFiles, output, "build.gradle"); + TestUtils.ensureContainsFile(generatedFiles, output, "build.sbt"); + TestUtils.ensureContainsFile(generatedFiles, output, "docs/PingApi.md"); + TestUtils.ensureContainsFile(generatedFiles, output, "docs/SomeObj.md"); + TestUtils.ensureContainsFile(generatedFiles, output, "git_push.sh"); + TestUtils.ensureContainsFile(generatedFiles, output, "gradle.properties"); + TestUtils.ensureContainsFile(generatedFiles, output, "gradle/wrapper/gradle-wrapper.jar"); + TestUtils.ensureContainsFile(generatedFiles, output, "gradle/wrapper/gradle-wrapper.properties"); + TestUtils.ensureContainsFile(generatedFiles, output, "gradlew.bat"); + TestUtils.ensureContainsFile(generatedFiles, output, "gradlew"); + TestUtils.ensureContainsFile(generatedFiles, output, "pom.xml"); + TestUtils.ensureContainsFile(generatedFiles, output, "README.md"); + TestUtils.ensureContainsFile(generatedFiles, output, "settings.gradle"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/AndroidManifest.xml"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/api/xxxx/PingApi.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiCallback.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiClient.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiException.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiResponse.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/ApiKeyAuth.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/Authentication.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBasicAuth.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBearerAuth.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/Configuration.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/GzipRequestInterceptor.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/JSON.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/Pair.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ProgressRequestBody.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ProgressResponseBody.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/StringUtil.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/model/xxxx/SomeObj.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/test/java/zz/yyyy/api/xxxx/PingApiTest.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/test/java/zz/yyyy/model/xxxx/SomeObjTest.java"); + + validateJavaSourceFiles(generatedFiles); + + String defaultApiFilename = new File(output, "src/main/java/zz/yyyy/model/xxxx/SomeObj.java").getAbsolutePath().replace("\\", "/"); + String defaultApiConent = generatedFiles.get(defaultApiFilename); + assertTrue(defaultApiConent.contains("public class SomeObj")); + assertTrue(defaultApiConent.contains("Boolean isActive()")); + + output.deleteOnExit(); + } + + @Test + public void testJdkHttpClient() throws Exception { + Map properties = new HashMap<>(); + properties.put(JavaClientCodegen.JAVA8_MODE, true); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/ping.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(clientOptInput).generate(); + + Map generatedFiles = generator.getFiles(); + Assert.assertEquals(generatedFiles.size(), 23); + validateJavaSourceFiles(generatedFiles); + + String defaultApiFilename = new File(output, "src/main/java/xyz/abcdef/api/DefaultApi.java").getAbsolutePath().replace("\\", "/"); + String defaultApiContent = generatedFiles.get(defaultApiFilename); + assertTrue(defaultApiContent.contains("public class DefaultApi")); + assertTrue(defaultApiContent.contains("import java.net.http.HttpClient;")); + assertTrue(defaultApiContent.contains("import java.net.http.HttpRequest;")); + assertTrue(defaultApiContent.contains("import java.net.http.HttpResponse;")); + + String apiClientFilename = new File(output, "src/main/java/xyz/abcdef/ApiClient.java").getAbsolutePath().replace("\\", "/"); + String apiClientContent = generatedFiles.get(apiClientFilename); + assertTrue(apiClientContent.contains("public class ApiClient")); + assertTrue(apiClientContent.contains("import java.net.http.HttpClient;")); + assertTrue(apiClientContent.contains("import java.net.http.HttpRequest;")); + } + @Test public void testReferencedHeader() { final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue855.yaml"); 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 80bf59d12c2f..3b8d691fac91 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 @@ -32,9 +32,10 @@ public class JavaInheritanceTest { - @Test(description = "convert a composed model without discriminator") + + @Test(description = "convert a composed model with parent") public void javaInheritanceTest() { - final Schema allOfModel = new Schema().name("Base"); + final Schema parentModel = new Schema().name("Base"); final Schema schema = new ComposedSchema() .addAllOfItem(new Schema().$ref("Base")) @@ -42,7 +43,7 @@ public void javaInheritanceTest() { OpenAPI openAPI = TestUtils.createOpenAPI(); openAPI.setComponents(new Components() - .addSchemas(allOfModel.getName(), allOfModel) + .addSchemas(parentModel.getName(),parentModel) .addSchemas(schema.getName(), schema) ); @@ -52,7 +53,7 @@ public void javaInheritanceTest() { Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.parent, null); + Assert.assertEquals(cm.parent, "Base"); Assert.assertEquals(cm.imports, Sets.newHashSet("Base")); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java index e5a13ce839d3..7b26cd3bfdfe 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java @@ -23,6 +23,8 @@ import java.util.List; import java.util.Map; +import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; + /** * Unit-Test for {@link org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen}. * @@ -204,6 +206,7 @@ public void testGeneratePingDefaultLocation() throws Exception { generator.opts(clientOptInput).generate(); Map generatedFiles = generator.getFiles(); + validateJavaSourceFiles(generatedFiles); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/openapi/openapi.yaml"); output.deleteOnExit(); @@ -228,6 +231,7 @@ public void testGeneratePingNoSpecFile() throws Exception { generator.opts(clientOptInput).generate(); Map generatedFiles = generator.getFiles(); + validateJavaSourceFiles(generatedFiles); TestUtils.ensureDoesNotContainsFile(generatedFiles, output, "src/main/openapi/openapi.yaml"); output.deleteOnExit(); @@ -252,6 +256,7 @@ public void testGeneratePingAlternativeLocation1() throws Exception { generator.opts(clientOptInput).generate(); Map generatedFiles = generator.getFiles(); + validateJavaSourceFiles(generatedFiles); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/resources/META-INF/openapi.yaml"); output.deleteOnExit(); @@ -276,7 +281,34 @@ public void testGeneratePingAlternativeLocation2() throws Exception { generator.opts(clientOptInput).generate(); Map generatedFiles = generator.getFiles(); + validateJavaSourceFiles(generatedFiles); + TestUtils.ensureContainsFile(generatedFiles, output, "openapi.yml"); + + output.deleteOnExit(); + } + + @Test + public void testGenerateApiWithPreceedingPathParameter_issue1347() throws Exception { + Map properties = new HashMap<>(); + properties.put(JavaClientCodegen.JAVA8_MODE, true); + properties.put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "openapi.yml"); + + File output = Files.createTempDirectory("test").toFile(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jaxrs-spec") + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/issue_1347.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(clientOptInput).generate(); + + Map generatedFiles = generator.getFiles(); + validateJavaSourceFiles(generatedFiles); TestUtils.ensureContainsFile(generatedFiles, output, "openapi.yml"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/gen/java/org/openapitools/api/DefaultApi.java"); output.deleteOnExit(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 578b485e8d1c..378f7e5d8e07 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -167,6 +167,118 @@ public void doNotGenerateRequestParamForObjectQueryParam() throws IOException { checkFileNotContains(generator, outputPath + "/src/main/java/org/openapitools/api/PonyApi.java", "@RequestParam"); } + @Test + public void generateFormatForDateAndDateTimeQueryParam() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/issue_2053.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(input).generate(); + + checkFileContains( + generator, + outputPath + "/src/main/java/org/openapitools/api/ElephantsApi.java", + "@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE)" + ); + checkFileContains( + generator, + outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java", + "@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)" + ); + } + + @Test + public void shouldGenerateRequestParamForRefParams_3248_Regression() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/3248-regression.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.setOpenAPI(openAPI); + input.setConfig(codegen); + + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(input).generate(); + + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java", + "@RequestParam(value = \"format\"", + "@RequestParam(value = \"query\""); + } + + @Test + public void shouldGenerateRequestParamForRefParams_3248_RegressionDates() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/3248-regression-dates.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.setOpenAPI(openAPI); + input.setConfig(codegen); + + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(input).generate(); + + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java", + "@RequestParam(value = \"start\""); + } + + @Test + public void doGenerateRequestParamForSimpleParam() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/issue_3248.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(input).generate(); + + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/MonkeysApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/ElephantsApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/BearsApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/PandasApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/CrocodilesApi.java", "@RequestParam"); + checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/PolarBearsApi.java", "@RequestParam"); + + } + private void checkFileNotContains(MockDefaultGenerator generator, String path, String... lines) { String file = generator.getFiles().get(path); assertNotNull(file); @@ -174,6 +286,19 @@ private void checkFileNotContains(MockDefaultGenerator generator, String path, S assertFalse(file.contains(line)); } + private void checkFileContains(MockDefaultGenerator generator, String path, String... lines) { + String file = generator.getFiles().get(path); + assertNotNull(file); + int expectedCount = lines.length; + int actualCount = 0; + for (String line : lines) { + if (file.contains(line)) { + actualCount++; + } + } + assertEquals(actualCount, expectedCount, "File is missing " + (expectedCount - actualCount) + " expected lines."); + } + @Test public void clientOptsUnicity() { SpringCodegen codegen = new SpringCodegen(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/nim/NimClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/nim/NimClientCodegenTest.java new file mode 100644 index 000000000000..ea0ab8297b79 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/nim/NimClientCodegenTest.java @@ -0,0 +1,38 @@ +package org.openapitools.codegen.nim; + +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.NimClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class NimClientCodegenTest { + + @Test + public void testInitialConfigValues() throws Exception { + final NimClientCodegen codegen = new NimClientCodegen(); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); + } + + @Test + public void testSettersForConfigValues() throws Exception { + final NimClientCodegen codegen = new NimClientCodegen(); + codegen.setHideGenerationTimestamp(false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + } + + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + final NimClientCodegen codegen = new NimClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java index 39dc5d06ab80..28cba608cbbd 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java @@ -28,6 +28,7 @@ public class GoClientOptionsProvider implements OptionsProvider { public static final String PACKAGE_NAME_VALUE = "Go"; public static final boolean WITH_GO_CODEGEN_COMMENT_VALUE = true; public static final boolean WITH_XML_VALUE = true; + public static final boolean ENUM_CLASS_PREFIX_VALUE = true; public static final Boolean PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = true; public static final boolean IS_GO_SUBMODULE_VALUE = true; @@ -45,6 +46,7 @@ public Map createOptions() { .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.WITH_GO_CODEGEN_COMMENT, "true") .put(CodegenConstants.WITH_XML, "true") + .put(CodegenConstants.ENUM_CLASS_PREFIX, "true") .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true") .put(CodegenConstants.IS_GO_SUBMODULE, "true") .build(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/NimClientCodegenOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/NimClientCodegenOptionsProvider.java new file mode 100644 index 000000000000..24cad9416a5a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/NimClientCodegenOptionsProvider.java @@ -0,0 +1,31 @@ +package org.openapitools.codegen.options; + +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.NimClientCodegen; + +import com.google.common.collect.ImmutableMap; + +import java.util.Map; + +public class NimClientCodegenOptionsProvider implements OptionsProvider { + public static final String PROJECT_NAME_VALUE = "OpenAPI"; + + @Override + public String getLanguage() { + return "nim"; + } + + @Override + public Map createOptions() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + return builder + .put(NimClientCodegen.PROJECT_NAME, PROJECT_NAME_VALUE) + .build(); + } + + @Override + public boolean isServer() { + return false; + } +} + diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index 28cb99720881..03e26a8cff1f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -33,6 +33,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { private static final String NPM_REPOSITORY = "https://registry.npmjs.org"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String TYPESCRIPT_THREE_PLUS = "true"; @Override public String getLanguage() { @@ -52,6 +53,8 @@ public Map createOptions() { .put(TypeScriptFetchClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) .put(TypeScriptFetchClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString()) .put(TypeScriptFetchClientCodegen.USE_SINGLE_REQUEST_PARAMETER, Boolean.FALSE.toString()) + .put(TypeScriptFetchClientCodegen.PREFIX_PARAMETER_INTERFACES, Boolean.FALSE.toString()) + .put(TypeScriptFetchClientCodegen.TYPESCRIPT_THREE_PLUS, TYPESCRIPT_THREE_PLUS) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .build(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java index 922c8c4b5202..b7bd1c69a51a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java @@ -534,6 +534,9 @@ public void allOfCompositionTest() { // to test all properties Assert.assertEquals(superMan.getVars().size(), 6); + Assert.assertEquals(superMan.getAllVars().size(), 6); + Assert.assertEquals(superMan.getMandatory().size(), 3); + Assert.assertEquals(superMan.getAllMandatory().size(), 3); CodegenProperty cp0 = superMan.getVars().get(0); Assert.assertEquals(cp0.name, "id"); @@ -559,6 +562,30 @@ public void allOfCompositionTest() { Assert.assertEquals(cp5.name, "level"); Assert.assertTrue(cp5.required); + CodegenProperty cp6 = superMan.getAllVars().get(0); + Assert.assertEquals(cp6.name, "id"); + Assert.assertTrue(cp6.required); + + CodegenProperty cp7 = superMan.getAllVars().get(1); + Assert.assertEquals(cp7.name, "name"); + Assert.assertFalse(cp7.required); + + CodegenProperty cp8 = superMan.getAllVars().get(2); + Assert.assertEquals(cp8.name, "reward"); + Assert.assertFalse(cp8.required); + + CodegenProperty cp9 = superMan.getAllVars().get(3); + Assert.assertEquals(cp9.name, "origin"); + Assert.assertTrue(cp9.required); + + CodegenProperty cp10 = superMan.getAllVars().get(4); + Assert.assertEquals(cp10.name, "category"); + Assert.assertFalse(cp10.required); + + CodegenProperty cp11 = superMan.getAllVars().get(5); + Assert.assertEquals(cp11.name, "level"); + Assert.assertTrue(cp11.required); + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java index 25a861ba8a1f..9d3c52649864 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java @@ -18,17 +18,22 @@ package org.openapitools.codegen.scalaakka; import com.google.common.collect.Sets; +import com.google.common.io.Resources; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.ScalaAkkaClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.HashMap; +import java.util.Map; + public class ScalaAkkaClientCodegenTest { private ScalaAkkaClientCodegen scalaAkkaClientCodegen; @@ -276,4 +281,32 @@ public void mapModelTest() { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Map", "Children")).size(), 1); } + @Test(description = "validate codegen output") + public void codeGenerationTest() throws Exception { + Map properties = new HashMap<>(); + properties.put("mainPackage", "hello.world"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final DefaultCodegen codegen = new ScalaAkkaClientCodegen(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName(codegen.getName()) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/scala_reserved_words.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(clientOptInput).generate(); + + Map generatedFiles = generator.getFiles(); + Assert.assertEquals(generatedFiles.size(), 13); + + final String someObjFilename = new File(output, "src/main/scala/hello/world/model/SomeObj.scala").getAbsolutePath().replace("\\", "/"); + Assert.assertEquals( + generatedFiles.get(someObjFilename), + Resources.toString(Resources.getResource("codegen/scala/SomeObj.scala.txt"), StandardCharsets.UTF_8)); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java index ae9814bf5641..80629f717bd1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/serializer/SerializerUtilsTest.java @@ -20,6 +20,122 @@ public class SerializerUtilsTest { @Test public void testToYamlStringCompleteExample() throws Exception { + OpenAPI openAPI = createCompleteExample(); + + String content = SerializerUtils.toYamlString(openAPI); + String expected = "openapi: 3.0.1\n" + + "info:\n" + + " description: Some description\n" + + " title: Some title\n" + + "externalDocs:\n" + + " description: a-description\n" + + " url: http://abcdef.com\n" + + "servers:\n" + + "- description: first server\n" + + " url: http://www.server1.com\n" + + "- description: second server\n" + + " url: http://www.server2.com\n" + + "security:\n" + + "- some_auth:\n" + + " - write\n" + + " - read\n" + + "tags:\n" + + "- description: some 1 description\n" + + " name: tag1\n" + + "- description: some 2 description\n" + + " name: tag2\n" + + "- description: some 3 description\n" + + " name: tag3\n" + + "paths:\n" + + " /ping/pong:\n" + + " get:\n" + + " description: Some description\n" + + " operationId: pingOp\n" + + " responses:\n" + + " 200:\n" + + " description: Ok\n" + + "components:\n" + + " schemas:\n" + + " SomeObject:\n" + + " description: An Obj\n" + + " properties:\n" + + " id:\n" + + " type: string\n" + + " type: object\n" + + "x-custom: value1\n" + + "x-other: value2\n"; + assertEquals(content, expected); + } + + @Test + public void testToJsonStringCompleteExample() throws Exception { + OpenAPI openAPI = createCompleteExample(); + + String content = SerializerUtils.toJsonString(openAPI); + String expected = "" + + "{\n" + + " \"openapi\" : \"3.0.1\",\n" + + " \"info\" : {\n" + + " \"description\" : \"Some description\",\n" + + " \"title\" : \"Some title\"\n" + + " },\n" + + " \"externalDocs\" : {\n" + + " \"description\" : \"a-description\",\n" + + " \"url\" : \"http://abcdef.com\"\n" + + " },\n" + + " \"servers\" : [ {\n" + + " \"description\" : \"first server\",\n" + + " \"url\" : \"http://www.server1.com\"\n" + + " }, {\n" + + " \"description\" : \"second server\",\n" + + " \"url\" : \"http://www.server2.com\"\n" + + " } ],\n" + + " \"security\" : [ {\n" + + " \"some_auth\" : [ \"write\", \"read\" ]\n" + + " } ],\n" + + " \"tags\" : [ {\n" + + " \"description\" : \"some 1 description\",\n" + + " \"name\" : \"tag1\"\n" + + " }, {\n" + + " \"description\" : \"some 2 description\",\n" + + " \"name\" : \"tag2\"\n" + + " }, {\n" + + " \"description\" : \"some 3 description\",\n" + + " \"name\" : \"tag3\"\n" + + " } ],\n" + + " \"paths\" : {\n" + + " \"/ping/pong\" : {\n" + + " \"get\" : {\n" + + " \"description\" : \"Some description\",\n" + + " \"operationId\" : \"pingOp\",\n" + + " \"responses\" : {\n" + + " \"200\" : {\n" + + " \"description\" : \"Ok\"\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " },\n" + + " \"components\" : {\n" + + " \"schemas\" : {\n" + + " \"SomeObject\" : {\n" + + " \"description\" : \"An Obj\",\n" + + " \"properties\" : {\n" + + " \"id\" : {\n" + + " \"type\" : \"string\"\n" + + " }\n" + + " },\n" + + " \"type\" : \"object\"\n" + + " }\n" + + " }\n" + + " },\n" + + " \"x-custom\" : \"value1\",\n" + + " \"x-other\" : \"value2\"\n" + + "}"; + assertEquals(content, expected); + } + + private OpenAPI createCompleteExample() { OpenAPI openAPI = new OpenAPI(); openAPI.setInfo(new Info().title("Some title").description("Some description")); openAPI.setExternalDocs(new ExternalDocumentation().url("http://abcdef.com").description("a-description")); @@ -43,54 +159,62 @@ public void testToYamlStringCompleteExample() throws Exception { openAPI.setExtensions(new LinkedHashMap<>()); // required because swagger-core is using HashMap instead of LinkedHashMap internally. openAPI.addExtension("x-custom", "value1"); openAPI.addExtension("x-other", "value2"); + return openAPI; + } + + @Test + public void testToYamlStringMinimalExample() throws Exception { + OpenAPI openAPI = createMinimalExample(); String content = SerializerUtils.toYamlString(openAPI); - String expected = "openapi: 3.0.1\n" + - "info:\n" + - " description: Some description\n" + - " title: Some title\n" + - "externalDocs:\n" + - " description: a-description\n" + - " url: http://abcdef.com\n" + - "servers:\n" + - "- description: first server\n" + - " url: http://www.server1.com\n" + - "- description: second server\n" + - " url: http://www.server2.com\n" + - "security:\n" + - "- some_auth:\n" + - " - write\n" + - " - read\n" + - "tags:\n" + - "- description: some 1 description\n" + - " name: tag1\n" + - "- description: some 2 description\n" + - " name: tag2\n" + - "- description: some 3 description\n" + - " name: tag3\n" + - "paths:\n" + - " /ping/pong:\n" + - " get:\n" + - " description: Some description\n" + - " operationId: pingOp\n" + - " responses:\n" + - " 200:\n" + - " description: Ok\n" + - "components:\n" + - " schemas:\n" + - " SomeObject:\n" + - " description: An Obj\n" + - " properties:\n" + - " id:\n" + - " type: string\n" + - " type: object\n" + - "x-custom: value1\n" + - "x-other: value2\n"; + String expected = "openapi: 3.0.1\n" + + "info:\n" + + " title: Some title\n" + + "servers:\n" + + "- url: http://www.server1.com\n" + + "paths:\n" + + " /ping/pong:\n" + + " get:\n" + + " description: Some description\n" + + " operationId: pingOp\n" + + " responses:\n" + + " 200:\n" + + " description: Ok\n"; assertEquals(content, expected); } @Test - public void testToYamlStringMinimalExample() throws Exception { + public void testToJsonStringMinimalExample() throws Exception { + OpenAPI openAPI = createMinimalExample(); + + String content = SerializerUtils.toJsonString(openAPI); + String expected = "" + + "{\n" + + " \"openapi\" : \"3.0.1\",\n" + + " \"info\" : {\n" + + " \"title\" : \"Some title\"\n" + + " },\n" + + " \"servers\" : [ {\n" + + " \"url\" : \"http://www.server1.com\"\n" + + " } ],\n" + + " \"paths\" : {\n" + + " \"/ping/pong\" : {\n" + + " \"get\" : {\n" + + " \"description\" : \"Some description\",\n" + + " \"operationId\" : \"pingOp\",\n" + + " \"responses\" : {\n" + + " \"200\" : {\n" + + " \"description\" : \"Ok\"\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + " }\n" + + "}"; + assertEquals(content, expected); + } + + private OpenAPI createMinimalExample() { OpenAPI openAPI = new OpenAPI(); openAPI.setInfo(new Info().title("Some title")); openAPI.setServers(Arrays.asList( @@ -100,21 +224,6 @@ public void testToYamlStringMinimalExample() throws Exception { .description("Some description") .operationId("pingOp") .responses(new ApiResponses().addApiResponse("200", new ApiResponse().description("Ok"))))); - - String content = SerializerUtils.toYamlString(openAPI); - String expected = "openapi: 3.0.1\n" + - "info:\n" + - " title: Some title\n" + - "servers:\n" + - "- url: http://www.server1.com\n" + - "paths:\n" + - " /ping/pong:\n" + - " get:\n" + - " description: Some description\n" + - " operationId: pingOp\n" + - " responses:\n" + - " 200:\n" + - " description: Ok\n"; - assertEquals(content, expected); + return openAPI; } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java index fcf41ec08e37..66fc26a55bfa 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java @@ -50,6 +50,8 @@ protected void setExpectations() { times = 1; clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); times = 1; + clientCodegen.setTypescriptThreePlus(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.TYPESCRIPT_THREE_PLUS)); + times = 1; }}; } } diff --git a/modules/openapi-generator/src/test/resources/2_0/arrayRefBody.yaml b/modules/openapi-generator/src/test/resources/2_0/arrayRefBody.yaml new file mode 100644 index 000000000000..b4f176b0b657 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/arrayRefBody.yaml @@ -0,0 +1,52 @@ +swagger: '2.0' +info: + version: '' + title: arrayRefBody + contact: {} +host: www.example.com +basePath: / +schemes: + - https +consumes: + - application/json +produces: + - application/json +paths: + /examples: + post: + description: Create an array of inputs + summary: '' + tags: + - Examples + operationId: createExamples + produces: + - application/json + parameters: + - name: body + in: body + required: true + description: inputs description + schema: + type: array + items: + $ref: '#/definitions/Input' + responses: + 200: + description: successful operation + headers: {} +definitions: + Input: + title: Input + type: object + properties: + id: + type: string + age: + type: integer + format: int32 + dt: + type: string + format: date-time +tags: + - name: Examples + description: 'Example inputs' diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index ed907f27854e..9a7d4a03b4ae 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1041,6 +1041,53 @@ paths: responses: '200': description: Success + /fake/test-query-paramters: + put: + tags: + - fake + description: 'To test the collection format in query parameters' + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + type: array + items: + type: string + collectionFormat: pipe + - name: ioutil + in: query + required: true + type: array + items: + type: string + collectionFormat: tsv + - name: http + in: query + required: true + type: array + items: + type: string + collectionFormat: ssv + - name: url + in: query + required: true + type: array + items: + type: string + collectionFormat: csv + - name: context + in: query + required: true + type: array + items: + type: string + collectionFormat: multi + consumes: + - application/json + responses: + '200': + description: Success '/fake/{petId}/uploadImageWithRequiredFile': post: tags: @@ -1736,6 +1783,7 @@ definitions: required: - string_item - number_item + - float_item - integer_item - bool_item - array_item @@ -1746,6 +1794,10 @@ definitions: number_item: type: number example: 1.234 + float_item: + type: number + example: 1.234 + format: float integer_item: type: integer example: -2 diff --git a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml index d424cd93e968..fea5233ee269 100644 --- a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml @@ -906,6 +906,23 @@ paths: description: Output composite schema: $ref: '#/definitions/OuterComposite' + /fake/outer/enum: + post: + tags: + - fake + description: Test serialization of outer enum + operationId: fakeOuterEnumSerialize + parameters: + - name: body + in: body + description: Input enum as post body + schema: + $ref: '#/definitions/OuterEnum' + responses: + '200': + description: Output enum + schema: + $ref: '#/definitions/OuterEnum' /fake/jsonFormData: get: tags: @@ -1378,7 +1395,7 @@ definitions: minimum: 67.8 string: type: string - pattern: /[a-z]/i + pattern: /^[a-z]+$/i byte: type: string format: byte @@ -1721,6 +1738,8 @@ definitions: $ref: '#/definitions/OuterBoolean' OuterNumber: type: number + minimum: 10 + maximum: 20 OuterString: type: string OuterBoolean: diff --git a/modules/openapi-generator/src/test/resources/3_0/3248-regression-dates.yaml b/modules/openapi-generator/src/test/resources/3_0/3248-regression-dates.yaml new file mode 100644 index 000000000000..19a6b0e4ddc8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/3248-regression-dates.yaml @@ -0,0 +1,27 @@ +openapi: 3.0.2 +info: + title: info + description: info + version: 0.1.0 + +paths: + /example/api: + get: + summary: summary + description: description + parameters: + - name: start + in: query + schema: + type: string + format: date-time + required: true + description: The start time. + responses: + 200: + description: response + content: + application/json: + schema: + type: string + diff --git a/modules/openapi-generator/src/test/resources/3_0/3248-regression.yaml b/modules/openapi-generator/src/test/resources/3_0/3248-regression.yaml new file mode 100644 index 000000000000..623cfa03e27a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/3248-regression.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.2 +info: + title: info + description: info + version: 0.1.0 + +paths: + /example/api: + get: + summary: summary + description: description + parameters: + - $ref: '#/components/parameters/requiredQueryParam' + - $ref: '#/components/parameters/formatParam' + responses: + 200: + description: response + content: + application/json: + schema: + type: string + +components: + parameters: + requiredQueryParam: + description: set query + in: query + name: query + required: true + schema: + type: string + formatParam: + description: set format + in: query + name: format + required: false + schema: + $ref: '#/components/schemas/format' + + schemas: + format: + default: json + description: response format + enum: + - json + - csv + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/arrayRefBody.yaml b/modules/openapi-generator/src/test/resources/3_0/arrayRefBody.yaml new file mode 100644 index 000000000000..a77e4c308091 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/arrayRefBody.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + title: '' + version: '' +paths: + /examples: + post: + tags: + - Examples + summary: Get a list of transactions + operationId: getFilteredTransactions + responses: + default: + description: successful operation + requestBody: + description: subscription payload + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Input' +components: + schemas: + Input: + type: object + properties: + id: + type: string + age: + type: integer + format: int32 + dt: + type: string + format: date-time 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 new file mode 100644 index 000000000000..9a19658cc2ce --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/api-docs.json @@ -0,0 +1 @@ +{"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 diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/GET.json b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/GET.json new file mode 100644 index 000000000000..0538e0fb212c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/GET.json @@ -0,0 +1,16 @@ +{ + "id" : "238a47e3-2533-41a4-ac62-f6654c936ada", + "request" : { + "url" : "/rest/project/", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "[{\"id\":-3,\"name\":\"a third inactive project\",\"active\":false,\"projectLeads\":[{\"id\":-2,\"name\":\"another second lead\",\"userId\":\"tlead2\"},{\"id\":-1,\"name\":\"a first test lead and user\",\"userId\":\"tlead1\"}]},{\"id\":-2,\"name\":\"a second active project\",\"active\":true,\"projectLeads\":[{\"id\":-1,\"name\":\"a first test lead and user\",\"userId\":\"tlead1\"}]},{\"id\":-1,\"name\":\"a first active project\",\"active\":true,\"projectLeads\":[{\"id\":-2,\"name\":\"another second lead\",\"userId\":\"tlead2\"},{\"id\":-1,\"name\":\"a first test lead and user\",\"userId\":\"tlead1\"}]}]", + "headers" : { + "Vary" : [ "Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers" ], + "Content-Type" : "application/json" + } + }, + "uuid" : "238a47e3-2533-41a4-ac62-f6654c936ada" +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/curl-request.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/curl-request.adoc new file mode 100644 index 000000000000..340a97532bc8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/curl-request.adoc @@ -0,0 +1,4 @@ +[source,bash] +---- +$ curl 'http://samplehost.timeatwork.manathome.org:8080/rest/project/' -i -X GET +---- \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/http-request.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/http-request.adoc new file mode 100644 index 000000000000..aeffcec0116b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/http-request.adoc @@ -0,0 +1,6 @@ +[source,http,options="nowrap"] +---- +GET /rest/project/ HTTP/1.1 +Host: samplehost.timeatwork.manathome.org:8080 + +---- \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/http-response.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/http-response.adoc new file mode 100644 index 000000000000..15f6735316dd --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/http-response.adoc @@ -0,0 +1,11 @@ +[source,http,options="nowrap"] +---- +HTTP/1.1 200 OK +Vary: Origin +Vary: Access-Control-Request-Method +Vary: Access-Control-Request-Headers +Content-Type: application/json;charset=UTF-8 +Content-Length: 530 + +[{"id":-3,"name":"a third inactive project","active":false,"projectLeads":[{"id":-1,"name":"a first test lead and user","userId":"tlead1"},{"id":-2,"name":"another second lead","userId":"tlead2"}]},{"id":-2,"name":"a second active project","active":true,"projectLeads":[{"id":-1,"name":"a first test lead and user","userId":"tlead1"}]},{"id":-1,"name":"a first active project","active":true,"projectLeads":[{"id":-1,"name":"a first test lead and user","userId":"tlead1"},{"id":-2,"name":"another second lead","userId":"tlead2"}]}] +---- \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/httpie-request.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/httpie-request.adoc new file mode 100644 index 000000000000..55a176514cb5 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/httpie-request.adoc @@ -0,0 +1,4 @@ +[source,bash] +---- +$ http GET 'http://samplehost.timeatwork.manathome.org:8080/rest/project/' +---- \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/request-body.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/request-body.adoc new file mode 100644 index 000000000000..dab5f81d2fba --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/request-body.adoc @@ -0,0 +1,4 @@ +[source,options="nowrap"] +---- + +---- \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/response-body.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/response-body.adoc new file mode 100644 index 000000000000..5383ea167bf8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/generated-snippets/rest/project/GET/response-body.adoc @@ -0,0 +1,4 @@ +[source,options="nowrap"] +---- +[{"id":-3,"name":"a third inactive project","active":false,"projectLeads":[{"id":-1,"name":"a first test lead and user","userId":"tlead1"},{"id":-2,"name":"another second lead","userId":"tlead2"}]},{"id":-2,"name":"a second active project","active":true,"projectLeads":[{"id":-1,"name":"a first test lead and user","userId":"tlead1"}]},{"id":-1,"name":"a first active project","active":true,"projectLeads":[{"id":-1,"name":"a first test lead and user","userId":"tlead1"},{"id":-2,"name":"another second lead","userId":"tlead2"}]}] +---- \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/specs/rest/project/GET/implementation.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/specs/rest/project/GET/implementation.adoc new file mode 100644 index 000000000000..2713f95e67a9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/specs/rest/project/GET/implementation.adoc @@ -0,0 +1,2 @@ + +// optional, conditionally included implementation notes. \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/asciidoc/specs/rest/project/GET/spec.adoc b/modules/openapi-generator/src/test/resources/3_0/asciidoc/specs/rest/project/GET/spec.adoc new file mode 100644 index 000000000000..b916c8d6bc6d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/asciidoc/specs/rest/project/GET/spec.adoc @@ -0,0 +1,7 @@ +// spec to include + +* all _projects_ visible for the _current user_ are returned +* _projects_ may be active or closed + +USER: project lead, admin + diff --git a/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml b/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml index 7ea9df41ba69..4d10bef6205c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml @@ -293,6 +293,40 @@ paths: responses: '200': description: OK + /callback: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + callbackUri: + type: string + responses: + 201: + headers: + Location: + description: Contains the URI of the newly created resource + schema: + type: string + callbacks: + webhook: + '{$request.body#/callbackUri}': + post: + operationId: webhookNotify + requestBody: + content: + application/json: + schema: + type: object + properties: + notificationId: + type: string + action: + type: string + data: + type: string components: schemas: Users: diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_1347.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_1347.yaml new file mode 100644 index 000000000000..01d2ce6a025b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_1347.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.2 +info: + title: Name demo + version: 1.0 +paths: + /{country}/document: + get: + summary: Get a document + tags: + - document + operationId: getDocument + parameters: + - name: country + in: path + required: true + schema: + type: string + responses: + "201": + description: The document + "500": + description: Server error +tags: +- name: document + description: Document tag \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_2053.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_2053.yaml new file mode 100644 index 000000000000..9f59ab621cac --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_2053.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.0 +servers: + - url: 'localhost:8080' +info: + version: 1.0.0 + title: OpenAPI Zoo + license: + name: Apache-2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +paths: + /elephants: + get: + operationId: getElephants + parameters: + - in: query + name: startDate + schema: + type: string + format: date + /zebras: + get: + operationId: getZebras + parameters: + - in: query + name: startDateTime + schema: + type: string + format: date-time \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_3248.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_3248.yaml new file mode 100644 index 000000000000..14a9d61659f3 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_3248.yaml @@ -0,0 +1,121 @@ +openapi: 3.0.0 +servers: + - url: 'localhost:8080' +info: + version: 1.0.0 + title: OpenAPI Zoo + license: + name: Apache-2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +paths: + /monkeys: + get: + operationId: getMonkeys + parameters: + - $ref: '#/components/parameters/refDate' + /elephants: + get: + operationId: getElephants + parameters: + - in: query + name: someDate + required: true + schema: + type: string + format: date + /girafes: + get: + operationId: getGirafes + parameters: + - $ref: '#/components/parameters/refStatus' + /zebras: + get: + operationId: getZebras + parameters: + - in: query + name: status + required: true + schema: + type: integer + enum: [0,1] + default: 0 + /bears: + get: + operationId: getBears + parameters: + - $ref: '#/components/parameters/refCondition' + /camels: + get: + operationId: getCamels + parameters: + - in: query + name: condition + required: true + schema: + type: string + enum: + - sleeping + - awake + /pandas: + get: + operationId: getPandas + parameters: + - $ref: '#/components/parameters/refName' + /crocodiles: + get: + operationId: getCrocodiles + parameters: + - in: query + name: name + required: true + schema: + type: string + /polarBears: + get: + operationId: getPolarBears + parameters: + - $ref: '#/components/parameters/refAge' + /birds: + get: + operationId: getBirds + parameters: + - in: query + name: age + required: true + schema: + type: integer +components: + parameters: + refDate: + in: query + name: refDate + required: true + schema: + type: string + format: date + refStatus: + in: query + name: refStatus + required: true + schema: + type: integer + enum: [0,1] + default: 0 + refCondition: + in: query + name: refCondition + schema: + type: string + enum: + - sleeping + - awake + refName: + in: query + name: refName + schema: + type: string + refAge: + in: query + name: refAge + schema: + type: integer diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 42c3d46a8b83..f6f35356afc3 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -989,6 +989,57 @@ paths: schema: $ref: '#/components/schemas/FileSchemaTestClass' required: true + /fake/test-query-paramters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success '/fake/{petId}/uploadImageWithRequiredFile': post: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/pingSomeObj.yaml b/modules/openapi-generator/src/test/resources/3_0/pingSomeObj.yaml new file mode 100644 index 000000000000..6e274775a742 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/pingSomeObj.yaml @@ -0,0 +1,45 @@ +openapi: 3.0.1 +info: + title: ping some object + version: '1.0' +servers: + - url: 'http://localhost:8082/' +paths: + /ping: + post: + operationId: postPing + tags: + - ping + requestBody: + content: + 'application/json': + schema: + $ref: "#/components/schemas/SomeObj" + responses: + '200': + description: OK + content: + 'application/json': + schema: + $ref: "#/components/schemas/SomeObj" +components: + schemas: + SomeObj: + type: object + properties: + $_type: + type: string + # using 'enum' & 'default' for '$_type' is a work-around until constants are supported + # See https://github.com/OAI/OpenAPI-Specification/issues/1313 + enum: + - SomeObjIdentifier + default: SomeObjIdentifier + id: + type: integer + format: int64 + name: + type: string + active: + type: boolean + type: + type: string 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 cef3e746ba0c..661961cd9778 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,28 @@ paths: responses: '200': description: 'OK' + /responses_with_headers: + get: + responses: + '200': + description: 'Success' + content: + 'application/json': + schema: + type: String + headers: + Success-Info: + schema: + type: String + '412': + description: Precondition Failed + headers: + Further-Info: + schema: + type: String + Failure-Info: + schema: + type: String components: schemas: UuidObject: diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml new file mode 100644 index 000000000000..861e84ca8d4e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml @@ -0,0 +1,31 @@ +openapi: 3.0.1 +info: + title: Rust client test spec + description: Special testing for the Rust client generator + version: 1.0.7 +paths: + /dummy: + get: + summary: A dummy endpoint to make the spec valid. + responses: + '200': + description: Success +components: + schemas: + TypeTesting: + description: Test handling of differing types (see \#3463) + type: object + properties: + integer: + type: integer + long: + type: long + number: + type: number + float: + type: float + double: + type: double + uuid: + type: string + format: uuid diff --git a/modules/openapi-generator/src/test/resources/3_0/scala_reserved_words.yaml b/modules/openapi-generator/src/test/resources/3_0/scala_reserved_words.yaml new file mode 100644 index 000000000000..f91139e7aaef --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/scala_reserved_words.yaml @@ -0,0 +1,88 @@ +openapi: 3.0.1 +info: + title: ping some object + version: '1.0' +servers: + - url: 'http://localhost:8082/' +paths: + /ping: + post: + operationId: postPing + tags: + - ping + requestBody: + content: + 'application/json': + schema: + $ref: "#/components/schemas/SomeObj" + responses: + '200': + description: OK + content: + 'application/json': + schema: + $ref: "#/components/schemas/SomeObj" +components: + schemas: + SomeObj: + type: object + properties: + $_type: + type: string + # using 'enum' & 'default' for '$_type' is a work-around until constants are supported + # See https://github.com/OAI/OpenAPI-Specification/issues/1313 + enum: + - SomeObjIdentifier + default: SomeObjIdentifier + id: + type: integer + format: int64 + name: + type: string + val: + type: string + var: + type: string + class: + type: string + trait: + type: string + object: + type: string + try: + type: string + catch: + type: string + finally: + type: string + def: + type: string + for: + type: string + implicit: + type: string + match: + type: string + case: + type: string + import: + type: string + lazy: + type: string + private: + type: string + type: + type: string + foobar: + type: boolean + created_at: + type: string + format: date-time + required: + - id + - try + - catch + - finally + - lazy + - foobar + - created_at diff --git a/modules/openapi-generator/src/test/resources/codegen/scala/SomeObj.scala.txt b/modules/openapi-generator/src/test/resources/codegen/scala/SomeObj.scala.txt new file mode 100644 index 000000000000..52725e7e1236 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/codegen/scala/SomeObj.scala.txt @@ -0,0 +1,51 @@ +/** + * ping some object + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 hello.world.model + +import hello.world.core.ApiModel +import org.joda.time.DateTime +import java.util.UUID + +case class SomeObj ( + `type`: Option[SomeObjEnums.`Type`] = None, + id: Long, + name: Option[String] = None, + `val`: Option[String] = None, + `var`: Option[String] = None, + `class`: Option[String] = None, + `trait`: Option[String] = None, + `object`: Option[String] = None, + `try`: String, + `catch`: String, + `finally`: String, + `def`: Option[String] = None, + `for`: Option[String] = None, + `implicit`: Option[String] = None, + `match`: Option[String] = None, + `case`: Option[String] = None, + `import`: Option[String] = None, + `lazy`: String, + `private`: Option[String] = None, + `type`: Option[String] = None, + foobar: Boolean, + createdAt: DateTime +) extends ApiModel + +object SomeObjEnums { + + type `Type` = `Type`.Value + object `Type` extends Enumeration { + val SomeObjIdentifier = Value("SomeObjIdentifier") + } + +} + diff --git a/pom.xml b/pom.xml index 95bc5ec70584..08ce843360aa 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT https://github.com/openapitools/openapi-generator @@ -188,7 +188,7 @@ maven-compiler-plugin - 3.8.0 + 3.8.1 1.8 1.8 @@ -843,6 +843,18 @@ samples/client/petstore/typescript-fetch/builds/with-npm-version + + typescript-fetch-client-builds-prefix-parameter-interfaces + + + env + java + + + + samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces + + typescript-angularjs-client @@ -1024,13 +1036,9 @@ samples/client/petstore/c - samples/client/petstore/cpp-qt5 - - + samples/client/petstore/elm-0.18 samples/client/petstore/rust - samples/client/petstore/rust-reqwest samples/client/petstore/php/OpenAPIClient-php samples/openapi3/client/petstore/php/OpenAPIClient-php @@ -1050,7 +1058,8 @@ samples/client/petstore/typescript-fetch/builds/es6-target samples/client/petstore/typescript-fetch/builds/with-npm-version samples/client/petstore/typescript-fetch/tests/default - samples/client/petstore/typescript-axios/tests/default + samples/client/petstore/typescript-node/npm samples/client/petstore/typescript-rxjs/builds/with-npm-version - v2.0 - .NETStandard + netstandard2.0 512 bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml
@@ -36,6 +34,4 @@ The version of the OpenAPI document: 1.0.0 - - diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.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/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index 8ed98381beed..78b126b56416 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md index 0fd0f4dad716..2eaab420f32e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | @@ -956,3 +957,78 @@ No authorization required [[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) + +# **TestQueryParameterCollectionFormat** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<string>**](string.md)| | + **ioutil** | [**List<string>**](string.md)| | + **http** | [**List<string>**](string.md)| | + **url** | [**List<string>**](string.md)| | + **context** | [**List<string>**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TypeHolderExample.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TypeHolderExample.md index c1b5b77f9604..f78185c2aa04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TypeHolderExample.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | **NumberItem** | **decimal** | | +**FloatItem** | **float** | | **IntegerItem** | **int** | | **BoolItem** | **bool** | | **ArrayItem** | **List<int>** | | diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/git_push.sh b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/git_push.sh index 4d22bfef4d71..ced3be2b0c7b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/git_push.sh +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/git_push.sh @@ -1,11 +1,17 @@ #!/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-petstore-perl "minor update" +# 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" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index b6c5620b8bce..87ac6e219c27 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -139,7 +139,7 @@ public AnotherFakeApi(Org.OpenAPITools.Client.Configuration configuration) } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 8b68bb522b3d..da7a53072e41 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -354,6 +354,35 @@ public interface IFakeApiSync : IApiAccessor /// field2 /// ApiResponse of Object(void) ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Synchronous Operations } @@ -690,6 +719,35 @@ public interface IFakeApiAsync : IApiAccessor /// field2 /// Task of ApiResponse System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Asynchronous Operations } @@ -751,7 +809,7 @@ public FakeApi(Org.OpenAPITools.Client.Configuration configuration) } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access. @@ -2754,5 +2812,261 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st return response; } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + { + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'http' is set + if (http == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'url' is set + if (url == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'context' is set + if (context == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + String[] @contentTypes = new String[] { + }; + + // to determine the Accept header + String[] @accepts = new String[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(@contentTypes); + if (localVarContentType != null) requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); + if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (pipe != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (ioutil != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (http != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (url != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (context != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + + + // make the HTTP request + + var response = this.Client.Put("/fake/test-query-paramters", requestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", response); + if (exception != null) throw exception; + } + + return response; + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + { + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'http' is set + if (http == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'url' is set + if (url == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'context' is set + if (context == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + + Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + String[] @contentTypes = new String[] { + }; + + // to determine the Accept header + String[] @accepts = new String[] { + }; + + foreach (var contentType in @contentTypes) + requestOptions.HeaderParameters.Add("Content-Type", contentType); + + foreach (var accept in @accepts) + requestOptions.HeaderParameters.Add("Accept", accept); + + if (pipe != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (ioutil != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (http != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (url != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (context != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + + + // make the HTTP request + + var response = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", requestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", response); + if (exception != null) throw exception; + } + + return response; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 43c4ea339bc4..43b9d6062622 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -139,7 +139,7 @@ public FakeClassnameTags123Api(Org.OpenAPITools.Client.Configuration configurati } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs index 58bb5c88425d..c50fa8ad1f8a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -261,7 +261,7 @@ public StoreApi(Org.OpenAPITools.Client.Configuration configuration) } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs index dc22cbd1b492..0bc4e77768a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs @@ -437,7 +437,7 @@ public UserApi(Org.OpenAPITools.Client.Configuration configuration) } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// using a Configuration object and client instance. /// /// The client interface for synchronous API access. 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 05c50bceac02..f68650fa7bc9 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 @@ -321,7 +321,7 @@ private RestRequest newRequest( request.RequestFormat = DataFormat.Json; } - request.AddBody(options.Data); + request.AddJsonBody(options.Data); } if (options.FileParameters != null) @@ -331,9 +331,9 @@ private RestRequest newRequest( var bytes = ClientUtils.ReadAsBytes(fileParam.Value); var fileStream = fileParam.Value as FileStream; if (fileStream != null) - FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); else - FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided"); + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); } } 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 4317d59a9394..4c0720e504ad 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 @@ -400,7 +400,7 @@ public static IReadableConfiguration MergeConfigurations(IReadableConfiguration { ApiKey = apiKey, ApiKeyPrefix = apiKeyPrefix, - DefaultHeader = defaultHeaders, + DefaultHeaders = defaultHeaders, BasePath = second.BasePath ?? first.BasePath, Timeout = second.Timeout, UserAgent = second.UserAgent ?? first.UserAgent, diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs index 2a069436de4b..800b1c47631b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs @@ -30,6 +30,26 @@ public class Multimap : IDictionary> #endregion Private Fields + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new ConcurrentDictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) { + _dictionary = new ConcurrentDictionary>(comparer); + } + + #endregion Constructors + #region Enumerators /// @@ -71,21 +91,44 @@ public void Clear() _dictionary.Clear(); } + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. public bool Contains(KeyValuePair> item) { throw new NotImplementedException(); } + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented public void CopyTo(KeyValuePair>[] array, int arrayIndex) { throw new NotImplementedException(); } + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented public bool Remove(KeyValuePair> item) { throw new NotImplementedException(); } + /// + /// Gets the number of items contained in the Multimap. + /// public int Count { get @@ -94,6 +137,9 @@ public int Count } } + /// + /// Gets a value indicating whether the Multimap is read-only. + /// public bool IsReadOnly { get @@ -102,6 +148,12 @@ public bool IsReadOnly } } + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. public void Add(T key, IList value) { if (value != null && value.Count > 0) @@ -120,22 +172,47 @@ public void Add(T key, IList value) } } + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. public bool ContainsKey(T key) { return _dictionary.ContainsKey(key); } + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. public bool Remove(T key) { IList list; return TryRemove(key, out list); } + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. public bool TryGetValue(T key, out IList value) { return _dictionary.TryGetValue(key, out value); } + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. public IList this[T key] { get @@ -145,6 +222,9 @@ public IList this[T key] set { _dictionary[key] = value; } } + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// public ICollection Keys { get @@ -153,6 +233,9 @@ public ICollection Keys } } + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// public ICollection> Values { get @@ -161,11 +244,24 @@ public ICollection> Values } } + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. public void CopyTo(Array array, int index) { ((ICollection) _dictionary).CopyTo(array, index); } + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. public void Add(T key, TValue value) { if (value != null) @@ -190,7 +286,7 @@ public void Add(T key, TValue value) #region Private Members /** - * Helper method to encapsulate generator differences between dictioary types. + * Helper method to encapsulate generator differences between dictionary types. */ private bool TryRemove(T key, out IList value) { @@ -199,7 +295,7 @@ private bool TryRemove(T key, out IList value) } /** - * Helper method to encapsulate generator differences between dictioary types. + * Helper method to encapsulate generator differences between dictionary types. */ private bool TryAdd(T key, IList value) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs index 9a1df28e4a71..42043170e6a2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -42,10 +42,11 @@ protected TypeHolderExample() { } /// /// stringItem (required). /// numberItem (required). + /// floatItem (required). /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), float floatItem = default(float), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -67,6 +68,16 @@ protected TypeHolderExample() { } this.NumberItem = numberItem; } + // to ensure "floatItem" is required (not null) + if (floatItem == null) + { + throw new InvalidDataException("floatItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.FloatItem = floatItem; + } + // to ensure "integerItem" is required (not null) if (integerItem == null) { @@ -111,6 +122,12 @@ protected TypeHolderExample() { } [DataMember(Name="number_item", EmitDefaultValue=false)] public decimal NumberItem { get; set; } + /// + /// Gets or Sets FloatItem + /// + [DataMember(Name="float_item", EmitDefaultValue=false)] + public float FloatItem { get; set; } + /// /// Gets or Sets IntegerItem /// @@ -139,6 +156,7 @@ public override string ToString() sb.Append("class TypeHolderExample {\n"); sb.Append(" StringItem: ").Append(StringItem).Append("\n"); sb.Append(" NumberItem: ").Append(NumberItem).Append("\n"); + sb.Append(" FloatItem: ").Append(FloatItem).Append("\n"); sb.Append(" IntegerItem: ").Append(IntegerItem).Append("\n"); sb.Append(" BoolItem: ").Append(BoolItem).Append("\n"); sb.Append(" ArrayItem: ").Append(ArrayItem).Append("\n"); @@ -187,6 +205,7 @@ public override int GetHashCode() if (this.StringItem != null) hashCode = hashCode * 59 + this.StringItem.GetHashCode(); hashCode = hashCode * 59 + this.NumberItem.GetHashCode(); + hashCode = hashCode * 59 + this.FloatItem.GetHashCode(); hashCode = hashCode * 59 + this.IntegerItem.GetHashCode(); hashCode = hashCode * 59 + this.BoolItem.GetHashCode(); if (this.ArrayItem != null) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 77d93cd21994..fbf4cc7af1ac 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -3,8 +3,6 @@ false netcoreapp2.0 - v2.0 - .NETCoreApp Org.OpenAPITools Org.OpenAPITools Library diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.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/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index dcdb39631c54..7bd9201f88b7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -119,6 +119,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 2738b9e1853d..a295fe0554f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | @@ -1034,3 +1035,84 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<string>**](string.md)| | + **ioutil** | [**List<string>**](string.md)| | + **http** | [**List<string>**](string.md)| | + **url** | [**List<string>**](string.md)| | + **context** | [**List<string>**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md index e92681b8cba4..b9573673baf6 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | **NumberItem** | **decimal** | | +**FloatItem** | **float** | | **IntegerItem** | **int** | | **BoolItem** | **bool** | | **ArrayItem** | **List<int>** | | diff --git a/samples/client/petstore/csharp/OpenAPIClient/git_push.sh b/samples/client/petstore/csharp/OpenAPIClient/git_push.sh index 4d22bfef4d71..ced3be2b0c7b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/git_push.sh +++ b/samples/client/petstore/csharp/OpenAPIClient/git_push.sh @@ -1,11 +1,17 @@ #!/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-petstore-perl "minor update" +# 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" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index b352cdd30cfc..bc14d5e90f57 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -351,6 +351,35 @@ public interface IFakeApi : IApiAccessor /// field2 /// ApiResponse of Object(void) ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -680,6 +709,35 @@ public interface IFakeApi : IApiAccessor /// field2 /// Task of ApiResponse System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Asynchronous Operations } @@ -2826,5 +2884,182 @@ public async System.Threading.Tasks.Task> TestJsonFormDataAs null); } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + { + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'http' is set + if (http == null) + throw new ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'url' is set + if (url == null) + throw new ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'context' is set + if (context == null) + throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + var localVarPath = "/fake/test-query-paramters"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter + if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter + if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + { + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'http' is set + if (http == null) + throw new ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'url' is set + if (url == null) + throw new ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'context' is set + if (context == null) + throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + var localVarPath = "/fake/test-query-paramters"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter + if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter + if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 216469e1c8b9..973dc3ec597b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -202,6 +202,7 @@ public async System.Threading.Tasks.Task CallApiAsync( var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, contentType); + RestClient.UserAgent = Configuration.UserAgent; InterceptRequest(request); var response = await RestClient.ExecuteTaskAsync(request); InterceptResponse(request, response); diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs index 384b5dbbc958..f72c763b0397 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -40,10 +40,11 @@ protected TypeHolderExample() { } /// /// stringItem (required). /// numberItem (required). + /// floatItem (required). /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), float floatItem = default(float), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -65,6 +66,16 @@ protected TypeHolderExample() { } this.NumberItem = numberItem; } + // to ensure "floatItem" is required (not null) + if (floatItem == null) + { + throw new InvalidDataException("floatItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.FloatItem = floatItem; + } + // to ensure "integerItem" is required (not null) if (integerItem == null) { @@ -109,6 +120,12 @@ protected TypeHolderExample() { } [DataMember(Name="number_item", EmitDefaultValue=false)] public decimal NumberItem { get; set; } + /// + /// Gets or Sets FloatItem + /// + [DataMember(Name="float_item", EmitDefaultValue=false)] + public float FloatItem { get; set; } + /// /// Gets or Sets IntegerItem /// @@ -137,6 +154,7 @@ public override string ToString() sb.Append("class TypeHolderExample {\n"); sb.Append(" StringItem: ").Append(StringItem).Append("\n"); sb.Append(" NumberItem: ").Append(NumberItem).Append("\n"); + sb.Append(" FloatItem: ").Append(FloatItem).Append("\n"); sb.Append(" IntegerItem: ").Append(IntegerItem).Append("\n"); sb.Append(" BoolItem: ").Append(BoolItem).Append("\n"); sb.Append(" ArrayItem: ").Append(ArrayItem).Append("\n"); @@ -184,6 +202,11 @@ public bool Equals(TypeHolderExample input) (this.NumberItem != null && this.NumberItem.Equals(input.NumberItem)) ) && + ( + this.FloatItem == input.FloatItem || + (this.FloatItem != null && + this.FloatItem.Equals(input.FloatItem)) + ) && ( this.IntegerItem == input.IntegerItem || (this.IntegerItem != null && @@ -215,6 +238,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.StringItem.GetHashCode(); if (this.NumberItem != null) hashCode = hashCode * 59 + this.NumberItem.GetHashCode(); + if (this.FloatItem != null) + hashCode = hashCode * 59 + this.FloatItem.GetHashCode(); if (this.IntegerItem != null) hashCode = hashCode * 59 + this.IntegerItem.GetHashCode(); if (this.BoolItem != null) 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 83a328a9227e..0e97bd19efbf 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 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/git_push.sh b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/git_push.sh index 83553a63a416..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/git_push.sh +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/git_push.sh @@ -1,11 +1,17 @@ #!/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 swagger-petstore "minor update" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart-jaguar/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart index d077b86fe99b..25e2d9b0b109 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart @@ -1,6 +1,6 @@ library openapi.api; -import 'package:http/io_client.dart'; +import 'package:http/http.dart' as http; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; import 'package:openapi/auth/api_key_auth.dart'; @@ -47,7 +47,7 @@ class Openapi { * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) */ Openapi({List interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -122,4 +122,4 @@ class Openapi { } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart index 80ea0cb8e5cd..f21ccb3c9cad 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'package:openapi/model/pet.dart'; import 'package:openapi/model/api_response.dart'; -import 'dart:typed_data'; part 'pet_api.jretro.dart'; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/api_response.dart index a50380840418..7282e058587b 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/api_response.dart @@ -5,13 +5,13 @@ part 'api_response.jser.dart'; class ApiResponse { - @Alias('code') + @Alias('code', isNullable: false, ) final int code; - @Alias('type') + @Alias('type', isNullable: false, ) final String type; - @Alias('message') + @Alias('message', isNullable: false, ) final String message; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/category.dart index 74d4c1b73b21..8a48730d0d2a 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/category.dart @@ -5,10 +5,10 @@ part 'category.jser.dart'; class Category { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('name') + @Alias('name', isNullable: false, ) final String name; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/order.dart index 5cec761dc14f..b0d18aea5f06 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/order.dart @@ -5,22 +5,24 @@ part 'order.jser.dart'; class Order { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('petId') + @Alias('petId', isNullable: false, ) final int petId; - @Alias('quantity') + @Alias('quantity', isNullable: false, ) final int quantity; - @Alias('shipDate') + @Alias('shipDate', isNullable: false, ) final DateTime shipDate; /* Order Status */ - @Alias('status') + @Alias('status', isNullable: false, + + ) final String status; //enum statusEnum { placed, approved, delivered, }; - @Alias('complete') + @Alias('complete', isNullable: false, ) final bool complete; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/pet.dart index b74866151139..ea1be521e2dd 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/pet.dart @@ -9,22 +9,24 @@ part 'pet.jser.dart'; class Pet { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('category') + @Alias('category', isNullable: false, ) final Category category; - @Alias('name') + @Alias('name', isNullable: false, ) final String name; - @Alias('photoUrls') + @Alias('photoUrls', isNullable: false, ) final List photoUrls; - @Alias('tags') + @Alias('tags', isNullable: false, ) final List tags; /* pet status in the store */ - @Alias('status') + @Alias('status', isNullable: false, + + ) final String status; //enum statusEnum { available, pending, sold, }; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/tag.dart index 4ddc8b834af9..15416bfca165 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/tag.dart @@ -5,10 +5,10 @@ part 'tag.jser.dart'; class Tag { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('name') + @Alias('name', isNullable: false, ) final String name; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/user.dart index e8d48c6f9b6f..4973bfafb2ee 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/model/user.dart @@ -5,28 +5,28 @@ part 'user.jser.dart'; class User { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('username') + @Alias('username', isNullable: false, ) final String username; - @Alias('firstName') + @Alias('firstName', isNullable: false, ) final String firstName; - @Alias('lastName') + @Alias('lastName', isNullable: false, ) final String lastName; - @Alias('email') + @Alias('email', isNullable: false, ) final String email; - @Alias('password') + @Alias('password', isNullable: false, ) final String password; - @Alias('phone') + @Alias('phone', isNullable: false, ) final String phone; /* User Status */ - @Alias('userStatus') + @Alias('userStatus', isNullable: false, ) final int userStatus; diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml index 2cd5cf8768a3..8383211f4376 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml @@ -4,9 +4,9 @@ description: OpenAPI API client environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.8.2' - jaguar_serializer: '^2.2.6' + jaguar_retrofit: ^2.8.8 + jaguar_serializer: ^2.2.12 dev_dependencies: - jaguar_retrofit_gen: '^2.8.5' - jaguar_serializer_cli: '^2.2.5' - build_runner: '^1.1.1' \ No newline at end of file + jaguar_retrofit_gen: ^2.8.10 + jaguar_serializer_cli: ^2.2.8 + build_runner: ^1.6.5 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 83a328a9227e..0e97bd19efbf 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 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/git_push.sh b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/git_push.sh index 83553a63a416..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/git_push.sh +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/git_push.sh @@ -1,11 +1,17 @@ #!/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 swagger-petstore "minor update" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart index 60148b8f5849..20bc79c61b86 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart @@ -1,6 +1,6 @@ library openapi.api; -import 'package:http/io_client.dart'; +import 'package:http/http.dart' as http; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_serializer_protobuf/proto_repo.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; @@ -57,7 +57,7 @@ class Openapi { * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) */ Openapi({List interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -132,4 +132,4 @@ class Openapi { } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api/pet_api.dart index 7c584151763d..bebfb876a27d 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api/pet_api.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'package:openapi/model/pet.pb.dart'; import 'package:openapi/model/api_response.pb.dart'; -import 'dart:typed_data'; part 'pet_api.jretro.dart'; diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/pubspec.yaml index 39b3af4b4cd8..94a77f5993f9 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/pubspec.yaml @@ -4,9 +4,9 @@ description: OpenAPI API client environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.8.2' - jaguar_serializer_protobuf: '^2.2.2' - jaguar_mimetype: '^1.0.1' + jaguar_retrofit: ^2.8.8 + jaguar_serializer_protobuf: ^2.2.2 + jaguar_mimetype: ^1.0.1 dev_dependencies: - jaguar_retrofit_gen: '^2.8.5' - build_runner: '^1.1.1' \ No newline at end of file + jaguar_retrofit_gen: ^2.8.10 + build_runner: ^1.6.5 diff --git a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION index 83a328a9227e..0e97bd19efbf 100644 --- a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi/git_push.sh b/samples/client/petstore/dart-jaguar/openapi/git_push.sh index 83553a63a416..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart-jaguar/openapi/git_push.sh +++ b/samples/client/petstore/dart-jaguar/openapi/git_push.sh @@ -1,11 +1,17 @@ #!/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 swagger-petstore "minor update" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart-jaguar/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart index d077b86fe99b..25e2d9b0b109 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart @@ -1,6 +1,6 @@ library openapi.api; -import 'package:http/io_client.dart'; +import 'package:http/http.dart' as http; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; import 'package:openapi/auth/api_key_auth.dart'; @@ -47,7 +47,7 @@ class Openapi { * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) */ Openapi({List interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -122,4 +122,4 @@ class Openapi { } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart index 80ea0cb8e5cd..f21ccb3c9cad 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'package:openapi/model/pet.dart'; import 'package:openapi/model/api_response.dart'; -import 'dart:typed_data'; part 'pet_api.jretro.dart'; diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/model/api_response.dart b/samples/client/petstore/dart-jaguar/openapi/lib/model/api_response.dart index a50380840418..7282e058587b 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/model/api_response.dart @@ -5,13 +5,13 @@ part 'api_response.jser.dart'; class ApiResponse { - @Alias('code') + @Alias('code', isNullable: false, ) final int code; - @Alias('type') + @Alias('type', isNullable: false, ) final String type; - @Alias('message') + @Alias('message', isNullable: false, ) final String message; diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/model/category.dart b/samples/client/petstore/dart-jaguar/openapi/lib/model/category.dart index 74d4c1b73b21..8a48730d0d2a 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/model/category.dart @@ -5,10 +5,10 @@ part 'category.jser.dart'; class Category { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('name') + @Alias('name', isNullable: false, ) final String name; diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/model/order.dart b/samples/client/petstore/dart-jaguar/openapi/lib/model/order.dart index 5cec761dc14f..b0d18aea5f06 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/model/order.dart @@ -5,22 +5,24 @@ part 'order.jser.dart'; class Order { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('petId') + @Alias('petId', isNullable: false, ) final int petId; - @Alias('quantity') + @Alias('quantity', isNullable: false, ) final int quantity; - @Alias('shipDate') + @Alias('shipDate', isNullable: false, ) final DateTime shipDate; /* Order Status */ - @Alias('status') + @Alias('status', isNullable: false, + + ) final String status; //enum statusEnum { placed, approved, delivered, }; - @Alias('complete') + @Alias('complete', isNullable: false, ) final bool complete; diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/model/pet.dart b/samples/client/petstore/dart-jaguar/openapi/lib/model/pet.dart index b74866151139..ea1be521e2dd 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/model/pet.dart @@ -9,22 +9,24 @@ part 'pet.jser.dart'; class Pet { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('category') + @Alias('category', isNullable: false, ) final Category category; - @Alias('name') + @Alias('name', isNullable: false, ) final String name; - @Alias('photoUrls') + @Alias('photoUrls', isNullable: false, ) final List photoUrls; - @Alias('tags') + @Alias('tags', isNullable: false, ) final List tags; /* pet status in the store */ - @Alias('status') + @Alias('status', isNullable: false, + + ) final String status; //enum statusEnum { available, pending, sold, }; diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/model/tag.dart b/samples/client/petstore/dart-jaguar/openapi/lib/model/tag.dart index 4ddc8b834af9..15416bfca165 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/model/tag.dart @@ -5,10 +5,10 @@ part 'tag.jser.dart'; class Tag { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('name') + @Alias('name', isNullable: false, ) final String name; diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/model/user.dart b/samples/client/petstore/dart-jaguar/openapi/lib/model/user.dart index e8d48c6f9b6f..4973bfafb2ee 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/model/user.dart @@ -5,28 +5,28 @@ part 'user.jser.dart'; class User { - @Alias('id') + @Alias('id', isNullable: false, ) final int id; - @Alias('username') + @Alias('username', isNullable: false, ) final String username; - @Alias('firstName') + @Alias('firstName', isNullable: false, ) final String firstName; - @Alias('lastName') + @Alias('lastName', isNullable: false, ) final String lastName; - @Alias('email') + @Alias('email', isNullable: false, ) final String email; - @Alias('password') + @Alias('password', isNullable: false, ) final String password; - @Alias('phone') + @Alias('phone', isNullable: false, ) final String phone; /* User Status */ - @Alias('userStatus') + @Alias('userStatus', isNullable: false, ) final int userStatus; diff --git a/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml b/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml index 2cd5cf8768a3..8383211f4376 100644 --- a/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml +++ b/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml @@ -4,9 +4,9 @@ description: OpenAPI API client environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.8.2' - jaguar_serializer: '^2.2.6' + jaguar_retrofit: ^2.8.8 + jaguar_serializer: ^2.2.12 dev_dependencies: - jaguar_retrofit_gen: '^2.8.5' - jaguar_serializer_cli: '^2.2.5' - build_runner: '^1.1.1' \ No newline at end of file + jaguar_retrofit_gen: ^2.8.10 + jaguar_serializer_cli: ^2.2.8 + build_runner: ^1.6.5 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 83a328a9227e..0e97bd19efbf 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 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/git_push.sh b/samples/client/petstore/dart-jaguar/openapi_proto/git_push.sh index 83553a63a416..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/git_push.sh +++ b/samples/client/petstore/dart-jaguar/openapi_proto/git_push.sh @@ -1,11 +1,17 @@ #!/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 swagger-petstore "minor update" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart-jaguar/openapi_proto/lib/api.dart b/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart index 60148b8f5849..20bc79c61b86 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart @@ -1,6 +1,6 @@ library openapi.api; -import 'package:http/io_client.dart'; +import 'package:http/http.dart' as http; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_serializer_protobuf/proto_repo.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; @@ -57,7 +57,7 @@ class Openapi { * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) */ Openapi({List interceptors, bool overrideInterceptors = false, String baseUrl, this.timeout = const Duration(minutes: 2)}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? http.Client()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -132,4 +132,4 @@ class Openapi { } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/openapi_proto/lib/api/pet_api.dart index 7c584151763d..bebfb876a27d 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-jaguar/openapi_proto/lib/api/pet_api.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'package:openapi/model/pet.pb.dart'; import 'package:openapi/model/api_response.pb.dart'; -import 'dart:typed_data'; part 'pet_api.jretro.dart'; diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/pubspec.yaml b/samples/client/petstore/dart-jaguar/openapi_proto/pubspec.yaml index 39b3af4b4cd8..94a77f5993f9 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/pubspec.yaml +++ b/samples/client/petstore/dart-jaguar/openapi_proto/pubspec.yaml @@ -4,9 +4,9 @@ description: OpenAPI API client environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.8.2' - jaguar_serializer_protobuf: '^2.2.2' - jaguar_mimetype: '^1.0.1' + jaguar_retrofit: ^2.8.8 + jaguar_serializer_protobuf: ^2.2.2 + jaguar_mimetype: ^1.0.1 dev_dependencies: - jaguar_retrofit_gen: '^2.8.5' - build_runner: '^1.1.1' \ No newline at end of file + jaguar_retrofit_gen: ^2.8.10 + build_runner: ^1.6.5 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 83a328a9227e..0e97bd19efbf 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 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml index d0758bc9f0d6..82b19541fa43 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "1.24.3" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index ae7f6ea5e876..8520a219f887 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -44,13 +44,13 @@ Please follow the [installation procedure](#installation--usage) and then run th import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var pet = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(pet); + api_instance.addPet(body); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -89,8 +89,6 @@ Class | Method | HTTP request | Description - [ApiResponse](docs//ApiResponse.md) - [Category](docs//Category.md) - - [InlineObject](docs//InlineObject.md) - - [InlineObject1](docs//InlineObject1.md) - [Order](docs//Order.md) - [Pet](docs//Pet.md) - [Tag](docs//Tag.md) @@ -106,12 +104,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header -## auth_cookie - -- **Type**: API key -- **API key parameter name**: AUTH_KEY -- **Location**: - ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md index 2d01917ec270..5780e7f38022 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **addPet** -> addPet(pet) +> addPet(body) Add a new pet to the store @@ -28,13 +28,13 @@ Add a new pet to the store ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var pet = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(pet); + api_instance.addPet(body); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -70,9 +70,9 @@ Deletes a pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -116,9 +116,9 @@ Multiple status values can be provided with comma separated strings ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -151,7 +151,7 @@ Name | Type | Description | Notes [[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) # **findPetsByTags** -> List findPetsByTags(tags, maxCount) +> List findPetsByTags(tags) Finds Pets by tags @@ -161,14 +161,13 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var tags = []; // List | Tags to filter by -var maxCount = 56; // int | Maximum number of items to return try { - var result = api_instance.findPetsByTags(tags, maxCount); + var result = api_instance.findPetsByTags(tags); print(result); } catch (e) { print("Exception when calling PetApi->findPetsByTags: $e\n"); @@ -180,7 +179,6 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] - **maxCount** | **int**| Maximum number of items to return | [optional] [default to null] ### Return type @@ -208,11 +206,11 @@ Returns a single pet ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return try { @@ -245,7 +243,7 @@ Name | Type | Description | Notes [[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) # **updatePet** -> updatePet(pet) +> updatePet(body) Update an existing pet @@ -253,13 +251,13 @@ Update an existing pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var pet = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(pet); + api_instance.updatePet(body); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -269,7 +267,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -295,9 +293,9 @@ Updates a pet in the store with form data ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -341,9 +339,9 @@ uploads an image ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md index 4a501766d3cd..df76647f11ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = StoreApi(); +var api_instance = new StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -68,11 +68,11 @@ Returns a map of status codes to quantities ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = StoreApi(); +var api_instance = new StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = StoreApi(); +var api_instance = new StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -144,7 +144,7 @@ No authorization required [[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) # **placeOrder** -> Order placeOrder(order) +> Order placeOrder(body) Place an order for a pet @@ -152,11 +152,11 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = StoreApi(); -var order = Order(); // Order | order placed for purchasing the pet +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(order); + var result = api_instance.placeOrder(body); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -167,7 +167,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -179,7 +179,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/xml, application/json [[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) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md index 4a9e433e25f8..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(user) +> createUser(body) Create user @@ -29,16 +29,12 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); -var user = User(); // User | Created user object +var api_instance = new UserApi(); +var body = new User(); // User | Created user object try { - api_instance.createUser(user); + api_instance.createUser(body); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -48,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -56,33 +52,29 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **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) # **createUsersWithArrayInput** -> createUsersWithArrayInput(user) +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); -var user = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(user); + api_instance.createUsersWithArrayInput(body); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -92,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -100,33 +92,29 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **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) # **createUsersWithListInput** -> createUsersWithListInput(user) +> createUsersWithListInput(body) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); -var user = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(user); + api_instance.createUsersWithListInput(body); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -136,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -144,11 +132,11 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **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) @@ -163,12 +151,8 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -190,7 +174,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -208,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -249,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -291,12 +275,8 @@ Logs out current logged in user session ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); +var api_instance = new UserApi(); try { api_instance.logoutUser(); @@ -314,7 +294,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -324,7 +304,7 @@ void (empty response body) [[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) # **updateUser** -> updateUser(username, user) +> updateUser(username, body) Updated user @@ -333,17 +313,13 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var user = User(); // User | Updated user object +var body = new User(); // User | Updated user object try { - api_instance.updateUser(username, user); + api_instance.updateUser(username, body); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -354,7 +330,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -362,11 +338,11 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **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) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/git_push.sh b/samples/client/petstore/dart/flutter_petstore/openapi/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/git_push.sh +++ b/samples/client/petstore/dart/flutter_petstore/openapi/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 675ff37a46b8..9a64a5342b4a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -18,12 +18,10 @@ part 'api/user_api.dart'; part 'model/api_response.dart'; part 'model/category.dart'; -part 'model/inline_object.dart'; -part 'model/inline_object1.dart'; part 'model/order.dart'; part 'model/pet.dart'; part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = ApiClient(); +ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 1210fa617a19..6ffc146490b8 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet pet) async { - Object postBody = pet; + Future addPet(Pet body) async { + Object postBody = body; // verify required params are set - if(pet == null) { - throw ApiException(400, "Missing required param: pet"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -60,11 +60,11 @@ class PetApi { /// /// Future deletePet(int petId, { String apiKey }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -78,12 +78,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -110,11 +110,11 @@ class PetApi { /// /// Multiple status values can be provided with comma separated strings Future> findPetsByStatus(List status) async { - Object postBody; + Object postBody = null; // verify required params are set if(status == null) { - throw ApiException(400, "Missing required param: status"); + throw new ApiException(400, "Missing required param: status"); } // create path and map variables @@ -128,12 +128,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -160,12 +160,12 @@ class PetApi { /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags, { int maxCount }) async { - Object postBody; + Future> findPetsByTags(List tags) async { + Object postBody = null; // verify required params are set if(tags == null) { - throw ApiException(400, "Missing required param: tags"); + throw new ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -176,18 +176,15 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); - if(maxCount != null) { - queryParams.addAll(_convertParametersForCollectionFormat("", "maxCount", maxCount)); - } List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -204,7 +201,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -215,11 +212,11 @@ class PetApi { /// /// Returns a single pet Future getPetById(int petId) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -232,12 +229,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -254,7 +251,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -264,12 +261,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet pet) async { - Object postBody = pet; + Future updatePet(Pet body) async { + Object postBody = body; // verify required params are set - if(pet == null) { - throw ApiException(400, "Missing required param: pet"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -282,12 +279,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -304,7 +301,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -314,11 +311,11 @@ class PetApi { /// /// Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -331,12 +328,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -365,7 +362,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -375,11 +372,11 @@ class PetApi { /// /// Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -392,12 +389,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -425,7 +422,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index f21b5ce98a61..7475aa4d9901 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -11,11 +11,11 @@ class StoreApi { /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors Future deleteOrder(String orderId) async { - Object postBody; + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -60,7 +60,7 @@ class StoreApi { /// /// Returns a map of status codes to quantities Future> getInventory() async { - Object postBody; + Object postBody = null; // verify required params are set @@ -74,12 +74,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -108,11 +108,11 @@ class StoreApi { /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future getOrderById(int orderId) async { - Object postBody; + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -125,12 +125,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -157,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order order) async { - Object postBody = order; + Future placeOrder(Order body) async { + Object postBody = body; // verify required params are set - if(order == null) { - throw ApiException(400, "Missing required param: order"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -173,14 +173,14 @@ class StoreApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index f7d7e41f8df2..8f00081a8c4c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User user) async { - Object postBody = user; + Future createUser(User body) async { + Object postBody = body; // verify required params are set - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -26,14 +26,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -59,12 +59,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List user) async { - Object postBody = user; + Future createUsersWithArrayInput(List body) async { + Object postBody = body; // verify required params are set - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -75,14 +75,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -108,12 +108,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List user) async { - Object postBody = user; + Future createUsersWithListInput(List body) async { + Object postBody = body; // verify required params are set - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -124,14 +124,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -158,11 +158,11 @@ class UserApi { /// /// This can only be done by the logged in user. Future deleteUser(String username) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -175,12 +175,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -207,11 +207,11 @@ class UserApi { /// /// Future getUserByName(String username) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -224,12 +224,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -257,14 +257,14 @@ class UserApi { /// /// Future loginUser(String username, String password) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(password == null) { - throw ApiException(400, "Missing required param: password"); + throw new ApiException(400, "Missing required param: password"); } // create path and map variables @@ -279,12 +279,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -312,7 +312,7 @@ class UserApi { /// /// Future logoutUser() async { - Object postBody; + Object postBody = null; // verify required params are set @@ -326,12 +326,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -357,15 +357,15 @@ class UserApi { /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User user) async { - Object postBody = user; + Future updateUser(String username, User body) async { + Object postBody = body; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -376,14 +376,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; 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 e35c37c020c7..b99ddeeccb19 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 @@ -10,19 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = Client(); + var client = new Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); + final _RegList = new RegExp(r'^List<(.*)>$'); + final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = ApiKeyAuth("header", "api_key"); - _authentications['auth_cookie'] = ApiKeyAuth("query", "AUTH_KEY"); - _authentications['petstore_auth'] = OAuth(); + _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new OAuth(); } void addDefaultHeader(String key, String value) { @@ -41,40 +40,36 @@ class ApiClient { case 'double': return value is double ? value : double.parse('$value'); case 'ApiResponse': - return ApiResponse.fromJson(value); + return new ApiResponse.fromJson(value); case 'Category': - return Category.fromJson(value); - case 'InlineObject': - return InlineObject.fromJson(value); - case 'InlineObject1': - return InlineObject1.fromJson(value); + return new Category.fromJson(value); case 'Order': - return Order.fromJson(value); + return new Order.fromJson(value); case 'Pet': - return Pet.fromJson(value); + return new Pet.fromJson(value); case 'Tag': - return Tag.fromJson(value); + return new Tag.fromJson(value); case 'User': - return User.fromJson(value); + return new User.fromJson(value); default: { Match match; if (value is List && - (match = _regList.firstMatch(targetType)) != null) { + (match = _RegList.firstMatch(targetType)) != null) { var newTargetType = match[1]; return value.map((v) => _deserialize(v, newTargetType)).toList(); } else if (value is Map && - (match = _regMap.firstMatch(targetType)) != null) { + (match = _RegMap.firstMatch(targetType)) != null) { var newTargetType = match[1]; - return Map.fromIterables(value.keys, + return new Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } catch (e, stack) { + throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw ApiException(500, 'Could not find a suitable class for deserialization'); + throw new ApiException(500, 'Could not find a suitable class for deserialization'); } dynamic deserialize(String json, String targetType) { @@ -83,7 +78,7 @@ class ApiClient { if (targetType == 'String') return json; - var decodedJson = jsonDecode(json); + var decodedJson = JSON.decode(json); return _deserialize(decodedJson, targetType); } @@ -92,7 +87,7 @@ class ApiClient { if (obj == null) { serialized = ''; } else { - serialized = json.encode(obj); + serialized = JSON.encode(obj); } return serialized; } @@ -124,7 +119,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -153,14 +148,16 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index 668abe2c96bc..f188fd125a4d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String message = null; + Exception innerException = null; + StackTrace stackTrace = null; ApiException(this.code, this.message); @@ -17,7 +17,7 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: $innerException)\n\n" + + return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + stackTrace.toString(); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index c57b111ca87d..9c1497017e80 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart @@ -11,7 +11,7 @@ Iterable _convertParametersForCollectionFormat( if (name == null || name.isEmpty || value == null) return params; if (value is! List) { - params.add(QueryParam(name, parameterToString(value))); + params.add(new QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); + return values.map((v) => new QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index 8384f0516ce2..f9617f7ae4da 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart @@ -4,24 +4,22 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String _apiKey; + String apiKey; String apiKeyPrefix; - set apiKey(String key) => _apiKey = key; - ApiKeyAuth(this.location, this.paramName); @override void applyToParams(List queryParams, Map headerParams) { String value; if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $_apiKey'; + value = '$apiKeyPrefix $apiKey'; } else { - value = _apiKey; + value = apiKey; } if (location == 'query' && value != null) { - queryParams.add(QueryParam(paramName, value)); + queryParams.add(new QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index da931fa2634c..4e77ddcf6e68 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -2,15 +2,13 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String _username; - String _password; + String username; + String password; @override void applyToParams(List queryParams, Map headerParams) { - String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); - headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams["Authorization"] = "Basic " + BASE64.encode(UTF8.encode(str)); } - set username(String username) => _username = username; - set password(String password) => _password = password; -} +} \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 230471e44fc6..13bfd799743b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,16 +1,19 @@ part of openapi.api; class OAuth implements Authentication { - String _accessToken; + String accessToken; - OAuth({String accessToken}) : _accessToken = accessToken; + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; } } - set accessToken(String accessToken) => _accessToken = accessToken; + void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index be01c2de8195..f2fddde347ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -19,39 +19,36 @@ class ApiResponse { if (json['code'] == null) { code = null; } else { - code = json['code']; + code = json['code']; } if (json['type'] == null) { type = null; } else { - type = json['type']; + type = json['type']; } if (json['message'] == null) { message = null; } else { - message = json['message']; + message = json['message']; } } Map toJson() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; + return { + 'code': code, + 'type': type, + 'message': message + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 696468a16191..1750c6a0acb1 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -17,32 +17,30 @@ class Category { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart index e2a59c2ca40f..91e9c7d11756 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart @@ -2,9 +2,9 @@ part of openapi.api; class InlineObject { /* Updated name of the pet */ - String name = null; + String name = null; /* Updated status of the pet */ - String status = null; + String status = null; InlineObject(); @override @@ -14,16 +14,8 @@ class InlineObject { InlineObject.fromJson(Map json) { if (json == null) return; - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } + name = json['name']; + status = json['status']; } Map toJson() { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart index eba9610c5567..6f5f3a426c31 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart @@ -2,9 +2,9 @@ part of openapi.api; class InlineObject1 { /* Additional data to pass to server */ - String additionalMetadata = null; + String additionalMetadata = null; /* file to upload */ - MultipartFile file = null; + MultipartFile file = null; InlineObject1(); @override @@ -14,16 +14,10 @@ class InlineObject1 { InlineObject1.fromJson(Map json) { if (json == null) return; - if (json['additionalMetadata'] == null) { - additionalMetadata = null; - } else { - additionalMetadata = json['additionalMetadata']; - } - if (json['file'] == null) { - file = null; - } else { - file = File.fromJson(json['file']); - } + additionalMetadata = json['additionalMetadata']; + file = (json['file'] == null) ? + null : + File.fromJson(json['file']); } Map toJson() { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index be5a12e1ed19..51d15f730415 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -26,17 +26,17 @@ class Order { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['petId'] == null) { petId = null; } else { - petId = json['petId']; + petId = json['petId']; } if (json['quantity'] == null) { quantity = null; } else { - quantity = json['quantity']; + quantity = json['quantity']; } if (json['shipDate'] == null) { shipDate = null; @@ -46,40 +46,34 @@ class Order { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } if (json['complete'] == null) { complete = null; } else { - complete = json['complete']; + complete = json['complete']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (petId != null) - json['petId'] = petId; - if (quantity != null) - json['quantity'] = quantity; - if (shipDate != null) - json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); - if (status != null) - json['status'] = status; - if (complete != null) - json['complete'] = complete; - return json; + return { + 'id': id, + 'petId': petId, + 'quantity': quantity, + 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), + 'status': status, + 'complete': complete + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index 4f19829878aa..c64406368d87 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -26,22 +26,22 @@ class Pet { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['category'] == null) { category = null; } else { - category = Category.fromJson(json['category']); + category = new Category.fromJson(json['category']); } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } if (json['photoUrls'] == null) { photoUrls = null; } else { - photoUrls = (json['photoUrls'] as List).cast(); + photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); } if (json['tags'] == null) { tags = null; @@ -51,35 +51,29 @@ class Pet { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (category != null) - json['category'] = category; - if (name != null) - json['name'] = name; - if (photoUrls != null) - json['photoUrls'] = photoUrls; - if (tags != null) - json['tags'] = tags; - if (status != null) - json['status'] = status; - return json; + return { + 'id': id, + 'category': category, + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags, + 'status': status + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index a3485e5d3c63..980c6e016302 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -17,32 +17,30 @@ class Tag { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 48f061d969b1..1555eb0a3ef5 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -29,74 +29,66 @@ class User { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['username'] == null) { username = null; } else { - username = json['username']; + username = json['username']; } if (json['firstName'] == null) { firstName = null; } else { - firstName = json['firstName']; + firstName = json['firstName']; } if (json['lastName'] == null) { lastName = null; } else { - lastName = json['lastName']; + lastName = json['lastName']; } if (json['email'] == null) { email = null; } else { - email = json['email']; + email = json['email']; } if (json['password'] == null) { password = null; } else { - password = json['password']; + password = json['password']; } if (json['phone'] == null) { phone = null; } else { - phone = json['phone']; + phone = json['phone']; } if (json['userStatus'] == null) { userStatus = null; } else { - userStatus = json['userStatus']; + userStatus = json['userStatus']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (username != null) - json['username'] = username; - if (firstName != null) - json['firstName'] = firstName; - if (lastName != null) - json['lastName'] = lastName; - if (email != null) - json['email'] = email; - if (password != null) - json['password'] = password; - if (phone != null) - json['phone'] = phone; - if (userStatus != null) - json['userStatus'] = userStatus; - return json; + return { + 'id': id, + 'username': username, + 'firstName': firstName, + 'lastName': lastName, + 'email': email, + 'password': password, + 'phone': phone, + 'userStatus': userStatus + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index 391fa5edec02..b63f835e89b3 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,8 +1,6 @@ name: openapi version: 1.0.0 description: OpenAPI API client -environment: - sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.11.1 <0.13.0' dev_dependencies: diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION index afa636560641..d1a8f58b3884 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml similarity index 93% rename from samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml rename to samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml index d0758bc9f0d6..82b19541fa43 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "1.24.3" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/README.md b/samples/client/petstore/dart/flutter_petstore/swagger/README.md index 45fe0858b2dd..8520a219f887 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/README.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/README.md @@ -44,7 +44,7 @@ Please follow the [installation procedure](#installation--usage) and then run th import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var body = new Pet(); // Pet | Pet object that needs to be added to the store diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md index 3ec1113828c6..5780e7f38022 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md @@ -28,7 +28,7 @@ Add a new pet to the store ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var body = new Pet(); // Pet | Pet object that needs to be added to the store @@ -70,7 +70,7 @@ Deletes a pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete @@ -116,7 +116,7 @@ Multiple status values can be provided with comma separated strings ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter @@ -161,7 +161,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var tags = []; // List | Tags to filter by @@ -206,9 +206,9 @@ Returns a single pet ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return @@ -251,7 +251,7 @@ Update an existing pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var body = new Pet(); // Pet | Pet object that needs to be added to the store @@ -293,7 +293,7 @@ Updates a pet in the store with form data ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated @@ -339,7 +339,7 @@ uploads an image ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to update diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md index f3a5e0aba874..df76647f11ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md @@ -68,9 +68,9 @@ Returns a map of status codes to quantities ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new StoreApi(); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh b/samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh +++ b/samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart/flutter_petstore/swagger/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart index 69c3ecd2e15d..9a64a5342b4a 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart @@ -24,4 +24,4 @@ part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = ApiClient(); +ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart index 9670db26fefc..6ffc146490b8 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart @@ -28,7 +28,7 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -60,7 +60,7 @@ class PetApi { /// /// Future deletePet(int petId, { String apiKey }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { @@ -78,7 +78,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -110,7 +110,7 @@ class PetApi { /// /// Multiple status values can be provided with comma separated strings Future> findPetsByStatus(List status) async { - Object postBody; + Object postBody = null; // verify required params are set if(status == null) { @@ -128,7 +128,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -161,7 +161,7 @@ class PetApi { /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Future> findPetsByTags(List tags) async { - Object postBody; + Object postBody = null; // verify required params are set if(tags == null) { @@ -179,7 +179,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -212,7 +212,7 @@ class PetApi { /// /// Returns a single pet Future getPetById(int petId) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { @@ -229,7 +229,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { @@ -279,7 +279,7 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -311,7 +311,7 @@ class PetApi { /// /// Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { @@ -328,7 +328,7 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -372,7 +372,7 @@ class PetApi { /// /// Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { @@ -389,7 +389,7 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart index 1296576d4a00..7475aa4d9901 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart @@ -11,7 +11,7 @@ class StoreApi { /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors Future deleteOrder(String orderId) async { - Object postBody; + Object postBody = null; // verify required params are set if(orderId == null) { @@ -28,7 +28,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -60,7 +60,7 @@ class StoreApi { /// /// Returns a map of status codes to quantities Future> getInventory() async { - Object postBody; + Object postBody = null; // verify required params are set @@ -74,7 +74,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { @@ -108,7 +108,7 @@ class StoreApi { /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future getOrderById(int orderId) async { - Object postBody; + Object postBody = null; // verify required params are set if(orderId == null) { @@ -125,7 +125,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -175,7 +175,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart index 4ad3021a1fa1..8f00081a8c4c 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart @@ -28,7 +28,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -77,7 +77,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -126,7 +126,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -158,7 +158,7 @@ class UserApi { /// /// This can only be done by the logged in user. Future deleteUser(String username) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { @@ -175,7 +175,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -207,7 +207,7 @@ class UserApi { /// /// Future getUserByName(String username) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { @@ -224,7 +224,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -257,7 +257,7 @@ class UserApi { /// /// Future loginUser(String username, String password) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { @@ -279,7 +279,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -312,7 +312,7 @@ class UserApi { /// /// Future logoutUser() async { - Object postBody; + Object postBody = null; // verify required params are set @@ -326,7 +326,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -378,7 +378,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart index 9aed2f92dc3d..b99ddeeccb19 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart @@ -10,18 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = Client(); + var client = new Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); + final _RegList = new RegExp(r'^List<(.*)>$'); + final _RegMap = new RegExp(r'^Map$'); ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = OAuth(); + _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new OAuth(); } void addDefaultHeader(String key, String value) { @@ -40,36 +40,36 @@ class ApiClient { case 'double': return value is double ? value : double.parse('$value'); case 'ApiResponse': - return ApiResponse.fromJson(value); + return new ApiResponse.fromJson(value); case 'Category': - return Category.fromJson(value); + return new Category.fromJson(value); case 'Order': - return Order.fromJson(value); + return new Order.fromJson(value); case 'Pet': - return Pet.fromJson(value); + return new Pet.fromJson(value); case 'Tag': - return Tag.fromJson(value); + return new Tag.fromJson(value); case 'User': - return User.fromJson(value); + return new User.fromJson(value); default: { Match match; if (value is List && - (match = _regList.firstMatch(targetType)) != null) { + (match = _RegList.firstMatch(targetType)) != null) { var newTargetType = match[1]; return value.map((v) => _deserialize(v, newTargetType)).toList(); } else if (value is Map && - (match = _regMap.firstMatch(targetType)) != null) { + (match = _RegMap.firstMatch(targetType)) != null) { var newTargetType = match[1]; - return Map.fromIterables(value.keys, + return new Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } catch (e, stack) { + throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw ApiException(500, 'Could not find a suitable class for deserialization'); + throw new ApiException(500, 'Could not find a suitable class for deserialization'); } dynamic deserialize(String json, String targetType) { @@ -78,7 +78,7 @@ class ApiClient { if (targetType == 'String') return json; - var decodedJson = jsonDecode(json); + var decodedJson = JSON.decode(json); return _deserialize(decodedJson, targetType); } @@ -87,7 +87,7 @@ class ApiClient { if (obj == null) { serialized = ''; } else { - serialized = json.encode(obj); + serialized = JSON.encode(obj); } return serialized; } @@ -119,7 +119,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -148,14 +148,16 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); } } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart index 668abe2c96bc..f188fd125a4d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String message = null; + Exception innerException = null; + StackTrace stackTrace = null; ApiException(this.code, this.message); @@ -17,7 +17,7 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: $innerException)\n\n" + + return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + stackTrace.toString(); } } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart index c57b111ca87d..9c1497017e80 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart @@ -11,7 +11,7 @@ Iterable _convertParametersForCollectionFormat( if (name == null || name.isEmpty || value == null) return params; if (value is! List) { - params.add(QueryParam(name, parameterToString(value))); + params.add(new QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); + return values.map((v) => new QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart index 8384f0516ce2..f9617f7ae4da 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart @@ -4,24 +4,22 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String _apiKey; + String apiKey; String apiKeyPrefix; - set apiKey(String key) => _apiKey = key; - ApiKeyAuth(this.location, this.paramName); @override void applyToParams(List queryParams, Map headerParams) { String value; if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $_apiKey'; + value = '$apiKeyPrefix $apiKey'; } else { - value = _apiKey; + value = apiKey; } if (location == 'query' && value != null) { - queryParams.add(QueryParam(paramName, value)); + queryParams.add(new QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart index da931fa2634c..4e77ddcf6e68 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart @@ -2,15 +2,13 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String _username; - String _password; + String username; + String password; @override void applyToParams(List queryParams, Map headerParams) { - String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); - headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams["Authorization"] = "Basic " + BASE64.encode(UTF8.encode(str)); } - set username(String username) => _username = username; - set password(String password) => _password = password; -} +} \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart index 230471e44fc6..13bfd799743b 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart @@ -1,16 +1,19 @@ part of openapi.api; class OAuth implements Authentication { - String _accessToken; + String accessToken; - OAuth({String accessToken}) : _accessToken = accessToken; + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; } } - set accessToken(String accessToken) => _accessToken = accessToken; + void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart index 4ecc4b44dc66..f2fddde347ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart @@ -19,17 +19,17 @@ class ApiResponse { if (json['code'] == null) { code = null; } else { - code = json['code']; + code = json['code']; } if (json['type'] == null) { type = null; } else { - type = json['type']; + type = json['type']; } if (json['message'] == null) { message = null; } else { - message = json['message']; + message = json['message']; } } @@ -45,10 +45,10 @@ class ApiResponse { return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { + static Map mapFromJson(Map> json) { var map = new Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value)); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart index f91ffc9b30ef..1750c6a0acb1 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart @@ -17,12 +17,12 @@ class Category { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } @@ -37,10 +37,10 @@ class Category { return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { + static Map mapFromJson(Map> json) { var map = new Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value)); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart index d021acb1f881..51d15f730415 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart @@ -26,17 +26,17 @@ class Order { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['petId'] == null) { petId = null; } else { - petId = json['petId']; + petId = json['petId']; } if (json['quantity'] == null) { quantity = null; } else { - quantity = json['quantity']; + quantity = json['quantity']; } if (json['shipDate'] == null) { shipDate = null; @@ -46,12 +46,12 @@ class Order { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } if (json['complete'] == null) { complete = null; } else { - complete = json['complete']; + complete = json['complete']; } } @@ -70,10 +70,10 @@ class Order { return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { + static Map mapFromJson(Map> json) { var map = new Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value)); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart index 6788af011fec..c64406368d87 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart @@ -26,7 +26,7 @@ class Pet { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['category'] == null) { category = null; @@ -36,12 +36,12 @@ class Pet { if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } if (json['photoUrls'] == null) { photoUrls = null; } else { - photoUrls = (json['photoUrls'] as List).cast(); + photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); } if (json['tags'] == null) { tags = null; @@ -51,7 +51,7 @@ class Pet { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } } @@ -70,10 +70,10 @@ class Pet { return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { + static Map mapFromJson(Map> json) { var map = new Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value)); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart index 2fae3426b886..980c6e016302 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart @@ -17,12 +17,12 @@ class Tag { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } @@ -37,10 +37,10 @@ class Tag { return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { + static Map mapFromJson(Map> json) { var map = new Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value)); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart index e3801f4a8f20..1555eb0a3ef5 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart @@ -29,42 +29,42 @@ class User { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['username'] == null) { username = null; } else { - username = json['username']; + username = json['username']; } if (json['firstName'] == null) { firstName = null; } else { - firstName = json['firstName']; + firstName = json['firstName']; } if (json['lastName'] == null) { lastName = null; } else { - lastName = json['lastName']; + lastName = json['lastName']; } if (json['email'] == null) { email = null; } else { - email = json['email']; + email = json['email']; } if (json['password'] == null) { password = null; } else { - password = json['password']; + password = json['password']; } if (json['phone'] == null) { phone = null; } else { - phone = json['phone']; + phone = json['phone']; } if (json['userStatus'] == null) { userStatus = null; } else { - userStatus = json['userStatus']; + userStatus = json['userStatus']; } } @@ -85,10 +85,10 @@ class User { return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { + static Map mapFromJson(Map> json) { var map = new Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value)); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml index 9ccf0e524ad0..b63f835e89b3 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml @@ -1,7 +1,7 @@ name: openapi version: 1.0.0 description: OpenAPI API client -environment: - sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart rename to samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart 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 06b5019af3f4..0e97bd19efbf 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 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart/openapi-browser-client/git_push.sh b/samples/client/petstore/dart/openapi-browser-client/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart/openapi-browser-client/git_push.sh +++ b/samples/client/petstore/dart/openapi-browser-client/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION index 06b5019af3f4..0e97bd19efbf 100644 --- a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi/docs/UserApi.md b/samples/client/petstore/dart/openapi/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart/openapi/git_push.sh b/samples/client/petstore/dart/openapi/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart/openapi/git_push.sh +++ b/samples/client/petstore/dart/openapi/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart2/flutter_petstore/openapi/.analysis_options b/samples/client/petstore/dart2/flutter_petstore/openapi/.analysis_options deleted file mode 100644 index 518eb901a6ff..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.analysis_options +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true \ No newline at end of file diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.gitignore b/samples/client/petstore/dart2/flutter_petstore/openapi/.gitignore deleted file mode 100644 index 7c2804416498..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# See https://www.dartlang.org/tools/private-files.html - -# Files and directories created by pub -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/README.md b/samples/client/petstore/dart2/flutter_petstore/openapi/README.md deleted file mode 100644 index e78e0e3e6978..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# openapi -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartClientCodegen - -## Requirements - -Dart 1.20.0 or later OR Flutter 0.0.20 or later - -## Installation & Usage - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -``` -name: openapi -version: 1.0.0 -description: OpenAPI API client -dependencies: - openapi: - git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - version: 'any' -``` - -### Local -To use the package in your local drive, please include the following in pubspec.yaml -``` -dependencies: - openapi: - path: /path/to/openapi -``` - -## Tests - -TODO - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/api.dart'; - -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} - -``` - -## 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 - - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [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 - - -## Author - - - - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/ApiResponse.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/ApiResponse.md deleted file mode 100644 index 92422f0f446e..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ApiResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Order.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Order.md deleted file mode 100644 index 310ce6c65be3..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Order - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] -**complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Pet.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Pet.md deleted file mode 100644 index 191e1fc66a95..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pet - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] -**status** | **String** | pet status in the store | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md deleted file mode 100644 index 7b5de3894a91..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md +++ /dev/null @@ -1,379 +0,0 @@ -# openapi.api.PetApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -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 -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **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) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var petId = 789; // int | Pet id to delete -var apiKey = apiKey_example; // String | - -try { - api_instance.deletePet(petId, apiKey); -} catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### 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) - -# **findPetsByStatus** -> List findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var status = []; // List | Status values that need to be considered for filter - -try { - var result = api_instance.findPetsByStatus(status); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **findPetsByTags** -> List findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var tags = []; // List | Tags to filter by - -try { - var result = api_instance.findPetsByTags(tags); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -var api_instance = PetApi(); -var petId = 789; // int | ID of pet to return - -try { - var result = api_instance.getPetById(petId); - print(result); -} catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **updatePet** -> updatePet(body) - -Update an existing pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.updatePet(body); -} catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **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) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var petId = 789; // int | ID of pet that needs to be updated -var name = name_example; // String | Updated name of the pet -var status = status_example; // String | Updated status of the pet - -try { - api_instance.updatePetWithForm(petId, name, status); -} catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **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) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var petId = 789; // int | ID of pet to update -var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -var file = BINARY_DATA_HERE; // MultipartFile | file to upload - -try { - var result = api_instance.uploadFile(petId, additionalMetadata, file); - print(result); -} catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **MultipartFile**| file to upload | [optional] [default to null] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[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) - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md deleted file mode 100644 index 1cc37e2a47ab..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md +++ /dev/null @@ -1,186 +0,0 @@ -# openapi.api.StoreApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -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 -```dart -import 'package:openapi/api.dart'; - -var api_instance = StoreApi(); -var orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api_instance.deleteOrder(orderId); -} catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **getInventory** -> Map getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -var api_instance = StoreApi(); - -try { - var result = api_instance.getInventory(); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **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 -```dart -import 'package:openapi/api.dart'; - -var api_instance = StoreApi(); -var orderId = 789; // int | ID of pet that needs to be fetched - -try { - var result = api_instance.getOrderById(orderId); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = StoreApi(); -var body = Order(); // Order | order placed for purchasing the pet - -try { - var result = api_instance.placeOrder(body); - print(result); -} catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); -} -``` - -### 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 - -[[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) - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/User.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/User.md deleted file mode 100644 index 3761b70cf0b7..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.User - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md deleted file mode 100644 index 1ee5f6fced69..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md +++ /dev/null @@ -1,349 +0,0 @@ -# openapi.api.UserApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -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 -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var body = User(); // User | Created user object - -try { - api_instance.createUser(body); -} catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var body = [List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithArrayInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var body = [List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithListInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | The name that needs to be deleted - -try { - api_instance.deleteUser(username); -} catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - var result = api_instance.getUserByName(username); - print(result); -} catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | The user name for login -var password = password_example; // String | The password for login in clear text - -try { - var result = api_instance.loginUser(username, password); - print(result); -} catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); - -try { - api_instance.logoutUser(); -} catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | name that need to be deleted -var body = User(); // User | Updated user object - -try { - api_instance.updateUser(username, body); -} catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api.dart deleted file mode 100644 index 69c3ecd2e15d..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api.dart +++ /dev/null @@ -1,27 +0,0 @@ -library openapi.api; - -import 'dart:async'; -import 'dart:convert'; -import 'package:http/http.dart'; - -part 'api_client.dart'; -part 'api_helper.dart'; -part 'api_exception.dart'; -part 'auth/authentication.dart'; -part 'auth/api_key_auth.dart'; -part 'auth/oauth.dart'; -part 'auth/http_basic_auth.dart'; - -part 'api/pet_api.dart'; -part 'api/store_api.dart'; -part 'api/user_api.dart'; - -part 'model/api_response.dart'; -part 'model/category.dart'; -part 'model/order.dart'; -part 'model/pet.dart'; -part 'model/tag.dart'; -part 'model/user.dart'; - - -ApiClient defaultApiClient = ApiClient(); diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart deleted file mode 100644 index 35416e655ede..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart +++ /dev/null @@ -1,432 +0,0 @@ -part of openapi.api; - - - -class PetApi { - final ApiClient apiClient; - - PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - - /// Add a new pet to the store - /// - /// - Future addPet(Pet body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/pet".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["application/json","application/xml"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Deletes a pet - /// - /// - Future deletePet(int petId, { String apiKey }) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - headerParams["api_key"] = apiKey; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - Future> findPetsByStatus(List status) async { - Object postBody; - - // verify required params are set - if(status == null) { - throw ApiException(400, "Missing required param: status"); - } - - // create path and map variables - String path = "/pet/findByStatus".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - queryParams.addAll(_convertParametersForCollectionFormat("csv", "status", status)); - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); - } else { - return null; - } - } - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags) async { - Object postBody; - - // verify required params are set - if(tags == null) { - throw ApiException(400, "Missing required param: tags"); - } - - // create path and map variables - String path = "/pet/findByTags".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); - } else { - return null; - } - } - /// Find pet by ID - /// - /// Returns a single pet - Future getPetById(int petId) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["api_key"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; - } else { - return null; - } - } - /// Update an existing pet - /// - /// - Future updatePet(Pet body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/pet".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["application/json","application/xml"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Updates a pet in the store with form data - /// - /// - Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["application/x-www-form-urlencoded"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if (name != null) { - hasFields = true; - mp.fields['name'] = parameterToString(name); - } - if (status != null) { - hasFields = true; - mp.fields['status'] = parameterToString(status); - } - if(hasFields) - postBody = mp; - } - else { - if (name != null) - formParams['name'] = parameterToString(name); - if (status != null) - formParams['status'] = parameterToString(status); - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// uploads an image - /// - /// - Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["multipart/form-data"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if (additionalMetadata != null) { - hasFields = true; - mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); - } - if (file != null) { - hasFields = true; - mp.fields['file'] = file.field; - mp.files.add(file); - } - if(hasFields) - postBody = mp; - } - else { - if (additionalMetadata != null) - formParams['additionalMetadata'] = parameterToString(additionalMetadata); - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; - } else { - return null; - } - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart deleted file mode 100644 index 59e59725ec63..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart +++ /dev/null @@ -1,207 +0,0 @@ -part of openapi.api; - - - -class StoreApi { - final ApiClient apiClient; - - StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrder(String orderId) async { - Object postBody; - - // verify required params are set - if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); - } - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("{format}","json").replaceAll("{" + "orderId" + "}", orderId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - Future> getInventory() async { - Object postBody; - - // verify required params are set - - // create path and map variables - String path = "/store/inventory".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["api_key"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); - ; - } else { - return null; - } - } - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderById(int orderId) async { - Object postBody; - - // verify required params are set - if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); - } - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("{format}","json").replaceAll("{" + "orderId" + "}", orderId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; - } else { - return null; - } - } - /// Place an order for a pet - /// - /// - Future placeOrder(Order body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/store/order".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; - } else { - return null; - } - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart deleted file mode 100644 index 475f0655b958..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart +++ /dev/null @@ -1,409 +0,0 @@ -part of openapi.api; - - - -class UserApi { - final ApiClient apiClient; - - UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - - /// Create user - /// - /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Creates list of users with given input array - /// - /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user/createWithArray".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Creates list of users with given input array - /// - /// - Future createUsersWithListInput(List body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user/createWithList".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Delete user - /// - /// This can only be done by the logged in user. - Future deleteUser(String username) async { - Object postBody; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("{format}","json").replaceAll("{" + "username" + "}", username.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Get user by user name - /// - /// - Future getUserByName(String username) async { - Object postBody; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("{format}","json").replaceAll("{" + "username" + "}", username.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; - } else { - return null; - } - } - /// Logs user into the system - /// - /// - Future loginUser(String username, String password) async { - Object postBody; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - if(password == null) { - throw ApiException(400, "Missing required param: password"); - } - - // create path and map variables - String path = "/user/login".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - queryParams.addAll(_convertParametersForCollectionFormat("", "username", username)); - queryParams.addAll(_convertParametersForCollectionFormat("", "password", password)); - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } else { - return null; - } - } - /// Logs out current logged in user session - /// - /// - Future logoutUser() async { - Object postBody; - - // verify required params are set - - // create path and map variables - String path = "/user/logout".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Updated user - /// - /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("{format}","json").replaceAll("{" + "username" + "}", username.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_client.dart deleted file mode 100644 index fcf60c919f81..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_client.dart +++ /dev/null @@ -1,161 +0,0 @@ -part of openapi.api; - -class QueryParam { - String name; - String value; - - QueryParam(this.name, this.value); -} - -class ApiClient { - - String basePath; - var client = Client(); - - Map _defaultHeaderMap = {}; - Map _authentications = {}; - - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); - - ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { - // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = OAuth(); - } - - void addDefaultHeader(String key, String value) { - _defaultHeaderMap[key] = value; - } - - dynamic _deserialize(dynamic value, String targetType) { - try { - switch (targetType) { - case 'String': - return '$value'; - case 'int': - return value is int ? value : int.parse('$value'); - case 'bool': - return value is bool ? value : '$value'.toLowerCase() == 'true'; - case 'double': - return value is double ? value : double.parse('$value'); - case 'ApiResponse': - return ApiResponse.fromJson(value); - case 'Category': - return Category.fromJson(value); - case 'Order': - return Order.fromJson(value); - case 'Pet': - return Pet.fromJson(value); - case 'Tag': - return Tag.fromJson(value); - case 'User': - return User.fromJson(value); - default: - { - Match match; - if (value is List && - (match = _regList.firstMatch(targetType)) != null) { - var newTargetType = match[1]; - return value.map((v) => _deserialize(v, newTargetType)).toList(); - } else if (value is Map && - (match = _regMap.firstMatch(targetType)) != null) { - var newTargetType = match[1]; - return Map.fromIterables(value.keys, - value.values.map((v) => _deserialize(v, newTargetType))); - } - } - } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); - } - throw ApiException(500, 'Could not find a suitable class for deserialization'); - } - - dynamic deserialize(String json, String targetType) { - // Remove all spaces. Necessary for reg expressions as well. - targetType = targetType.replaceAll(' ', ''); - - if (targetType == 'String') return json; - - var decodedJson = jsonDecode(json); - return _deserialize(decodedJson, targetType); - } - - String serialize(Object obj) { - String serialized = ''; - if (obj == null) { - serialized = ''; - } else { - serialized = json.encode(obj); - } - return serialized; - } - - // We don't use a Map for queryParams. - // If collectionFormat is 'multi' a key might appear multiple times. - Future invokeAPI(String path, - String method, - Iterable queryParams, - Object body, - Map headerParams, - Map formParams, - String contentType, - List authNames) async { - - _updateParamsForAuth(authNames, queryParams, headerParams); - - var ps = queryParams - .where((p) => p.value != null) - .map((p) => '${p.name}=${Uri.encodeQueryComponent(p.value)}'); - - String queryString = ps.isNotEmpty ? - '?' + ps.join('&') : - ''; - - String url = basePath + path + queryString; - - headerParams.addAll(_defaultHeaderMap); - headerParams['Content-Type'] = contentType; - - if(body is MultipartRequest) { - var request = MultipartRequest(method, Uri.parse(url)); - request.fields.addAll(body.fields); - request.files.addAll(body.files); - request.headers.addAll(body.headers); - request.headers.addAll(headerParams); - var response = await client.send(request); - return Response.fromStream(response); - } else { - var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); - switch(method) { - case "POST": - return client.post(url, headers: headerParams, body: msgBody); - case "PUT": - return client.put(url, headers: headerParams, body: msgBody); - case "DELETE": - return client.delete(url, headers: headerParams); - case "PATCH": - return client.patch(url, headers: headerParams, body: msgBody); - default: - return client.get(url, headers: headerParams); - } - } - } - - /// Update query and header parameters based on authentication settings. - /// @param authNames The authentications to apply - void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { - authNames.forEach((authName) { - Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams); - }); - } - - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_exception.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_exception.dart deleted file mode 100644 index 668abe2c96bc..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_exception.dart +++ /dev/null @@ -1,23 +0,0 @@ -part of openapi.api; - -class ApiException implements Exception { - int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; - - ApiException(this.code, this.message); - - ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); - - String toString() { - if (message == null) return "ApiException"; - - if (innerException == null) { - return "ApiException $code: $message"; - } - - return "ApiException $code: $message (Inner exception: $innerException)\n\n" + - stackTrace.toString(); - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_helper.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_helper.dart deleted file mode 100644 index c57b111ca87d..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api_helper.dart +++ /dev/null @@ -1,56 +0,0 @@ -part of openapi.api; - -const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; - -// port from Java version -Iterable _convertParametersForCollectionFormat( - String collectionFormat, String name, dynamic value) { - var params = []; - - // preconditions - if (name == null || name.isEmpty || value == null) return params; - - if (value is! List) { - params.add(QueryParam(name, parameterToString(value))); - return params; - } - - List values = value as List; - - // get the collection format - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) - ? "csv" - : collectionFormat; // default: csv - - if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); - } - - String delimiter = _delimiters[collectionFormat] ?? ","; - - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); - return params; -} - -/// Format the given parameter object into string. -String parameterToString(dynamic value) { - if (value == null) { - return ''; - } else if (value is DateTime) { - return value.toUtc().toIso8601String(); - } else { - return value.toString(); - } -} - -/// Returns the decoded body by utf-8 if application/json with the given headers. -/// Else, returns the decoded body by default algorithm of dart:http. -/// Because avoid to text garbling when header only contains "application/json" without "; charset=utf-8". -String _decodeBodyBytes(Response response) { - var contentType = response.headers['content-type']; - if (contentType != null && contentType.contains("application/json")) { - return utf8.decode(response.bodyBytes); - } else { - return response.body; - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/api_key_auth.dart deleted file mode 100644 index 8384f0516ce2..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ /dev/null @@ -1,29 +0,0 @@ -part of openapi.api; - -class ApiKeyAuth implements Authentication { - - final String location; - final String paramName; - String _apiKey; - String apiKeyPrefix; - - set apiKey(String key) => _apiKey = key; - - ApiKeyAuth(this.location, this.paramName); - - @override - void applyToParams(List queryParams, Map headerParams) { - String value; - if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $_apiKey'; - } else { - value = _apiKey; - } - - if (location == 'query' && value != null) { - queryParams.add(QueryParam(paramName, value)); - } else if (location == 'header' && value != null) { - headerParams[paramName] = value; - } - } -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/authentication.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/authentication.dart deleted file mode 100644 index abd5e2fe68a3..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/authentication.dart +++ /dev/null @@ -1,7 +0,0 @@ -part of openapi.api; - -abstract class Authentication { - - /// Apply authentication settings to header and query params. - void applyToParams(List queryParams, Map headerParams); -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/http_basic_auth.dart deleted file mode 100644 index da931fa2634c..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ /dev/null @@ -1,16 +0,0 @@ -part of openapi.api; - -class HttpBasicAuth implements Authentication { - - String _username; - String _password; - - @override - void applyToParams(List queryParams, Map headerParams) { - String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); - headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); - } - - set username(String username) => _username = username; - set password(String password) => _password = password; -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/oauth.dart deleted file mode 100644 index 230471e44fc6..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/auth/oauth.dart +++ /dev/null @@ -1,16 +0,0 @@ -part of openapi.api; - -class OAuth implements Authentication { - String _accessToken; - - OAuth({String accessToken}) : _accessToken = accessToken; - - @override - void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; - } - } - - set accessToken(String accessToken) => _accessToken = accessToken; -} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart deleted file mode 100644 index be01c2de8195..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart +++ /dev/null @@ -1,59 +0,0 @@ -part of openapi.api; - -class ApiResponse { - - int code = null; - - String type = null; - - String message = null; - ApiResponse(); - - @override - String toString() { - return 'ApiResponse[code=$code, type=$type, message=$message, ]'; - } - - ApiResponse.fromJson(Map json) { - if (json == null) return; - if (json['code'] == null) { - code = null; - } else { - code = json['code']; - } - if (json['type'] == null) { - type = null; - } else { - type = json['type']; - } - if (json['message'] == null) { - message = null; - } else { - message = json['message']; - } - } - - Map toJson() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart deleted file mode 100644 index 696468a16191..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart +++ /dev/null @@ -1,50 +0,0 @@ -part of openapi.api; - -class Category { - - int id = null; - - String name = null; - Category(); - - @override - String toString() { - return 'Category[id=$id, name=$name, ]'; - } - - Category.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart deleted file mode 100644 index be5a12e1ed19..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart +++ /dev/null @@ -1,87 +0,0 @@ -part of openapi.api; - -class Order { - - int id = null; - - int petId = null; - - int quantity = null; - - DateTime shipDate = null; - /* Order Status */ - String status = null; - //enum statusEnum { placed, approved, delivered, };{ - - bool complete = false; - Order(); - - @override - String toString() { - return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; - } - - Order.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['petId'] == null) { - petId = null; - } else { - petId = json['petId']; - } - if (json['quantity'] == null) { - quantity = null; - } else { - quantity = json['quantity']; - } - if (json['shipDate'] == null) { - shipDate = null; - } else { - shipDate = DateTime.parse(json['shipDate']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - if (json['complete'] == null) { - complete = null; - } else { - complete = json['complete']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (petId != null) - json['petId'] = petId; - if (quantity != null) - json['quantity'] = quantity; - if (shipDate != null) - json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); - if (status != null) - json['status'] = status; - if (complete != null) - json['complete'] = complete; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart deleted file mode 100644 index 4f19829878aa..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart +++ /dev/null @@ -1,87 +0,0 @@ -part of openapi.api; - -class Pet { - - int id = null; - - Category category = null; - - String name = null; - - List photoUrls = []; - - List tags = []; - /* pet status in the store */ - String status = null; - //enum statusEnum { available, pending, sold, };{ - Pet(); - - @override - String toString() { - return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; - } - - Pet.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['category'] == null) { - category = null; - } else { - category = Category.fromJson(json['category']); - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - if (json['photoUrls'] == null) { - photoUrls = null; - } else { - photoUrls = (json['photoUrls'] as List).cast(); - } - if (json['tags'] == null) { - tags = null; - } else { - tags = Tag.listFromJson(json['tags']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (category != null) - json['category'] = category; - if (name != null) - json['name'] = name; - if (photoUrls != null) - json['photoUrls'] = photoUrls; - if (tags != null) - json['tags'] = tags; - if (status != null) - json['status'] = status; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart deleted file mode 100644 index a3485e5d3c63..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart +++ /dev/null @@ -1,50 +0,0 @@ -part of openapi.api; - -class Tag { - - int id = null; - - String name = null; - Tag(); - - @override - String toString() { - return 'Tag[id=$id, name=$name, ]'; - } - - Tag.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart deleted file mode 100644 index 48f061d969b1..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart +++ /dev/null @@ -1,104 +0,0 @@ -part of openapi.api; - -class User { - - int id = null; - - String username = null; - - String firstName = null; - - String lastName = null; - - String email = null; - - String password = null; - - String phone = null; - /* User Status */ - int userStatus = null; - User(); - - @override - String toString() { - return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; - } - - User.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['username'] == null) { - username = null; - } else { - username = json['username']; - } - if (json['firstName'] == null) { - firstName = null; - } else { - firstName = json['firstName']; - } - if (json['lastName'] == null) { - lastName = null; - } else { - lastName = json['lastName']; - } - if (json['email'] == null) { - email = null; - } else { - email = json['email']; - } - if (json['password'] == null) { - password = null; - } else { - password = json['password']; - } - if (json['phone'] == null) { - phone = null; - } else { - phone = json['phone']; - } - if (json['userStatus'] == null) { - userStatus = null; - } else { - userStatus = json['userStatus']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (username != null) - json['username'] = username; - if (firstName != null) - json['firstName'] = firstName; - if (lastName != null) - json['lastName'] = lastName; - if (email != null) - json['email'] = email; - if (password != null) - json['password'] = password; - if (phone != null) - json['phone'] = phone; - if (userStatus != null) - json['userStatus'] = userStatus; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml deleted file mode 100644 index 391fa5edec02..000000000000 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -environment: - sdk: '>=2.0.0 <3.0.0' -dependencies: - http: '>=0.11.1 <0.13.0' -dev_dependencies: - test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi-browser-client/.analysis_options b/samples/client/petstore/dart2/openapi-browser-client/.analysis_options deleted file mode 100644 index 518eb901a6ff..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/.analysis_options +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi-browser-client/.gitignore b/samples/client/petstore/dart2/openapi-browser-client/.gitignore deleted file mode 100644 index 7c2804416498..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# See https://www.dartlang.org/tools/private-files.html - -# Files and directories created by pub -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock diff --git a/samples/client/petstore/dart2/openapi-browser-client/.travis.yml b/samples/client/petstore/dart2/openapi-browser-client/.travis.yml deleted file mode 100644 index d0758bc9f0d6..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -# https://docs.travis-ci.com/user/languages/dart/ -# -language: dart -dart: -# Install a specific stable release -- "2.2.0" -install: -- pub get - -script: -- pub run test diff --git a/samples/client/petstore/dart2/openapi-browser-client/README.md b/samples/client/petstore/dart2/openapi-browser-client/README.md deleted file mode 100644 index e78e0e3e6978..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# openapi -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartClientCodegen - -## Requirements - -Dart 1.20.0 or later OR Flutter 0.0.20 or later - -## Installation & Usage - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -``` -name: openapi -version: 1.0.0 -description: OpenAPI API client -dependencies: - openapi: - git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - version: 'any' -``` - -### Local -To use the package in your local drive, please include the following in pubspec.yaml -``` -dependencies: - openapi: - path: /path/to/openapi -``` - -## Tests - -TODO - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/api.dart'; - -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} - -``` - -## 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 - - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [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 - - -## Author - - - - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/ApiResponse.md b/samples/client/petstore/dart2/openapi-browser-client/docs/ApiResponse.md deleted file mode 100644 index 92422f0f446e..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ApiResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/Order.md b/samples/client/petstore/dart2/openapi-browser-client/docs/Order.md deleted file mode 100644 index 310ce6c65be3..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Order - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] -**complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/Pet.md b/samples/client/petstore/dart2/openapi-browser-client/docs/Pet.md deleted file mode 100644 index 191e1fc66a95..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pet - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] -**status** | **String** | pet status in the store | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md deleted file mode 100644 index 7b5de3894a91..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md +++ /dev/null @@ -1,379 +0,0 @@ -# openapi.api.PetApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -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 -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **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) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var petId = 789; // int | Pet id to delete -var apiKey = apiKey_example; // String | - -try { - api_instance.deletePet(petId, apiKey); -} catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### 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) - -# **findPetsByStatus** -> List findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var status = []; // List | Status values that need to be considered for filter - -try { - var result = api_instance.findPetsByStatus(status); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **findPetsByTags** -> List findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var tags = []; // List | Tags to filter by - -try { - var result = api_instance.findPetsByTags(tags); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -var api_instance = PetApi(); -var petId = 789; // int | ID of pet to return - -try { - var result = api_instance.getPetById(petId); - print(result); -} catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **updatePet** -> updatePet(body) - -Update an existing pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var body = Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.updatePet(body); -} catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **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) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var petId = 789; // int | ID of pet that needs to be updated -var name = name_example; // String | Updated name of the pet -var status = status_example; // String | Updated status of the pet - -try { - api_instance.updatePetWithForm(petId, name, status); -} catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **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) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = PetApi(); -var petId = 789; // int | ID of pet to update -var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -var file = BINARY_DATA_HERE; // MultipartFile | file to upload - -try { - var result = api_instance.uploadFile(petId, additionalMetadata, file); - print(result); -} catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **MultipartFile**| file to upload | [optional] [default to null] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[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) - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md deleted file mode 100644 index 1cc37e2a47ab..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md +++ /dev/null @@ -1,186 +0,0 @@ -# openapi.api.StoreApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -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 -```dart -import 'package:openapi/api.dart'; - -var api_instance = StoreApi(); -var orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api_instance.deleteOrder(orderId); -} catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **getInventory** -> Map getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -var api_instance = StoreApi(); - -try { - var result = api_instance.getInventory(); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **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 -```dart -import 'package:openapi/api.dart'; - -var api_instance = StoreApi(); -var orderId = 789; // int | ID of pet that needs to be fetched - -try { - var result = api_instance.getOrderById(orderId); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = StoreApi(); -var body = Order(); // Order | order placed for purchasing the pet - -try { - var result = api_instance.placeOrder(body); - print(result); -} catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); -} -``` - -### 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 - -[[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) - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/User.md b/samples/client/petstore/dart2/openapi-browser-client/docs/User.md deleted file mode 100644 index 3761b70cf0b7..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.User - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md deleted file mode 100644 index 1ee5f6fced69..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md +++ /dev/null @@ -1,349 +0,0 @@ -# openapi.api.UserApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -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 -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var body = User(); // User | Created user object - -try { - api_instance.createUser(body); -} catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var body = [List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithArrayInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var body = [List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithListInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | The name that needs to be deleted - -try { - api_instance.deleteUser(username); -} catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - var result = api_instance.getUserByName(username); - print(result); -} catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | The user name for login -var password = password_example; // String | The password for login in clear text - -try { - var result = api_instance.loginUser(username, password); - print(result); -} catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[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) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); - -try { - api_instance.logoutUser(); -} catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = UserApi(); -var username = username_example; // String | name that need to be deleted -var body = User(); // User | Updated user object - -try { - api_instance.updateUser(username, body); -} catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api.dart deleted file mode 100644 index 4e43a1c2083f..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api.dart +++ /dev/null @@ -1,28 +0,0 @@ -library openapi.api; - -import 'dart:async'; -import 'dart:convert'; -import 'package:http/browser_client.dart'; -import 'package:http/http.dart'; - -part 'api_client.dart'; -part 'api_helper.dart'; -part 'api_exception.dart'; -part 'auth/authentication.dart'; -part 'auth/api_key_auth.dart'; -part 'auth/oauth.dart'; -part 'auth/http_basic_auth.dart'; - -part 'api/pet_api.dart'; -part 'api/store_api.dart'; -part 'api/user_api.dart'; - -part 'model/api_response.dart'; -part 'model/category.dart'; -part 'model/order.dart'; -part 'model/pet.dart'; -part 'model/tag.dart'; -part 'model/user.dart'; - - -ApiClient defaultApiClient = ApiClient(); diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart deleted file mode 100644 index 35416e655ede..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart +++ /dev/null @@ -1,432 +0,0 @@ -part of openapi.api; - - - -class PetApi { - final ApiClient apiClient; - - PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - - /// Add a new pet to the store - /// - /// - Future addPet(Pet body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/pet".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["application/json","application/xml"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Deletes a pet - /// - /// - Future deletePet(int petId, { String apiKey }) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - headerParams["api_key"] = apiKey; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - Future> findPetsByStatus(List status) async { - Object postBody; - - // verify required params are set - if(status == null) { - throw ApiException(400, "Missing required param: status"); - } - - // create path and map variables - String path = "/pet/findByStatus".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - queryParams.addAll(_convertParametersForCollectionFormat("csv", "status", status)); - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); - } else { - return null; - } - } - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags) async { - Object postBody; - - // verify required params are set - if(tags == null) { - throw ApiException(400, "Missing required param: tags"); - } - - // create path and map variables - String path = "/pet/findByTags".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); - } else { - return null; - } - } - /// Find pet by ID - /// - /// Returns a single pet - Future getPetById(int petId) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["api_key"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; - } else { - return null; - } - } - /// Update an existing pet - /// - /// - Future updatePet(Pet body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/pet".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["application/json","application/xml"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Updates a pet in the store with form data - /// - /// - Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["application/x-www-form-urlencoded"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if (name != null) { - hasFields = true; - mp.fields['name'] = parameterToString(name); - } - if (status != null) { - hasFields = true; - mp.fields['status'] = parameterToString(status); - } - if(hasFields) - postBody = mp; - } - else { - if (name != null) - formParams['name'] = parameterToString(name); - if (status != null) - formParams['status'] = parameterToString(status); - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// uploads an image - /// - /// - Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; - - // verify required params are set - if(petId == null) { - throw ApiException(400, "Missing required param: petId"); - } - - // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("{format}","json").replaceAll("{" + "petId" + "}", petId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = ["multipart/form-data"]; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["petstore_auth"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if (additionalMetadata != null) { - hasFields = true; - mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); - } - if (file != null) { - hasFields = true; - mp.fields['file'] = file.field; - mp.files.add(file); - } - if(hasFields) - postBody = mp; - } - else { - if (additionalMetadata != null) - formParams['additionalMetadata'] = parameterToString(additionalMetadata); - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; - } else { - return null; - } - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart deleted file mode 100644 index 59e59725ec63..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart +++ /dev/null @@ -1,207 +0,0 @@ -part of openapi.api; - - - -class StoreApi { - final ApiClient apiClient; - - StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrder(String orderId) async { - Object postBody; - - // verify required params are set - if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); - } - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("{format}","json").replaceAll("{" + "orderId" + "}", orderId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - Future> getInventory() async { - Object postBody; - - // verify required params are set - - // create path and map variables - String path = "/store/inventory".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["api_key"]; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); - ; - } else { - return null; - } - } - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderById(int orderId) async { - Object postBody; - - // verify required params are set - if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); - } - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("{format}","json").replaceAll("{" + "orderId" + "}", orderId.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; - } else { - return null; - } - } - /// Place an order for a pet - /// - /// - Future placeOrder(Order body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/store/order".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; - } else { - return null; - } - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart deleted file mode 100644 index 475f0655b958..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart +++ /dev/null @@ -1,409 +0,0 @@ -part of openapi.api; - - - -class UserApi { - final ApiClient apiClient; - - UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - - /// Create user - /// - /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Creates list of users with given input array - /// - /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user/createWithArray".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Creates list of users with given input array - /// - /// - Future createUsersWithListInput(List body) async { - Object postBody = body; - - // verify required params are set - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user/createWithList".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Delete user - /// - /// This can only be done by the logged in user. - Future deleteUser(String username) async { - Object postBody; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("{format}","json").replaceAll("{" + "username" + "}", username.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Get user by user name - /// - /// - Future getUserByName(String username) async { - Object postBody; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("{format}","json").replaceAll("{" + "username" + "}", username.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; - } else { - return null; - } - } - /// Logs user into the system - /// - /// - Future loginUser(String username, String password) async { - Object postBody; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - if(password == null) { - throw ApiException(400, "Missing required param: password"); - } - - // create path and map variables - String path = "/user/login".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - queryParams.addAll(_convertParametersForCollectionFormat("", "username", username)); - queryParams.addAll(_convertParametersForCollectionFormat("", "password", password)); - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; - } else { - return null; - } - } - /// Logs out current logged in user session - /// - /// - Future logoutUser() async { - Object postBody; - - // verify required params are set - - // create path and map variables - String path = "/user/logout".replaceAll("{format}","json"); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } - /// Updated user - /// - /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; - - // verify required params are set - if(username == null) { - throw ApiException(400, "Missing required param: username"); - } - if(body == null) { - throw ApiException(400, "Missing required param: body"); - } - - // create path and map variables - String path = "/user/{username}".replaceAll("{format}","json").replaceAll("{" + "username" + "}", username.toString()); - - // query params - List queryParams = []; - Map headerParams = {}; - Map formParams = {}; - - List contentTypes = []; - - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = []; - - if(contentType.startsWith("multipart/form-data")) { - bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); - if(hasFields) - postBody = mp; - } - else { - } - - var response = await apiClient.invokeAPI(path, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentType, - authNames); - - if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); - } else if(response.body != null) { - } else { - return; - } - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api_client.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api_client.dart deleted file mode 100644 index 5ba192df5ac6..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api_client.dart +++ /dev/null @@ -1,161 +0,0 @@ -part of openapi.api; - -class QueryParam { - String name; - String value; - - QueryParam(this.name, this.value); -} - -class ApiClient { - - String basePath; - var client = BrowserClient(); - - Map _defaultHeaderMap = {}; - Map _authentications = {}; - - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); - - ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { - // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = OAuth(); - } - - void addDefaultHeader(String key, String value) { - _defaultHeaderMap[key] = value; - } - - dynamic _deserialize(dynamic value, String targetType) { - try { - switch (targetType) { - case 'String': - return '$value'; - case 'int': - return value is int ? value : int.parse('$value'); - case 'bool': - return value is bool ? value : '$value'.toLowerCase() == 'true'; - case 'double': - return value is double ? value : double.parse('$value'); - case 'ApiResponse': - return ApiResponse.fromJson(value); - case 'Category': - return Category.fromJson(value); - case 'Order': - return Order.fromJson(value); - case 'Pet': - return Pet.fromJson(value); - case 'Tag': - return Tag.fromJson(value); - case 'User': - return User.fromJson(value); - default: - { - Match match; - if (value is List && - (match = _regList.firstMatch(targetType)) != null) { - var newTargetType = match[1]; - return value.map((v) => _deserialize(v, newTargetType)).toList(); - } else if (value is Map && - (match = _regMap.firstMatch(targetType)) != null) { - var newTargetType = match[1]; - return Map.fromIterables(value.keys, - value.values.map((v) => _deserialize(v, newTargetType))); - } - } - } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); - } - throw ApiException(500, 'Could not find a suitable class for deserialization'); - } - - dynamic deserialize(String json, String targetType) { - // Remove all spaces. Necessary for reg expressions as well. - targetType = targetType.replaceAll(' ', ''); - - if (targetType == 'String') return json; - - var decodedJson = jsonDecode(json); - return _deserialize(decodedJson, targetType); - } - - String serialize(Object obj) { - String serialized = ''; - if (obj == null) { - serialized = ''; - } else { - serialized = json.encode(obj); - } - return serialized; - } - - // We don't use a Map for queryParams. - // If collectionFormat is 'multi' a key might appear multiple times. - Future invokeAPI(String path, - String method, - Iterable queryParams, - Object body, - Map headerParams, - Map formParams, - String contentType, - List authNames) async { - - _updateParamsForAuth(authNames, queryParams, headerParams); - - var ps = queryParams - .where((p) => p.value != null) - .map((p) => '${p.name}=${Uri.encodeQueryComponent(p.value)}'); - - String queryString = ps.isNotEmpty ? - '?' + ps.join('&') : - ''; - - String url = basePath + path + queryString; - - headerParams.addAll(_defaultHeaderMap); - headerParams['Content-Type'] = contentType; - - if(body is MultipartRequest) { - var request = MultipartRequest(method, Uri.parse(url)); - request.fields.addAll(body.fields); - request.files.addAll(body.files); - request.headers.addAll(body.headers); - request.headers.addAll(headerParams); - var response = await client.send(request); - return Response.fromStream(response); - } else { - var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); - switch(method) { - case "POST": - return client.post(url, headers: headerParams, body: msgBody); - case "PUT": - return client.put(url, headers: headerParams, body: msgBody); - case "DELETE": - return client.delete(url, headers: headerParams); - case "PATCH": - return client.patch(url, headers: headerParams, body: msgBody); - default: - return client.get(url, headers: headerParams); - } - } - } - - /// Update query and header parameters based on authentication settings. - /// @param authNames The authentications to apply - void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { - authNames.forEach((authName) { - Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams); - }); - } - - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api_exception.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api_exception.dart deleted file mode 100644 index 668abe2c96bc..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api_exception.dart +++ /dev/null @@ -1,23 +0,0 @@ -part of openapi.api; - -class ApiException implements Exception { - int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; - - ApiException(this.code, this.message); - - ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); - - String toString() { - if (message == null) return "ApiException"; - - if (innerException == null) { - return "ApiException $code: $message"; - } - - return "ApiException $code: $message (Inner exception: $innerException)\n\n" + - stackTrace.toString(); - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api_helper.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api_helper.dart deleted file mode 100644 index c57b111ca87d..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api_helper.dart +++ /dev/null @@ -1,56 +0,0 @@ -part of openapi.api; - -const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; - -// port from Java version -Iterable _convertParametersForCollectionFormat( - String collectionFormat, String name, dynamic value) { - var params = []; - - // preconditions - if (name == null || name.isEmpty || value == null) return params; - - if (value is! List) { - params.add(QueryParam(name, parameterToString(value))); - return params; - } - - List values = value as List; - - // get the collection format - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) - ? "csv" - : collectionFormat; // default: csv - - if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); - } - - String delimiter = _delimiters[collectionFormat] ?? ","; - - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); - return params; -} - -/// Format the given parameter object into string. -String parameterToString(dynamic value) { - if (value == null) { - return ''; - } else if (value is DateTime) { - return value.toUtc().toIso8601String(); - } else { - return value.toString(); - } -} - -/// Returns the decoded body by utf-8 if application/json with the given headers. -/// Else, returns the decoded body by default algorithm of dart:http. -/// Because avoid to text garbling when header only contains "application/json" without "; charset=utf-8". -String _decodeBodyBytes(Response response) { - var contentType = response.headers['content-type']; - if (contentType != null && contentType.contains("application/json")) { - return utf8.decode(response.bodyBytes); - } else { - return response.body; - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/api_key_auth.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/auth/api_key_auth.dart deleted file mode 100644 index 8384f0516ce2..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/api_key_auth.dart +++ /dev/null @@ -1,29 +0,0 @@ -part of openapi.api; - -class ApiKeyAuth implements Authentication { - - final String location; - final String paramName; - String _apiKey; - String apiKeyPrefix; - - set apiKey(String key) => _apiKey = key; - - ApiKeyAuth(this.location, this.paramName); - - @override - void applyToParams(List queryParams, Map headerParams) { - String value; - if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $_apiKey'; - } else { - value = _apiKey; - } - - if (location == 'query' && value != null) { - queryParams.add(QueryParam(paramName, value)); - } else if (location == 'header' && value != null) { - headerParams[paramName] = value; - } - } -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/authentication.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/auth/authentication.dart deleted file mode 100644 index abd5e2fe68a3..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/authentication.dart +++ /dev/null @@ -1,7 +0,0 @@ -part of openapi.api; - -abstract class Authentication { - - /// Apply authentication settings to header and query params. - void applyToParams(List queryParams, Map headerParams); -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/auth/http_basic_auth.dart deleted file mode 100644 index da931fa2634c..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/http_basic_auth.dart +++ /dev/null @@ -1,16 +0,0 @@ -part of openapi.api; - -class HttpBasicAuth implements Authentication { - - String _username; - String _password; - - @override - void applyToParams(List queryParams, Map headerParams) { - String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); - headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); - } - - set username(String username) => _username = username; - set password(String password) => _password = password; -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/oauth.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/auth/oauth.dart deleted file mode 100644 index 230471e44fc6..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/auth/oauth.dart +++ /dev/null @@ -1,16 +0,0 @@ -part of openapi.api; - -class OAuth implements Authentication { - String _accessToken; - - OAuth({String accessToken}) : _accessToken = accessToken; - - @override - void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; - } - } - - set accessToken(String accessToken) => _accessToken = accessToken; -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart deleted file mode 100644 index be01c2de8195..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart +++ /dev/null @@ -1,59 +0,0 @@ -part of openapi.api; - -class ApiResponse { - - int code = null; - - String type = null; - - String message = null; - ApiResponse(); - - @override - String toString() { - return 'ApiResponse[code=$code, type=$type, message=$message, ]'; - } - - ApiResponse.fromJson(Map json) { - if (json == null) return; - if (json['code'] == null) { - code = null; - } else { - code = json['code']; - } - if (json['type'] == null) { - type = null; - } else { - type = json['type']; - } - if (json['message'] == null) { - message = null; - } else { - message = json['message']; - } - } - - Map toJson() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart deleted file mode 100644 index 696468a16191..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart +++ /dev/null @@ -1,50 +0,0 @@ -part of openapi.api; - -class Category { - - int id = null; - - String name = null; - Category(); - - @override - String toString() { - return 'Category[id=$id, name=$name, ]'; - } - - Category.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart deleted file mode 100644 index be5a12e1ed19..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart +++ /dev/null @@ -1,87 +0,0 @@ -part of openapi.api; - -class Order { - - int id = null; - - int petId = null; - - int quantity = null; - - DateTime shipDate = null; - /* Order Status */ - String status = null; - //enum statusEnum { placed, approved, delivered, };{ - - bool complete = false; - Order(); - - @override - String toString() { - return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; - } - - Order.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['petId'] == null) { - petId = null; - } else { - petId = json['petId']; - } - if (json['quantity'] == null) { - quantity = null; - } else { - quantity = json['quantity']; - } - if (json['shipDate'] == null) { - shipDate = null; - } else { - shipDate = DateTime.parse(json['shipDate']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - if (json['complete'] == null) { - complete = null; - } else { - complete = json['complete']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (petId != null) - json['petId'] = petId; - if (quantity != null) - json['quantity'] = quantity; - if (shipDate != null) - json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); - if (status != null) - json['status'] = status; - if (complete != null) - json['complete'] = complete; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart deleted file mode 100644 index 4f19829878aa..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart +++ /dev/null @@ -1,87 +0,0 @@ -part of openapi.api; - -class Pet { - - int id = null; - - Category category = null; - - String name = null; - - List photoUrls = []; - - List tags = []; - /* pet status in the store */ - String status = null; - //enum statusEnum { available, pending, sold, };{ - Pet(); - - @override - String toString() { - return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; - } - - Pet.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['category'] == null) { - category = null; - } else { - category = Category.fromJson(json['category']); - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - if (json['photoUrls'] == null) { - photoUrls = null; - } else { - photoUrls = (json['photoUrls'] as List).cast(); - } - if (json['tags'] == null) { - tags = null; - } else { - tags = Tag.listFromJson(json['tags']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (category != null) - json['category'] = category; - if (name != null) - json['name'] = name; - if (photoUrls != null) - json['photoUrls'] = photoUrls; - if (tags != null) - json['tags'] = tags; - if (status != null) - json['status'] = status; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart deleted file mode 100644 index a3485e5d3c63..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart +++ /dev/null @@ -1,50 +0,0 @@ -part of openapi.api; - -class Tag { - - int id = null; - - String name = null; - Tag(); - - @override - String toString() { - return 'Tag[id=$id, name=$name, ]'; - } - - Tag.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart deleted file mode 100644 index 48f061d969b1..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart +++ /dev/null @@ -1,104 +0,0 @@ -part of openapi.api; - -class User { - - int id = null; - - String username = null; - - String firstName = null; - - String lastName = null; - - String email = null; - - String password = null; - - String phone = null; - /* User Status */ - int userStatus = null; - User(); - - @override - String toString() { - return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; - } - - User.fromJson(Map json) { - if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['username'] == null) { - username = null; - } else { - username = json['username']; - } - if (json['firstName'] == null) { - firstName = null; - } else { - firstName = json['firstName']; - } - if (json['lastName'] == null) { - lastName = null; - } else { - lastName = json['lastName']; - } - if (json['email'] == null) { - email = null; - } else { - email = json['email']; - } - if (json['password'] == null) { - password = null; - } else { - password = json['password']; - } - if (json['phone'] == null) { - phone = null; - } else { - phone = json['phone']; - } - if (json['userStatus'] == null) { - userStatus = null; - } else { - userStatus = json['userStatus']; - } - } - - Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (username != null) - json['username'] = username; - if (firstName != null) - json['firstName'] = firstName; - if (lastName != null) - json['lastName'] = lastName; - if (email != null) - json['email'] = email; - if (password != null) - json['password'] = password; - if (phone != null) - json['phone'] = phone; - if (userStatus != null) - json['userStatus'] = userStatus; - return json; - } - - static List listFromJson(List json) { - return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); - } - - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); - } - return map; - } -} - diff --git a/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml deleted file mode 100644 index 391fa5edec02..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -environment: - sdk: '>=2.0.0 <3.0.0' -dependencies: - http: '>=0.11.1 <0.13.0' -dev_dependencies: - test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart deleted file mode 100644 index afd92edde06e..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for ApiResponse -void main() { - var instance = ApiResponse(); - - group('test ApiResponse', () { - // int code (default value: null) - test('to test the property `code`', () async { - // TODO - }); - - // String type (default value: null) - test('to test the property `type`', () async { - // TODO - }); - - // String message (default value: null) - test('to test the property `message`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart deleted file mode 100644 index ed39fa7ed8a2..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for Category -void main() { - var instance = Category(); - - group('test Category', () { - // int id (default value: null) - test('to test the property `id`', () async { - // TODO - }); - - // String name (default value: null) - test('to test the property `name`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart deleted file mode 100644 index 6102e1e5d089..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for Order -void main() { - var instance = Order(); - - group('test Order', () { - // int id (default value: null) - test('to test the property `id`', () async { - // TODO - }); - - // int petId (default value: null) - test('to test the property `petId`', () async { - // TODO - }); - - // int quantity (default value: null) - test('to test the property `quantity`', () async { - // TODO - }); - - // DateTime shipDate (default value: null) - test('to test the property `shipDate`', () async { - // TODO - }); - - // Order Status - // String status (default value: null) - test('to test the property `status`', () async { - // TODO - }); - - // bool complete (default value: false) - test('to test the property `complete`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart deleted file mode 100644 index 409b7962536c..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - - -/// tests for PetApi -void main() { - var instance = PetApi(); - - group('tests for PetApi', () { - // Add a new pet to the store - // - //Future addPet(Pet body) async - test('test addPet', () async { - // TODO - }); - - // Deletes a pet - // - //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async { - // TODO - }); - - // Finds Pets by status - // - // Multiple status values can be provided with comma separated strings - // - //Future> findPetsByStatus(List status) async - test('test findPetsByStatus', () async { - // TODO - }); - - // Finds Pets by tags - // - // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - // - //Future> findPetsByTags(List tags) async - test('test findPetsByTags', () async { - // TODO - }); - - // Find pet by ID - // - // Returns a single pet - // - //Future getPetById(int petId) async - test('test getPetById', () async { - // TODO - }); - - // Update an existing pet - // - //Future updatePet(Pet body) async - test('test updatePet', () async { - // TODO - }); - - // Updates a pet in the store with form data - // - //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async { - // TODO - }); - - // uploads an image - // - //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async { - // TODO - }); - - }); -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart deleted file mode 100644 index 83480bd785e7..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for Pet -void main() { - var instance = Pet(); - - group('test Pet', () { - // int id (default value: null) - test('to test the property `id`', () async { - // TODO - }); - - // Category category (default value: null) - test('to test the property `category`', () async { - // TODO - }); - - // String name (default value: null) - test('to test the property `name`', () async { - // TODO - }); - - // List photoUrls (default value: []) - test('to test the property `photoUrls`', () async { - // TODO - }); - - // List tags (default value: []) - test('to test the property `tags`', () async { - // TODO - }); - - // pet status in the store - // String status (default value: null) - test('to test the property `status`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart deleted file mode 100644 index e2c7ab94b179..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - - -/// tests for StoreApi -void main() { - var instance = StoreApi(); - - group('tests for StoreApi', () { - // Delete purchase order by ID - // - // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - // - //Future deleteOrder(String orderId) async - test('test deleteOrder', () async { - // TODO - }); - - // Returns pet inventories by status - // - // Returns a map of status codes to quantities - // - //Future> getInventory() async - test('test getInventory', () async { - // TODO - }); - - // Find purchase order by ID - // - // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - // - //Future getOrderById(int orderId) async - test('test getOrderById', () async { - // TODO - }); - - // Place an order for a pet - // - //Future placeOrder(Order body) async - test('test placeOrder', () async { - // TODO - }); - - }); -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart deleted file mode 100644 index 3333ea6d3104..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for Tag -void main() { - var instance = Tag(); - - group('test Tag', () { - // int id (default value: null) - test('to test the property `id`', () async { - // TODO - }); - - // String name (default value: null) - test('to test the property `name`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart deleted file mode 100644 index 5d124a611170..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - - -/// tests for UserApi -void main() { - var instance = UserApi(); - - group('tests for UserApi', () { - // Create user - // - // This can only be done by the logged in user. - // - //Future createUser(User body) async - test('test createUser', () async { - // TODO - }); - - // Creates list of users with given input array - // - //Future createUsersWithArrayInput(List body) async - test('test createUsersWithArrayInput', () async { - // TODO - }); - - // Creates list of users with given input array - // - //Future createUsersWithListInput(List body) async - test('test createUsersWithListInput', () async { - // TODO - }); - - // Delete user - // - // This can only be done by the logged in user. - // - //Future deleteUser(String username) async - test('test deleteUser', () async { - // TODO - }); - - // Get user by user name - // - //Future getUserByName(String username) async - test('test getUserByName', () async { - // TODO - }); - - // Logs user into the system - // - //Future loginUser(String username, String password) async - test('test loginUser', () async { - // TODO - }); - - // Logs out current logged in user session - // - //Future logoutUser() async - test('test logoutUser', () async { - // TODO - }); - - // Updated user - // - // This can only be done by the logged in user. - // - //Future updateUser(String username, User body) async - test('test updateUser', () async { - // TODO - }); - - }); -} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart deleted file mode 100644 index 35e8eed37568..000000000000 --- a/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for User -void main() { - var instance = User(); - - group('test User', () { - // int id (default value: null) - test('to test the property `id`', () async { - // TODO - }); - - // String username (default value: null) - test('to test the property `username`', () async { - // TODO - }); - - // String firstName (default value: null) - test('to test the property `firstName`', () async { - // TODO - }); - - // String lastName (default value: null) - test('to test the property `lastName`', () async { - // TODO - }); - - // String email (default value: null) - test('to test the property `email`', () async { - // TODO - }); - - // String password (default value: null) - test('to test the property `password`', () async { - // TODO - }); - - // String phone (default value: null) - test('to test the property `phone`', () async { - // TODO - }); - - // User Status - // int userStatus (default value: null) - test('to test the property `userStatus`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/client/petstore/dart2/openapi/.analysis_options b/samples/client/petstore/dart2/openapi/.analysis_options deleted file mode 100644 index 518eb901a6ff..000000000000 --- a/samples/client/petstore/dart2/openapi/.analysis_options +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index 83a328a9227e..0e97bd19efbf 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/README.md b/samples/client/petstore/dart2/openapi/README.md index e78e0e3e6978..a32c667b4ee4 100644 --- a/samples/client/petstore/dart2/openapi/README.md +++ b/samples/client/petstore/dart2/openapi/README.md @@ -8,24 +8,20 @@ This Dart package is automatically generated by the [OpenAPI Generator](https:// ## Requirements -Dart 1.20.0 or later OR Flutter 0.0.20 or later +Dart 2.0 or later ## Installation & Usage ### Github -If this Dart package is published to Github, please include the following in pubspec.yaml +If this Dart package is published to Github, add the following dependency to your pubspec.yaml ``` -name: openapi -version: 1.0.0 -description: OpenAPI API client dependencies: openapi: git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - version: 'any' ``` ### Local -To use the package in your local drive, please include the following in pubspec.yaml +To use the package in your local drive, add the following dependency to your pubspec.yaml ``` dependencies: openapi: diff --git a/samples/client/petstore/dart2/openapi/git_push.sh b/samples/client/petstore/dart2/openapi/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/dart2/openapi/git_push.sh +++ b/samples/client/petstore/dart2/openapi/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/dart2/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index 35416e655ede..2b00c7d63b73 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -7,10 +7,10 @@ class PetApi { PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Add a new pet to the store + /// Add a new pet to the store with HTTP info returned /// /// - Future addPet(Pet body) async { + Future addPetWithHttpInfo(Pet body) async { Object postBody = body; // verify required params are set @@ -48,7 +48,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Add a new pet to the store + /// + /// + Future addPet(Pet body) async { + Response response = await addPetWithHttpInfo(body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -56,10 +63,11 @@ class PetApi { return; } } - /// Deletes a pet + + /// Deletes a pet with HTTP info returned /// /// - Future deletePet(int petId, { String apiKey }) async { + Future deletePetWithHttpInfo(int petId, { String apiKey }) async { Object postBody; // verify required params are set @@ -98,7 +106,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Deletes a pet + /// + /// + Future deletePet(int petId, { String apiKey }) async { + Response response = await deletePetWithHttpInfo(petId, apiKey: apiKey ); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -106,10 +121,11 @@ class PetApi { return; } } - /// Finds Pets by status + + /// Finds Pets by status with HTTP info returned /// /// Multiple status values can be provided with comma separated strings - Future> findPetsByStatus(List status) async { + Future findPetsByStatusWithHttpInfo(List status) async { Object postBody; // verify required params are set @@ -148,7 +164,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + Future> findPetsByStatus(List status) async { + Response response = await findPetsByStatusWithHttpInfo(status); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -157,10 +180,11 @@ class PetApi { return null; } } - /// Finds Pets by tags + + /// Finds Pets by tags with HTTP info returned /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags) async { + Future findPetsByTagsWithHttpInfo(List tags) async { Object postBody; // verify required params are set @@ -199,7 +223,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + Future> findPetsByTags(List tags) async { + Response response = await findPetsByTagsWithHttpInfo(tags); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -208,10 +239,11 @@ class PetApi { return null; } } - /// Find pet by ID + + /// Find pet by ID with HTTP info returned /// /// Returns a single pet - Future getPetById(int petId) async { + Future getPetByIdWithHttpInfo(int petId) async { Object postBody; // verify required params are set @@ -249,7 +281,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Find pet by ID + /// + /// Returns a single pet + Future getPetById(int petId) async { + Response response = await getPetByIdWithHttpInfo(petId); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -258,10 +297,11 @@ class PetApi { return null; } } - /// Update an existing pet + + /// Update an existing pet with HTTP info returned /// /// - Future updatePet(Pet body) async { + Future updatePetWithHttpInfo(Pet body) async { Object postBody = body; // verify required params are set @@ -299,7 +339,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Update an existing pet + /// + /// + Future updatePet(Pet body) async { + Response response = await updatePetWithHttpInfo(body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -307,10 +354,11 @@ class PetApi { return; } } - /// Updates a pet in the store with form data + + /// Updates a pet in the store with form data with HTTP info returned /// /// - Future updatePetWithForm(int petId, { String name, String status }) async { + Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async { Object postBody; // verify required params are set @@ -360,7 +408,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// Updates a pet in the store with form data + /// + /// + Future updatePetWithForm(int petId, { String name, String status }) async { + Response response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status ); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -368,10 +423,11 @@ class PetApi { return; } } - /// uploads an image + + /// uploads an image with HTTP info returned /// /// - Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { + Future uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file }) async { Object postBody; // verify required params are set @@ -420,7 +476,14 @@ class PetApi { formParams, contentType, authNames); + return response; + } + /// uploads an image + /// + /// + Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { + Response response = await uploadFileWithHttpInfo(petId, additionalMetadata: additionalMetadata, file: file ); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -429,4 +492,5 @@ class PetApi { return null; } } + } diff --git a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 59e59725ec63..3b48cbbc4a3b 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -7,10 +7,10 @@ class StoreApi { StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Delete purchase order by ID + /// Delete purchase order by ID with HTTP info returned /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - Future deleteOrder(String orderId) async { + Future deleteOrderWithHttpInfo(String orderId) async { Object postBody; // verify required params are set @@ -48,7 +48,14 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Future deleteOrder(String orderId) async { + Response response = await deleteOrderWithHttpInfo(orderId); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -56,10 +63,11 @@ class StoreApi { return; } } - /// Returns pet inventories by status + + /// Returns pet inventories by status with HTTP info returned /// /// Returns a map of status codes to quantities - Future> getInventory() async { + Future getInventoryWithHttpInfo() async { Object postBody; // verify required params are set @@ -94,7 +102,14 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + Future> getInventory() async { + Response response = await getInventoryWithHttpInfo(); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -104,10 +119,11 @@ class StoreApi { return null; } } - /// Find purchase order by ID + + /// Find purchase order by ID with HTTP info returned /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future getOrderById(int orderId) async { + Future getOrderByIdWithHttpInfo(int orderId) async { Object postBody; // verify required params are set @@ -145,7 +161,14 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + Future getOrderById(int orderId) async { + Response response = await getOrderByIdWithHttpInfo(orderId); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -154,10 +177,11 @@ class StoreApi { return null; } } - /// Place an order for a pet + + /// Place an order for a pet with HTTP info returned /// /// - Future placeOrder(Order body) async { + Future placeOrderWithHttpInfo(Order body) async { Object postBody = body; // verify required params are set @@ -195,7 +219,14 @@ class StoreApi { formParams, contentType, authNames); + return response; + } + /// Place an order for a pet + /// + /// + Future placeOrder(Order body) async { + Response response = await placeOrderWithHttpInfo(body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -204,4 +235,5 @@ class StoreApi { return null; } } + } diff --git a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart index 475f0655b958..5a35ba394c08 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -7,10 +7,10 @@ class UserApi { UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; - /// Create user + /// Create user with HTTP info returned /// /// This can only be done by the logged in user. - Future createUser(User body) async { + Future createUserWithHttpInfo(User body) async { Object postBody = body; // verify required params are set @@ -48,7 +48,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Create user + /// + /// This can only be done by the logged in user. + Future createUser(User body) async { + Response response = await createUserWithHttpInfo(body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -56,10 +63,11 @@ class UserApi { return; } } - /// Creates list of users with given input array + + /// Creates list of users with given input array with HTTP info returned /// /// - Future createUsersWithArrayInput(List body) async { + Future createUsersWithArrayInputWithHttpInfo(List body) async { Object postBody = body; // verify required params are set @@ -97,7 +105,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Creates list of users with given input array + /// + /// + Future createUsersWithArrayInput(List body) async { + Response response = await createUsersWithArrayInputWithHttpInfo(body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -105,10 +120,11 @@ class UserApi { return; } } - /// Creates list of users with given input array + + /// Creates list of users with given input array with HTTP info returned /// /// - Future createUsersWithListInput(List body) async { + Future createUsersWithListInputWithHttpInfo(List body) async { Object postBody = body; // verify required params are set @@ -146,7 +162,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Creates list of users with given input array + /// + /// + Future createUsersWithListInput(List body) async { + Response response = await createUsersWithListInputWithHttpInfo(body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -154,10 +177,11 @@ class UserApi { return; } } - /// Delete user + + /// Delete user with HTTP info returned /// /// This can only be done by the logged in user. - Future deleteUser(String username) async { + Future deleteUserWithHttpInfo(String username) async { Object postBody; // verify required params are set @@ -195,7 +219,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Delete user + /// + /// This can only be done by the logged in user. + Future deleteUser(String username) async { + Response response = await deleteUserWithHttpInfo(username); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -203,10 +234,11 @@ class UserApi { return; } } - /// Get user by user name + + /// Get user by user name with HTTP info returned /// /// - Future getUserByName(String username) async { + Future getUserByNameWithHttpInfo(String username) async { Object postBody; // verify required params are set @@ -244,7 +276,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Get user by user name + /// + /// + Future getUserByName(String username) async { + Response response = await getUserByNameWithHttpInfo(username); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -253,10 +292,11 @@ class UserApi { return null; } } - /// Logs user into the system + + /// Logs user into the system with HTTP info returned /// /// - Future loginUser(String username, String password) async { + Future loginUserWithHttpInfo(String username, String password) async { Object postBody; // verify required params are set @@ -299,7 +339,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Logs user into the system + /// + /// + Future loginUser(String username, String password) async { + Response response = await loginUserWithHttpInfo(username, password); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -308,10 +355,11 @@ class UserApi { return null; } } - /// Logs out current logged in user session + + /// Logs out current logged in user session with HTTP info returned /// /// - Future logoutUser() async { + Future logoutUserWithHttpInfo() async { Object postBody; // verify required params are set @@ -346,7 +394,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Logs out current logged in user session + /// + /// + Future logoutUser() async { + Response response = await logoutUserWithHttpInfo(); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -354,10 +409,11 @@ class UserApi { return; } } - /// Updated user + + /// Updated user with HTTP info returned /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { + Future updateUserWithHttpInfo(String username, User body) async { Object postBody = body; // verify required params are set @@ -398,7 +454,14 @@ class UserApi { formParams, contentType, authNames); + return response; + } + /// Updated user + /// + /// This can only be done by the logged in user. + Future updateUser(String username, User body) async { + Response response = await updateUserWithHttpInfo(username, body); if(response.statusCode >= 400) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { @@ -406,4 +469,5 @@ class UserApi { return; } } + } diff --git a/samples/client/petstore/dart2/openapi/lib/model/api_response.dart b/samples/client/petstore/dart2/openapi/lib/model/api_response.dart index be01c2de8195..c5b6886be8b2 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/api_response.dart @@ -16,21 +16,9 @@ class ApiResponse { ApiResponse.fromJson(Map json) { if (json == null) return; - if (json['code'] == null) { - code = null; - } else { - code = json['code']; - } - if (json['type'] == null) { - type = null; - } else { - type = json['type']; - } - if (json['message'] == null) { - message = null; - } else { - message = json['message']; - } + code = json['code']; + type = json['type']; + message = json['message']; } Map toJson() { @@ -55,5 +43,16 @@ class ApiResponse { } return map; } + + // maps a json object with a list of ApiResponse-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = ApiResponse.listFromJson(value); + }); + } + return map; + } } diff --git a/samples/client/petstore/dart2/openapi/lib/model/category.dart b/samples/client/petstore/dart2/openapi/lib/model/category.dart index 696468a16191..686ad33cac82 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/category.dart @@ -14,16 +14,8 @@ class Category { Category.fromJson(Map json) { if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } + id = json['id']; + name = json['name']; } Map toJson() { @@ -46,5 +38,16 @@ class Category { } return map; } + + // maps a json object with a list of Category-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Category.listFromJson(value); + }); + } + return map; + } } diff --git a/samples/client/petstore/dart2/openapi/lib/model/order.dart b/samples/client/petstore/dart2/openapi/lib/model/order.dart index be5a12e1ed19..34370b21e3b8 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/order.dart @@ -23,36 +23,14 @@ class Order { Order.fromJson(Map json) { if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['petId'] == null) { - petId = null; - } else { - petId = json['petId']; - } - if (json['quantity'] == null) { - quantity = null; - } else { - quantity = json['quantity']; - } - if (json['shipDate'] == null) { - shipDate = null; - } else { - shipDate = DateTime.parse(json['shipDate']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } - if (json['complete'] == null) { - complete = null; - } else { - complete = json['complete']; - } + id = json['id']; + petId = json['petId']; + quantity = json['quantity']; + shipDate = (json['shipDate'] == null) ? + null : + DateTime.parse(json['shipDate']); + status = json['status']; + complete = json['complete']; } Map toJson() { @@ -83,5 +61,16 @@ class Order { } return map; } + + // maps a json object with a list of Order-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Order.listFromJson(value); + }); + } + return map; + } } diff --git a/samples/client/petstore/dart2/openapi/lib/model/pet.dart b/samples/client/petstore/dart2/openapi/lib/model/pet.dart index 4f19829878aa..92a096c4027d 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/pet.dart @@ -23,36 +23,18 @@ class Pet { Pet.fromJson(Map json) { if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['category'] == null) { - category = null; - } else { - category = Category.fromJson(json['category']); - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } - if (json['photoUrls'] == null) { - photoUrls = null; - } else { - photoUrls = (json['photoUrls'] as List).cast(); - } - if (json['tags'] == null) { - tags = null; - } else { - tags = Tag.listFromJson(json['tags']); - } - if (json['status'] == null) { - status = null; - } else { - status = json['status']; - } + id = json['id']; + category = (json['category'] == null) ? + null : + Category.fromJson(json['category']); + name = json['name']; + photoUrls = (json['photoUrls'] == null) ? + null : + (json['photoUrls'] as List).cast(); + tags = (json['tags'] == null) ? + null : + Tag.listFromJson(json['tags']); + status = json['status']; } Map toJson() { @@ -83,5 +65,16 @@ class Pet { } return map; } + + // maps a json object with a list of Pet-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Pet.listFromJson(value); + }); + } + return map; + } } diff --git a/samples/client/petstore/dart2/openapi/lib/model/tag.dart b/samples/client/petstore/dart2/openapi/lib/model/tag.dart index a3485e5d3c63..5b758c01b7af 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/tag.dart @@ -14,16 +14,8 @@ class Tag { Tag.fromJson(Map json) { if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['name'] == null) { - name = null; - } else { - name = json['name']; - } + id = json['id']; + name = json['name']; } Map toJson() { @@ -46,5 +38,16 @@ class Tag { } return map; } + + // maps a json object with a list of Tag-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Tag.listFromJson(value); + }); + } + return map; + } } diff --git a/samples/client/petstore/dart2/openapi/lib/model/user.dart b/samples/client/petstore/dart2/openapi/lib/model/user.dart index 48f061d969b1..685ffadb4ee7 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/user.dart @@ -26,46 +26,14 @@ class User { User.fromJson(Map json) { if (json == null) return; - if (json['id'] == null) { - id = null; - } else { - id = json['id']; - } - if (json['username'] == null) { - username = null; - } else { - username = json['username']; - } - if (json['firstName'] == null) { - firstName = null; - } else { - firstName = json['firstName']; - } - if (json['lastName'] == null) { - lastName = null; - } else { - lastName = json['lastName']; - } - if (json['email'] == null) { - email = null; - } else { - email = json['email']; - } - if (json['password'] == null) { - password = null; - } else { - password = json['password']; - } - if (json['phone'] == null) { - phone = null; - } else { - phone = json['phone']; - } - if (json['userStatus'] == null) { - userStatus = null; - } else { - userStatus = json['userStatus']; - } + id = json['id']; + username = json['username']; + firstName = json['firstName']; + lastName = json['lastName']; + email = json['email']; + password = json['password']; + phone = json['phone']; + userStatus = json['userStatus']; } Map toJson() { @@ -100,5 +68,16 @@ class User { } return map; } + + // maps a json object with a list of User-objects as value to a dart map + static Map> mapListFromJson(Map json) { + var map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = User.listFromJson(value); + }); + } + return map; + } } diff --git a/samples/client/petstore/dart2/openapi/pubspec.yaml b/samples/client/petstore/dart2/openapi/pubspec.yaml index 391fa5edec02..be7bf663b8fd 100644 --- a/samples/client/petstore/dart2/openapi/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi/pubspec.yaml @@ -4,6 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.13.0' + http: '>=0.12.0 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/openapi/test/api_response_test.dart index afd92edde06e..6c2882a06208 100644 --- a/samples/client/petstore/dart2/openapi/test/api_response_test.dart +++ b/samples/client/petstore/dart2/openapi/test/api_response_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for ApiResponse void main() { - var instance = ApiResponse(); + var instance = new ApiResponse(); group('test ApiResponse', () { // int code (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/category_test.dart b/samples/client/petstore/dart2/openapi/test/category_test.dart index ed39fa7ed8a2..277bdfb709d4 100644 --- a/samples/client/petstore/dart2/openapi/test/category_test.dart +++ b/samples/client/petstore/dart2/openapi/test/category_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Category void main() { - var instance = Category(); + var instance = new Category(); group('test Category', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/order_test.dart b/samples/client/petstore/dart2/openapi/test/order_test.dart index 6102e1e5d089..0c3178ac699f 100644 --- a/samples/client/petstore/dart2/openapi/test/order_test.dart +++ b/samples/client/petstore/dart2/openapi/test/order_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Order void main() { - var instance = Order(); + var instance = new Order(); group('test Order', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/pet_test.dart b/samples/client/petstore/dart2/openapi/test/pet_test.dart index 83480bd785e7..acfb87a3fb1d 100644 --- a/samples/client/petstore/dart2/openapi/test/pet_test.dart +++ b/samples/client/petstore/dart2/openapi/test/pet_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Pet void main() { - var instance = Pet(); + var instance = new Pet(); group('test Pet', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/tag_test.dart b/samples/client/petstore/dart2/openapi/test/tag_test.dart index 3333ea6d3104..4b133ff675df 100644 --- a/samples/client/petstore/dart2/openapi/test/tag_test.dart +++ b/samples/client/petstore/dart2/openapi/test/tag_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Tag void main() { - var instance = Tag(); + var instance = new Tag(); group('test Tag', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/user_test.dart b/samples/client/petstore/dart2/openapi/test/user_test.dart index 35e8eed37568..c0e542757f58 100644 --- a/samples/client/petstore/dart2/openapi/test/user_test.dart +++ b/samples/client/petstore/dart2/openapi/test/user_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for User void main() { - var instance = User(); + var instance = new User(); group('test User', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/petstore/README.md b/samples/client/petstore/dart2/petstore/README.md index 17343a5c026a..2adfc09c8a36 100644 --- a/samples/client/petstore/dart2/petstore/README.md +++ b/samples/client/petstore/dart2/petstore/README.md @@ -1,58 +1,11 @@ -# To run these tests: +## If not already done, resolve dependencies -Simply start the dart server: `pub serve` +`pub get` -then open http://127.0.0.1:8080/tests.html +## To run tests in a single file: +`pub run test test/pet_test.dart` -This already starts the tests. There is _NO_ feedback! +## To run all tests in the test folder: -Open the javascript / dart console of your browser to verify all tests -passed successfully. - -You should have the following output: -``` -Observatory listening at http://127.0.0.1:39067/ -unittest-suite-wait-for-done -GET http://petstore.swagger.io/v2/pet/957639 404 (Not Found) -GET http://petstore.swagger.io/v2/pet/525946 404 (Not Found) -GET http://petstore.swagger.io/v2/store/order/29756 404 (Not Found) -GET http://petstore.swagger.io/v2/user/Riddlem325 404 (Not Found) -PASS: Pet API adds a new pet and gets it by id -PASS: Pet API doesn't get non-existing pet by id -PASS: Pet API deletes existing pet by id -PASS: Pet API updates pet with form -PASS: Pet API updates existing pet -PASS: Pet API finds pets by status -PASS: Pet API finds pets by tag -PASS: Pet API uploads a pet image -PASS: Store API places an order and gets it by id -PASS: Store API deletes an order -PASS: Store API gets the store inventory -PASS: User API creates a user -PASS: User API creates users with list input -PASS: User API updates a user -PASS: User API deletes a user -PASS: User API logs a user in - -All 16 tests passed. -unittest-suite-success -``` - - -You may also run the tests in the dart vm. - -Either generate the test-package for a vm: -- change bin/dart-petstore.sh and uncomment the vm options line -- run bin/dart-petstore.sh - -or - -- in `lib/api_client.dart` change `new BrowserClient()` to `new Client()` -- in `lib/api.dart` remove the line `import 'package:http/browser_client.dart';` - - - -Then run `test/tests.dart`. - -Have fun. \ No newline at end of file +`pub run test test` \ No newline at end of file diff --git a/samples/client/petstore/dart2/petstore/pom.xml b/samples/client/petstore/dart2/petstore/pom.xml index f3332da5e1a6..c4ce7b4d68e7 100644 --- a/samples/client/petstore/dart2/petstore/pom.xml +++ b/samples/client/petstore/dart2/petstore/pom.xml @@ -62,7 +62,6 @@ pub run - build_runner test diff --git a/samples/client/petstore/dart2/petstore/pubspec.lock b/samples/client/petstore/dart2/petstore/pubspec.lock deleted file mode 100644 index f077e1d4423e..000000000000 --- a/samples/client/petstore/dart2/petstore/pubspec.lock +++ /dev/null @@ -1,516 +0,0 @@ -# Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile -packages: - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.32.4" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.12" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.7+3" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+2" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.2" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2+3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.1+1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+4" - build_test: - dependency: "direct dev" - description: - name: build_test - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.3+1" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.3" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "5.5.5" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3+2" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.2" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.14.11" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.5" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.8" - front_end: - dependency: transitive - description: - name: front_end - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.7" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+1" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3+3" - http: - dependency: transitive - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+17" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.3" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.1+1" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - json_rpc_2: - dependency: transitive - description: - name: json_rpc_2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - kernel: - dependency: transitive - description: - name: kernel - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3+1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.6+2" - multi_server_socket: - dependency: transitive - description: - name: multi_server_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - node_preamble: - dependency: transitive - description: - name: node_preamble - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - openapi: - dependency: "direct main" - description: - path: "../openapi" - relative: true - source: path - version: "1.0.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - package_resolver: - dependency: transitive - description: - name: package_resolver - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - plugin: - dependency: transitive - description: - name: plugin - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.6" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.2" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+2" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0+1" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3+1" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.3+3" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - shelf_static: - dependency: transitive - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.8" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2+4" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.5" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.7" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.8" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.14+1" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - test: - dependency: "direct main" - description: - name: test - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - utf: - dependency: transitive - description: - name: utf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+5" - vm_service_client: - dependency: transitive - description: - name: vm_service_client - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.6" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+10" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.15" -sdks: - dart: ">=2.0.0 <3.0.0" diff --git a/samples/client/petstore/dart2/petstore/pubspec.yaml b/samples/client/petstore/dart2/petstore/pubspec.yaml index d84c7ac32024..1d77c96e46af 100644 --- a/samples/client/petstore/dart2/petstore/pubspec.yaml +++ b/samples/client/petstore/dart2/petstore/pubspec.yaml @@ -6,8 +6,5 @@ environment: dependencies: openapi: path: ../openapi - test: ^1.3.0 dev_dependencies: - build_runner: ^0.10.1+1 - build_test: ^0.10.3+1 - build_web_compilers: ^0.4.2+2 + test: ^1.6.8 diff --git a/samples/client/petstore/dart2/purge_test.sh b/samples/client/petstore/dart2/purge_test.sh index b11cf3564d04..6c0aca0ac84f 100755 --- a/samples/client/petstore/dart2/purge_test.sh +++ b/samples/client/petstore/dart2/purge_test.sh @@ -1,6 +1,4 @@ #!/bin/sh echo "purge test fils under 'test' folder" -rm -Rf flutter_petstore/openapi/test/ rm -Rf openapi/test/ -rm -Rf openapi-browser-client/test diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.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/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 4ce435258ce3..da8f94e239ce 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -429,4 +429,38 @@ defmodule OpenapiPetstore.Api.Fake do { 200, false} ]) end + + @doc """ + To test the collection format in query parameters + + ## Parameters + + - connection (OpenapiPetstore.Connection): Connection to server + - pipe ([String.t]): + - ioutil ([String.t]): + - http ([String.t]): + - url ([String.t]): + - context ([String.t]): + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, _opts \\ []) do + %{} + |> method(:put) + |> url("/fake/test-query-paramters") + |> add_param(:query, :"pipe", pipe) + |> add_param(:query, :"ioutil", ioutil) + |> add_param(:query, :"http", http) + |> add_param(:query, :"url", url) + |> add_param(:query, :"context", context) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex index b08d783c4395..194a74c32cf7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex @@ -11,6 +11,7 @@ defmodule OpenapiPetstore.Model.TypeHolderExample do defstruct [ :"string_item", :"number_item", + :"float_item", :"integer_item", :"bool_item", :"array_item" @@ -19,6 +20,7 @@ defmodule OpenapiPetstore.Model.TypeHolderExample do @type t :: %__MODULE__{ :"string_item" => String.t, :"number_item" => float(), + :"float_item" => float(), :"integer_item" => integer(), :"bool_item" => boolean(), :"array_item" => [integer()] 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 83a328a9227e..d1a8f58b3884 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 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go-experimental/go-petstore/README.md b/samples/client/petstore/go-experimental/go-petstore/README.md index f9cf57d259d3..b42cb2731cd7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/client/petstore/go-experimental/go-petstore/README.md @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 5a020a1d0ab8..0a1559e1c4b7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -791,6 +791,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1100,6 +1101,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile diff --git a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go index 152bf5be285b..8d1b78ba00b1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -10,29 +10,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service /* -AnotherFakeApiService To test special tags +Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,70 +45,70 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index e6a157d6cec2..392ab5c46efb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -10,30 +10,32 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "github.com/antihax/optional" "os" + "reflect" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeApiService FakeApi service type FakeApiService service /* -FakeApiService creates an XmlItem +CreateXmlItem creates an XmlItem this route creates an XmlItem - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param xmlItem XmlItem Body */ -func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*http.Response, error) { +func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,71 +46,71 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} + localVarHTTPContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &xmlItem - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' +type FakeOuterBooleanSerializeOpts struct { + Body optional.Bool } /* -FakeApiService +FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: * @param "Body" (optional.Bool) - Input boolean as post body @return bool */ - -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool -} - -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -120,93 +122,93 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v bool - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' +type FakeOuterCompositeSerializeOpts struct { + Body optional.Interface } /* -FakeApiService +FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body @return OuterComposite */ - -type FakeOuterCompositeSerializeOpts struct { - Body optional.Interface -} - -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -218,25 +220,25 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { @@ -247,68 +249,68 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPostBody = &localVarOptionalBody } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v OuterComposite - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' +type FakeOuterNumberSerializeOpts struct { + Body optional.Float32 } /* -FakeApiService +FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: * @param "Body" (optional.Float32) - Input number as post body @return float32 */ - -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 -} - -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -320,93 +322,93 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/number" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v float32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' +type FakeOuterStringSerializeOpts struct { + Body optional.String } /* -FakeApiService +FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: * @param "Body" (optional.String) - Input string as post body @return string */ - -type FakeOuterStringSerializeOpts struct { - Body optional.String -} - -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -418,86 +420,86 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/string" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -FakeApiService +TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSchemaTestClass) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -508,64 +510,64 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param query * @param body */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, body User) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -576,66 +578,66 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("query", parameterToString(query, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService To test \"client\" model +TestClientModel To test \"client\" model To test \"client\" model - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -647,78 +649,92 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' +type TestEndpointParametersOpts struct { + Integer optional.Int32 + Int32_ optional.Int32 + Int64_ optional.Int64 + Float optional.Float32 + String_ optional.String + Binary optional.Interface + Date optional.String + DateTime optional.Time + Password optional.String + Callback optional.String } /* -FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param number None * @param double None * @param patternWithoutDelimiter None @@ -735,23 +751,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * @param "Password" (optional.String) - None * @param "Callback" (optional.String) - None */ - -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String -} - -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -762,8 +764,8 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if number < 32.1 { return nil, reportError("number must be greater than 32.1") } @@ -778,21 +780,21 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) @@ -823,7 +825,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -844,37 +846,49 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' +type TestEnumParametersOpts struct { + EnumHeaderStringArray optional.Interface + EnumHeaderString optional.String + EnumQueryStringArray optional.Interface + EnumQueryString optional.String + EnumQueryInteger optional.Int32 + EnumQueryDouble optional.Float64 + EnumFormStringArray optional.Interface + EnumFormString optional.String } /* -FakeApiService To test enum parameters +TestEnumParameters To test enum parameters To test enum parameters - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *TestEnumParametersOpts - Optional Parameters: * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) @@ -885,21 +899,9 @@ To test enum parameters * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) */ - -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String -} - -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -910,8 +912,8 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv")) @@ -926,21 +928,21 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") @@ -954,37 +956,44 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' +type TestGroupParametersOpts struct { + StringGroup optional.Int32 + BooleanGroup optional.Bool + Int64Group optional.Int64 } /* -FakeApiService Fake endpoint to test group parameters (optional) +TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requiredStringGroup Required String in group parameters * @param requiredBooleanGroup Required Boolean in group parameters * @param requiredInt64Group Required Integer in group parameters @@ -993,16 +1002,9 @@ Fake endpoint to test group parameters (optional) * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters * @param "Int64Group" (optional.Int64) - Integer in group parameters */ - -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 -} - -func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1013,8 +1015,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) @@ -1025,61 +1027,61 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test inline additionalProperties - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param request body */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param map[string]string) (*http.Response, error) { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1090,64 +1092,64 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = ¶m - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test json serialization of form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestJsonFormData test json serialization of form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param field1 * @param param2 field2 */ -func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1158,51 +1160,134 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarFormParams.Add("param", parameterToString(param, "")) localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 6c04d55739a9..be67cb585ed1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -10,29 +10,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service /* -FakeClassnameTags123ApiService To test class name in snake case +TestClassname To test class name in snake case To test class name in snake case - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,25 +45,25 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarPath := a.client.cfg.BasePath + "/fake_classname_test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body @@ -78,48 +79,48 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarQueryParams.Add("api_key_query", key) } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/client/petstore/go-experimental/go-petstore/api_pet.go index 243d16197f03..77dccc27684f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_pet.go @@ -10,10 +10,10 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" "github.com/antihax/optional" @@ -22,19 +22,20 @@ import ( // Linger please var ( - _ context.Context + _ _context.Context ) +// PetApiService PetApi service type PetApiService service /* -PetApiService Add a new pet to the store - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +AddPet Add a new pet to the store + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Pet object that needs to be added to the store */ -func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) { +func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,70 +46,70 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// DeletePetOpts Optional parameters for the method 'DeletePet' +type DeletePetOpts struct { + ApiKey optional.String } /* -PetApiService Deletes a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +DeletePet Deletes a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete * @param optional nil or *DeletePetOpts - Optional Parameters: * @param "ApiKey" (optional.String) - */ - -type DeletePetOpts struct { - ApiKey optional.String -} - -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -117,69 +118,69 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -PetApiService Finds Pets by status +FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param status Status values that need to be considered for filter @return []Pet */ -func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -191,83 +192,83 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("status", parameterToString(status, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Finds Pets by tags +FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param tags Tags to filter by @return []Pet */ -func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -279,83 +280,83 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe localVarPath := a.client.cfg.BasePath + "/pet/findByTags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("tags", parameterToString(tags, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Find pet by ID +GetPetById Find pet by ID Returns a single pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to return @return Pet */ -func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -365,28 +366,28 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -400,60 +401,60 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Update an existing pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Pet object that needs to be added to the store */ -func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) { +func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -464,72 +465,72 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' +type UpdatePetWithFormOpts struct { + Name optional.String + Status optional.String } /* -PetApiService Updates a pet in the store with form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePetWithForm Updates a pet in the store with form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: * @param "Name" (optional.String) - Updated name of the pet * @param "Status" (optional.String) - Updated status of the pet */ - -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String -} - -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -538,28 +539,28 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Name.IsSet() { localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) @@ -567,51 +568,51 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca if localVarOptionals != nil && localVarOptionals.Status.IsSet() { localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UploadFileOpts Optional parameters for the method 'UploadFile' +type UploadFileOpts struct { + AdditionalMetadata optional.String + File optional.Interface } /* -PetApiService uploads an image - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFile uploads an image + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param optional nil or *UploadFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server * @param "File" (optional.Interface of *os.File) - file to upload @return ApiResponse */ - -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface -} - -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -621,28 +622,28 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -657,74 +658,74 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String } /* -PetApiService uploads an image (required) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFileWithRequiredFile uploads an image (required) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param requiredFile file to upload * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server @return ApiResponse */ - -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String -} - -func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -734,28 +735,28 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in // create path and map variables localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -763,53 +764,53 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in localVarFormFileName = "requiredFile" localVarFile := requiredFile if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_store.go b/samples/client/petstore/go-experimental/go-petstore/api_store.go index 3211860d49c3..e17fc1816ee4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_store.go @@ -10,30 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// StoreApiService StoreApi service type StoreApiService service /* -StoreApiService Delete purchase order by ID +DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of the order that needs to be deleted */ -func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -42,65 +43,65 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -StoreApiService Returns pet inventories by status +GetInventory Returns pet inventories by status Returns a map of status codes to quantities - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return map[string]int32 */ -func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { +func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -112,25 +113,25 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarPath := a.client.cfg.BasePath + "/store/inventory" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -144,62 +145,62 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v map[string]int32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Find purchase order by ID +GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of pet that needs to be fetched @return Order */ -func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -209,11 +210,11 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -222,77 +223,77 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Place an order for a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +PlaceOrder Place an order for a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body order placed for purchasing the pet @return Order */ -func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) { +func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -304,70 +305,70 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h localVarPath := a.client.cfg.BasePath + "/store/order" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_user.go b/samples/client/petstore/go-experimental/go-petstore/api_user.go index 6a7d2b1195ae..5eb1a3ced9af 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_user.go @@ -10,30 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// UserApiService UserApi service type UserApiService service /* -UserApiService Create user +CreateUser Create user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Created user object */ -func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) { +func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,63 +45,63 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo localVarPath := a.client.cfg.BasePath + "/user" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithArrayInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body List of user object */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -111,63 +112,63 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U localVarPath := a.client.cfg.BasePath + "/user/createWithArray" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithListInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body List of user object */ -func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -178,64 +179,64 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us localVarPath := a.client.cfg.BasePath + "/user/createWithList" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Delete user +DeleteUser Delete user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be deleted */ -func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -244,65 +245,65 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Get user by user name - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +GetUserByName Get user by user name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. @return User */ -func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -312,85 +313,85 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v User - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs user into the system - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LoginUser Logs user into the system + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The user name for login * @param password The password for login in clear text @return string */ -func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { +func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -402,81 +403,81 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor localVarPath := a.client.cfg.BasePath + "/user/login" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("username", parameterToString(username, "")) localVarQueryParams.Add("password", parameterToString(password, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs out current logged in user session - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LogoutUser Logs out current logged in user session + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ -func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { +func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -487,63 +488,63 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) localVarPath := a.client.cfg.BasePath + "/user/logout" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Updated user +UpdateUser Updated user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username name that need to be deleted * @param body Updated user object */ -func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -552,54 +553,54 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/client.go b/samples/client/petstore/go-experimental/go-petstore/client.go index 79a128973d9f..30377bdac64c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/client/petstore/go-experimental/go-petstore/client.go @@ -175,7 +175,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } -// Change base path to allow switching to mocks +// ChangeBasePath changes base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } diff --git a/samples/client/petstore/go-experimental/go-petstore/configuration.go b/samples/client/petstore/go-experimental/go-petstore/configuration.go index 19ccc325fa92..b3b81ad08246 100644 --- a/samples/client/petstore/go-experimental/go-petstore/configuration.go +++ b/samples/client/petstore/go-experimental/go-petstore/configuration.go @@ -49,6 +49,7 @@ type APIKey struct { Prefix string } +// Configuration stores the configuration of the API client type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` @@ -58,6 +59,7 @@ type Configuration struct { HTTPClient *http.Client } +// NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "http://petstore.swagger.io:80/v2", @@ -67,6 +69,7 @@ func NewConfiguration() *Configuration { return cfg } +// AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md index 47b71f2a71f7..d6a64a17629c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md index b8d3d2e343e0..8fa3956c6cbf 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md index 2c27fcebb9ba..dab05846a08e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md index a676667ed752..8b22e0ef339a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapString** | Pointer to **map[string]string** | | [optional] -**MapNumber** | Pointer to **map[string]float32** | | [optional] -**MapInteger** | Pointer to **map[string]int32** | | [optional] -**MapBoolean** | Pointer to **map[string]bool** | | [optional] -**MapArrayInteger** | Pointer to [**map[string][]int32**](array.md) | | [optional] -**MapArrayAnytype** | Pointer to [**map[string][]map[string]interface{}**](array.md) | | [optional] -**MapMapString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapMapAnytype** | Pointer to [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] -**Anytype1** | Pointer to [**map[string]interface{}**](.md) | | [optional] -**Anytype2** | Pointer to [**map[string]interface{}**](.md) | | [optional] -**Anytype3** | Pointer to [**map[string]interface{}**](.md) | | [optional] +**MapString** | Pointer to **map[string]string** | | [optional] +**MapNumber** | Pointer to **map[string]float32** | | [optional] +**MapInteger** | Pointer to **map[string]int32** | | [optional] +**MapBoolean** | Pointer to **map[string]bool** | | [optional] +**MapArrayInteger** | Pointer to [**map[string][]int32**](array.md) | | [optional] +**MapArrayAnytype** | Pointer to [**map[string][]map[string]interface{}**](array.md) | | [optional] +**MapMapString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapMapAnytype** | Pointer to [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] +**Anytype1** | Pointer to [**map[string]interface{}**](.md) | | [optional] +**Anytype2** | Pointer to [**map[string]interface{}**](.md) | | [optional] +**Anytype3** | Pointer to [**map[string]interface{}**](.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md index 5db6d8671d5d..9bed1f72584a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md index 585ee570058a..efc3cc156c1e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md index d71afb494337..af3963446840 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md index 72bbc5d7fd88..0934f9bf5042 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md b/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md index 3dd402a3316b..b0c891bbc960 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | Pointer to **int32** | | [optional] -**Type** | Pointer to **string** | | [optional] -**Message** | Pointer to **string** | | [optional] +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md index 6e776c78ba64..64ad908ea3bf 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] +**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md index af74787e38a4..0ce95922a5ed 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | Pointer to **[]float32** | | [optional] +**ArrayNumber** | Pointer to **[]float32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md index 7c25df85ffcc..f7020fadea38 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayOfString** | Pointer to **[]string** | | [optional] -**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] +**ArrayOfString** | Pointer to **[]string** | | [optional] +**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] +**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md b/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md index fd856f743e6d..a4772d740066 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SmallCamel** | Pointer to **string** | | [optional] -**CapitalCamel** | Pointer to **string** | | [optional] -**SmallSnake** | Pointer to **string** | | [optional] -**CapitalSnake** | Pointer to **string** | | [optional] -**SCAETHFlowPoints** | Pointer to **string** | | [optional] -**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] +**SmallCamel** | Pointer to **string** | | [optional] +**CapitalCamel** | Pointer to **string** | | [optional] +**SmallSnake** | Pointer to **string** | | [optional] +**CapitalSnake** | Pointer to **string** | | [optional] +**SCAETHFlowPoints** | Pointer to **string** | | [optional] +**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md index 262e3d04f6de..0f2fe5a1f1f8 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | Pointer to **string** | | **Color** | Pointer to **string** | | [optional] [default to red] -**Declawed** | Pointer to **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md index a89f0b29fa54..85f40d251d94 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | Pointer to **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Category.md b/samples/client/petstore/go-experimental/go-petstore/docs/Category.md index b8ef18163b83..88b525bade15 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Category.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Category.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | Pointer to **string** | | [default to default-name] +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [default to default-name] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md b/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md index 9ceae1f3d0b5..d9c4f41e98bc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Class** | Pointer to **string** | | [optional] +**Class** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Client.md b/samples/client/petstore/go-experimental/go-petstore/docs/Client.md index 9787127b16d7..5ed3098fd491 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Client.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Client.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Client** | Pointer to **string** | | [optional] +**Client** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md index 591ab03c6a64..4b5c332d8e14 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | Pointer to **string** | | **Color** | Pointer to **string** | | [optional] [default to red] -**Breed** | Pointer to **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md index e5103c49754f..a3169521cecc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Breed** | Pointer to **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md index 6d6028e96663..31d7b2b9faaa 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustSymbol** | Pointer to **string** | | [optional] -**ArrayEnum** | Pointer to **[]string** | | [optional] +**JustSymbol** | Pointer to **string** | | [optional] +**ArrayEnum** | Pointer to **[]string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md index f396e0e32a2c..d0e7aebc42d0 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | Pointer to **string** | | [optional] +**EnumString** | Pointer to **string** | | [optional] **EnumStringRequired** | Pointer to **string** | | -**EnumInteger** | Pointer to **int32** | | [optional] -**EnumNumber** | Pointer to **float64** | | [optional] -**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] +**EnumInteger** | Pointer to **int32** | | [optional] +**EnumNumber** | Pointer to **float64** | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md b/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md index b7927f181e40..9aaf2e63a96f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | @@ -539,3 +540,40 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/File.md b/samples/client/petstore/go-experimental/go-petstore/docs/File.md index 07d269cd8811..454b159609c1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/File.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/File.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SourceURI** | Pointer to **string** | Test capitalization | [optional] +**SourceURI** | Pointer to **string** | Test capitalization | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md index 4a12b7f6d570..d4a4da7206c4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**File** | Pointer to [**File**](File.md) | | [optional] -**Files** | Pointer to [**[]File**](File.md) | | [optional] +**File** | Pointer to [**File**](File.md) | | [optional] +**Files** | Pointer to [**[]File**](File.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md index 7b0c3d451ce8..6711f4f4fcc7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | Pointer to **int32** | | [optional] -**Int32** | Pointer to **int32** | | [optional] -**Int64** | Pointer to **int64** | | [optional] +**Integer** | Pointer to **int32** | | [optional] +**Int32** | Pointer to **int32** | | [optional] +**Int64** | Pointer to **int64** | | [optional] **Number** | Pointer to **float32** | | -**Float** | Pointer to **float32** | | [optional] -**Double** | Pointer to **float64** | | [optional] -**String** | Pointer to **string** | | [optional] +**Float** | Pointer to **float32** | | [optional] +**Double** | Pointer to **float64** | | [optional] +**String** | Pointer to **string** | | [optional] **Byte** | Pointer to **string** | | -**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] +**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] **Date** | Pointer to **string** | | -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] **Password** | Pointer to **string** | | ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md index 33cc010f3a2c..78f67041d33a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] -**Foo** | Pointer to **string** | | [optional] +**Bar** | Pointer to **string** | | [optional] +**Foo** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/List.md b/samples/client/petstore/go-experimental/go-petstore/docs/List.md index 53784dd47a95..ca8849936e72 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/List.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/List.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Var123List** | Pointer to **string** | | [optional] +**Var123List** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md index 6994b17ec5b7..6c84c2e89c2a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | Pointer to **map[string]string** | | [optional] -**DirectMap** | Pointer to **map[string]bool** | | [optional] -**IndirectMap** | Pointer to **map[string]bool** | | [optional] +**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapOfEnumString** | Pointer to **map[string]string** | | [optional] +**DirectMap** | Pointer to **map[string]bool** | | [optional] +**IndirectMap** | Pointer to **map[string]bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index f12ed969afdb..49f7c8eb7687 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | Pointer to **string** | | [optional] -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md b/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md index b0fbf5369ef3..d0bde7b7f7b3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **int32** | | [optional] -**Class** | Pointer to **string** | | [optional] +**Name** | Pointer to **int32** | | [optional] +**Class** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Name.md b/samples/client/petstore/go-experimental/go-petstore/docs/Name.md index 3b1d29f51858..7cc6fd6a3a43 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Name.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Name.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | Pointer to **int32** | | -**SnakeCase** | Pointer to **int32** | | [optional] -**Property** | Pointer to **string** | | [optional] -**Var123Number** | Pointer to **int32** | | [optional] +**SnakeCase** | Pointer to **int32** | | [optional] +**Property** | Pointer to **string** | | [optional] +**Var123Number** | Pointer to **int32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md index 3521b8b2d089..c8dcac264c2d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | Pointer to **float32** | | [optional] +**JustNumber** | Pointer to **float32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Order.md b/samples/client/petstore/go-experimental/go-petstore/docs/Order.md index 982f9f591c97..8aa8bbd1ee54 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Order.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Order.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**PetId** | Pointer to **int64** | | [optional] -**Quantity** | Pointer to **int32** | | [optional] -**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Status** | Pointer to **string** | Order Status | [optional] +**Id** | Pointer to **int64** | | [optional] +**PetId** | Pointer to **int64** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Status** | Pointer to **string** | Order Status | [optional] **Complete** | Pointer to **bool** | | [optional] [default to false] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md b/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md index 30a345dc8d1c..f89080222827 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | Pointer to **float32** | | [optional] -**MyString** | Pointer to **string** | | [optional] -**MyBoolean** | Pointer to **bool** | | [optional] +**MyNumber** | Pointer to **float32** | | [optional] +**MyString** | Pointer to **string** | | [optional] +**MyBoolean** | Pointer to **bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md b/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md index 81a4ec294e72..dba9589f9d77 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Category** | Pointer to [**Category**](Category.md) | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Category** | Pointer to [**Category**](Category.md) | | [optional] **Name** | Pointer to **string** | | **PhotoUrls** | Pointer to **[]string** | | -**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] -**Status** | Pointer to **string** | pet status in the store | [optional] +**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] +**Status** | Pointer to **string** | pet status in the store | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md b/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md index e490a0fc96c0..552f0170bd85 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] -**Baz** | Pointer to **string** | | [optional] +**Bar** | Pointer to **string** | | [optional] +**Baz** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Return.md b/samples/client/petstore/go-experimental/go-petstore/docs/Return.md index 5c586fcbc6c5..1facabb6bbf3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Return.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Return.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Return** | Pointer to **int32** | | [optional] +**Return** | Pointer to **int32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md b/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md index 9e7d3f377def..34d8d8d89c72 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | Pointer to **int64** | | [optional] +**SpecialPropertyName** | Pointer to **int64** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md b/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md index 570126bd5f4b..bf868298a5e7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | Pointer to **string** | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md b/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md index 09347e617576..85097ef9fbe5 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**StringItem** | Pointer to **string** | | [default to what] +**StringItem** | Pointer to **string** | | [default to what] **NumberItem** | Pointer to **float32** | | **IntegerItem** | Pointer to **int32** | | -**BoolItem** | Pointer to **bool** | | [default to true] +**BoolItem** | Pointer to **bool** | | [default to true] **ArrayItem** | Pointer to **[]int32** | | ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/User.md b/samples/client/petstore/go-experimental/go-petstore/docs/User.md index 4f05d3b473e8..8b93a65d8ab7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/User.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/User.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Username** | Pointer to **string** | | [optional] -**FirstName** | Pointer to **string** | | [optional] -**LastName** | Pointer to **string** | | [optional] -**Email** | Pointer to **string** | | [optional] -**Password** | Pointer to **string** | | [optional] -**Phone** | Pointer to **string** | | [optional] -**UserStatus** | Pointer to **int32** | User Status | [optional] +**Id** | Pointer to **int64** | | [optional] +**Username** | Pointer to **string** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**UserStatus** | Pointer to **int32** | User Status | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md b/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md index cdee2ad0dd75..99c95015d5ff 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md @@ -4,35 +4,35 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AttributeString** | Pointer to **string** | | [optional] -**AttributeNumber** | Pointer to **float32** | | [optional] -**AttributeInteger** | Pointer to **int32** | | [optional] -**AttributeBoolean** | Pointer to **bool** | | [optional] -**WrappedArray** | Pointer to **[]int32** | | [optional] -**NameString** | Pointer to **string** | | [optional] -**NameNumber** | Pointer to **float32** | | [optional] -**NameInteger** | Pointer to **int32** | | [optional] -**NameBoolean** | Pointer to **bool** | | [optional] -**NameArray** | Pointer to **[]int32** | | [optional] -**NameWrappedArray** | Pointer to **[]int32** | | [optional] -**PrefixString** | Pointer to **string** | | [optional] -**PrefixNumber** | Pointer to **float32** | | [optional] -**PrefixInteger** | Pointer to **int32** | | [optional] -**PrefixBoolean** | Pointer to **bool** | | [optional] -**PrefixArray** | Pointer to **[]int32** | | [optional] -**PrefixWrappedArray** | Pointer to **[]int32** | | [optional] -**NamespaceString** | Pointer to **string** | | [optional] -**NamespaceNumber** | Pointer to **float32** | | [optional] -**NamespaceInteger** | Pointer to **int32** | | [optional] -**NamespaceBoolean** | Pointer to **bool** | | [optional] -**NamespaceArray** | Pointer to **[]int32** | | [optional] -**NamespaceWrappedArray** | Pointer to **[]int32** | | [optional] -**PrefixNsString** | Pointer to **string** | | [optional] -**PrefixNsNumber** | Pointer to **float32** | | [optional] -**PrefixNsInteger** | Pointer to **int32** | | [optional] -**PrefixNsBoolean** | Pointer to **bool** | | [optional] -**PrefixNsArray** | Pointer to **[]int32** | | [optional] -**PrefixNsWrappedArray** | Pointer to **[]int32** | | [optional] +**AttributeString** | Pointer to **string** | | [optional] +**AttributeNumber** | Pointer to **float32** | | [optional] +**AttributeInteger** | Pointer to **int32** | | [optional] +**AttributeBoolean** | Pointer to **bool** | | [optional] +**WrappedArray** | Pointer to **[]int32** | | [optional] +**NameString** | Pointer to **string** | | [optional] +**NameNumber** | Pointer to **float32** | | [optional] +**NameInteger** | Pointer to **int32** | | [optional] +**NameBoolean** | Pointer to **bool** | | [optional] +**NameArray** | Pointer to **[]int32** | | [optional] +**NameWrappedArray** | Pointer to **[]int32** | | [optional] +**PrefixString** | Pointer to **string** | | [optional] +**PrefixNumber** | Pointer to **float32** | | [optional] +**PrefixInteger** | Pointer to **int32** | | [optional] +**PrefixBoolean** | Pointer to **bool** | | [optional] +**PrefixArray** | Pointer to **[]int32** | | [optional] +**PrefixWrappedArray** | Pointer to **[]int32** | | [optional] +**NamespaceString** | Pointer to **string** | | [optional] +**NamespaceNumber** | Pointer to **float32** | | [optional] +**NamespaceInteger** | Pointer to **int32** | | [optional] +**NamespaceBoolean** | Pointer to **bool** | | [optional] +**NamespaceArray** | Pointer to **[]int32** | | [optional] +**NamespaceWrappedArray** | Pointer to **[]int32** | | [optional] +**PrefixNsString** | Pointer to **string** | | [optional] +**PrefixNsNumber** | Pointer to **float32** | | [optional] +**PrefixNsInteger** | Pointer to **int32** | | [optional] +**PrefixNsBoolean** | Pointer to **bool** | | [optional] +**PrefixNsArray** | Pointer to **[]int32** | | [optional] +**PrefixNsWrappedArray** | Pointer to **[]int32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go index 97ced8c6d195..cebe724d060e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -11,8 +11,7 @@ package petstore import ( "encoding/json" ) - -// Model for testing model name starting with number +// Model200Response Model for testing model name starting with number type Model200Response struct { Name *int32 `json:"name,omitempty"` @@ -87,6 +86,7 @@ func (o *Model200Response) SetClass(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Model200Response) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go index baa81b92e586..586b84f029b6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesAnyType) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go index 0ccbf37442e7..8cda0b7d08da 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesArray struct for AdditionalPropertiesArray type AdditionalPropertiesArray struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesArray) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesArray) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go index efa95a8767d6..0148cce9ab42 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean type AdditionalPropertiesBoolean struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesBoolean) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go index 534148d11de7..6d9025a8965b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { MapString *map[string]string `json:"map_string,omitempty"` @@ -401,6 +401,7 @@ func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{}) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MapString != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go index 05dea42d5117..c779aa63676c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger type AdditionalPropertiesInteger struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesInteger) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesInteger) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go index 484c9d79ad9f..c14902300c67 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber type AdditionalPropertiesNumber struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesNumber) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesNumber) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go index 0482ad8ef17f..3fafb78aec03 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesObject struct for AdditionalPropertiesObject type AdditionalPropertiesObject struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesObject) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesObject) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go index 561cd0819175..bc75e98add3a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// AdditionalPropertiesString struct for AdditionalPropertiesString type AdditionalPropertiesString struct { Name *string `json:"name,omitempty"` @@ -51,6 +51,7 @@ func (o *AdditionalPropertiesString) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o AdditionalPropertiesString) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/client/petstore/go-experimental/go-petstore/model_animal.go index 897cac1f45db..877476882ed5 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_animal.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_animal.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// Animal struct for Animal type Animal struct { ClassName *string `json:"className,omitempty"` @@ -87,6 +87,7 @@ func (o *Animal) SetColor(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Animal) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ClassName == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go index 009e99107212..358d4d4e569b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// ApiResponse struct for ApiResponse type ApiResponse struct { Code *int32 `json:"code,omitempty"` @@ -121,6 +121,7 @@ func (o *ApiResponse) SetMessage(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o ApiResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Code != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go index aadebc92a453..de619c3fa055 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` @@ -51,6 +51,7 @@ func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { } +// MarshalJSON returns the JSON representation of the model. func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ArrayArrayNumber != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go index 418a07d7d623..4efd5be06039 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` @@ -51,6 +51,7 @@ func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { } +// MarshalJSON returns the JSON representation of the model. func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ArrayNumber != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go index 8fa143ded804..2e1b18949dc2 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// ArrayTest struct for ArrayTest type ArrayTest struct { ArrayOfString *[]string `json:"array_of_string,omitempty"` @@ -121,6 +121,7 @@ func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { } +// MarshalJSON returns the JSON representation of the model. func (o ArrayTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ArrayOfString != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go index 107dd7932e1c..9cd486a70ca6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// Capitalization struct for Capitalization type Capitalization struct { SmallCamel *string `json:"smallCamel,omitempty"` @@ -227,6 +227,7 @@ func (o *Capitalization) SetATT_NAME(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Capitalization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.SmallCamel != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_cat.go index 8efbf58fd1e7..07dfafae8b65 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// Cat struct for Cat type Cat struct { ClassName *string `json:"className,omitempty"` @@ -122,6 +122,7 @@ func (o *Cat) SetDeclawed(v bool) { } +// MarshalJSON returns the JSON representation of the model. func (o Cat) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ClassName == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go index aaf2c8badb5a..db53c7dbbd6b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// CatAllOf struct for CatAllOf type CatAllOf struct { Declawed *bool `json:"declawed,omitempty"` @@ -51,6 +51,7 @@ func (o *CatAllOf) SetDeclawed(v bool) { } +// MarshalJSON returns the JSON representation of the model. func (o CatAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Declawed != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_category.go b/samples/client/petstore/go-experimental/go-petstore/model_category.go index c55d4bd6e99d..eef9caf28f1f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_category.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_category.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// Category struct for Category type Category struct { Id *int64 `json:"id,omitempty"` @@ -87,6 +87,7 @@ func (o *Category) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Category) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Id != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go index 0dcaa2643114..8a83ac5698bd 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -11,8 +11,7 @@ package petstore import ( "encoding/json" ) - -// Model for testing model with \"_class\" property +// ClassModel Model for testing model with \"_class\" property type ClassModel struct { Class *string `json:"_class,omitempty"` @@ -52,6 +51,7 @@ func (o *ClassModel) SetClass(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o ClassModel) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Class != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_client.go b/samples/client/petstore/go-experimental/go-petstore/model_client.go index 72ebd543000b..abead359c737 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_client.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_client.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// Client struct for Client type Client struct { Client *string `json:"client,omitempty"` @@ -51,6 +51,7 @@ func (o *Client) SetClient(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Client) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Client != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/client/petstore/go-experimental/go-petstore/model_dog.go index dd9c4e1d67db..2c09989cca72 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// Dog struct for Dog type Dog struct { ClassName *string `json:"className,omitempty"` @@ -122,6 +122,7 @@ func (o *Dog) SetBreed(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Dog) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.ClassName == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go index 9dd6d964f025..abd645b6e72d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// DogAllOf struct for DogAllOf type DogAllOf struct { Breed *string `json:"breed,omitempty"` @@ -51,6 +51,7 @@ func (o *DogAllOf) SetBreed(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o DogAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Breed != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go index b52471416a8e..453848096d14 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// EnumArrays struct for EnumArrays type EnumArrays struct { JustSymbol *string `json:"just_symbol,omitempty"` @@ -86,6 +86,7 @@ func (o *EnumArrays) SetArrayEnum(v []string) { } +// MarshalJSON returns the JSON representation of the model. func (o EnumArrays) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.JustSymbol != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go index b52d1095424b..06f7d5535ded 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -8,6 +8,7 @@ */ package petstore +// EnumClass the model 'EnumClass' type EnumClass string // List of EnumClass @@ -17,3 +18,4 @@ const ( XYZ EnumClass = "(xyz)" ) + diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go index 1e9f8a449e97..17a5fc44fd34 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// EnumTest struct for EnumTest type EnumTest struct { EnumString *string `json:"enum_string,omitempty"` @@ -192,6 +192,7 @@ func (o *EnumTest) SetOuterEnum(v OuterEnum) { } +// MarshalJSON returns the JSON representation of the model. func (o EnumTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.EnumString != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file.go b/samples/client/petstore/go-experimental/go-petstore/model_file.go index 4968739ef45b..872952cc14ea 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_file.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_file.go @@ -11,8 +11,7 @@ package petstore import ( "encoding/json" ) - -// Must be named `File` for test. +// File Must be named `File` for test. type File struct { // Test capitalization SourceURI *string `json:"sourceURI,omitempty"` @@ -53,6 +52,7 @@ func (o *File) SetSourceURI(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o File) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.SourceURI != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go index 16cd67f29d31..3926d06b2398 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { File *File `json:"file,omitempty"` @@ -86,6 +86,7 @@ func (o *FileSchemaTestClass) SetFiles(v []File) { } +// MarshalJSON returns the JSON representation of the model. func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.File != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go index 5532e92477f3..8ddb18f24b6b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -14,7 +14,7 @@ import ( "encoding/json" "errors" ) - +// FormatTest struct for FormatTest type FormatTest struct { Integer *int32 `json:"integer,omitempty"` @@ -474,6 +474,7 @@ func (o *FormatTest) SetPassword(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o FormatTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Integer != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go index 1b03286159ef..a36344fdf8ea 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { Bar *string `json:"bar,omitempty"` @@ -86,6 +86,7 @@ func (o *HasOnlyReadOnly) SetFoo(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Bar != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_list.go b/samples/client/petstore/go-experimental/go-petstore/model_list.go index 5c9d4df5c950..2d1e013e6840 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_list.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_list.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// List struct for List type List struct { Var123List *string `json:"123-list,omitempty"` @@ -51,6 +51,7 @@ func (o *List) SetVar123List(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o List) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Var123List != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go index 3ae7b22b887b..1f5db78738cc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// MapTest struct for MapTest type MapTest struct { MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` @@ -156,6 +156,7 @@ func (o *MapTest) SetIndirectMap(v map[string]bool) { } +// MarshalJSON returns the JSON representation of the model. func (o MapTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MapMapOfString != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go index 5dd3d1d02068..8f8d81b2c586 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -12,7 +12,7 @@ import ( "time" "encoding/json" ) - +// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass type MixedPropertiesAndAdditionalPropertiesClass struct { Uuid *string `json:"uuid,omitempty"` @@ -122,6 +122,7 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal } +// MarshalJSON returns the JSON representation of the model. func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Uuid != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_name.go index 1a0addae441b..ce720badba43 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_name.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_name.go @@ -12,8 +12,7 @@ import ( "encoding/json" "errors" ) - -// Model for testing model name same as property name +// Name Model for testing model name same as property name type Name struct { Name *int32 `json:"name,omitempty"` @@ -158,6 +157,7 @@ func (o *Name) SetVar123Number(v int32) { } +// MarshalJSON returns the JSON representation of the model. func (o Name) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go index 47d69c607e21..0cc88037cdd4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// NumberOnly struct for NumberOnly type NumberOnly struct { JustNumber *float32 `json:"JustNumber,omitempty"` @@ -51,6 +51,7 @@ func (o *NumberOnly) SetJustNumber(v float32) { } +// MarshalJSON returns the JSON representation of the model. func (o NumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.JustNumber != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_order.go b/samples/client/petstore/go-experimental/go-petstore/model_order.go index 75d9299386da..c0aefd904826 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_order.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_order.go @@ -12,7 +12,7 @@ import ( "time" "encoding/json" ) - +// Order struct for Order type Order struct { Id *int64 `json:"id,omitempty"` @@ -228,6 +228,7 @@ func (o *Order) SetComplete(v bool) { } +// MarshalJSON returns the JSON representation of the model. func (o Order) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Id != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go index 83723a9b8ef1..1fe5d4103461 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// OuterComposite struct for OuterComposite type OuterComposite struct { MyNumber *float32 `json:"my_number,omitempty"` @@ -121,6 +121,7 @@ func (o *OuterComposite) SetMyBoolean(v bool) { } +// MarshalJSON returns the JSON representation of the model. func (o OuterComposite) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MyNumber != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go index 131a07c71a8e..f133b6fc890c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -8,6 +8,7 @@ */ package petstore +// OuterEnum the model 'OuterEnum' type OuterEnum string // List of OuterEnum @@ -17,3 +18,4 @@ const ( DELIVERED OuterEnum = "delivered" ) + diff --git a/samples/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/client/petstore/go-experimental/go-petstore/model_pet.go index 1216b0e799e1..110a21e094e4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_pet.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// Pet struct for Pet type Pet struct { Id *int64 `json:"id,omitempty"` @@ -228,6 +228,7 @@ func (o *Pet) SetStatus(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Pet) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Id != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go index 5c92010e8d0c..4ed8a2571764 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { Bar *string `json:"bar,omitempty"` @@ -86,6 +86,7 @@ func (o *ReadOnlyFirst) SetBaz(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Bar != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_return.go b/samples/client/petstore/go-experimental/go-petstore/model_return.go index e53cc31b5f58..c694495fdac8 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_return.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_return.go @@ -11,8 +11,7 @@ package petstore import ( "encoding/json" ) - -// Model for testing reserved words +// Return Model for testing reserved words type Return struct { Return *int32 `json:"return,omitempty"` @@ -52,6 +51,7 @@ func (o *Return) SetReturn(v int32) { } +// MarshalJSON returns the JSON representation of the model. func (o Return) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Return != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go index 7e940165d9b6..5568361e1d5f 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// SpecialModelName struct for SpecialModelName type SpecialModelName struct { SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` @@ -51,6 +51,7 @@ func (o *SpecialModelName) SetSpecialPropertyName(v int64) { } +// MarshalJSON returns the JSON representation of the model. func (o SpecialModelName) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.SpecialPropertyName != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/client/petstore/go-experimental/go-petstore/model_tag.go index dc4053da9bde..063283820e92 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_tag.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_tag.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// Tag struct for Tag type Tag struct { Id *int64 `json:"id,omitempty"` @@ -86,6 +86,7 @@ func (o *Tag) SetName(v string) { } +// MarshalJSON returns the JSON representation of the model. func (o Tag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Id != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go index f1fcc93dd8ad..7022b082547d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// TypeHolderDefault struct for TypeHolderDefault type TypeHolderDefault struct { StringItem *string `json:"string_item,omitempty"` @@ -192,6 +192,7 @@ func (o *TypeHolderDefault) SetArrayItem(v []int32) { } +// MarshalJSON returns the JSON representation of the model. func (o TypeHolderDefault) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StringItem == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go index 0fe346c7cd1e..8a422eca9f96 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go @@ -12,7 +12,7 @@ import ( "encoding/json" "errors" ) - +// TypeHolderExample struct for TypeHolderExample type TypeHolderExample struct { StringItem *string `json:"string_item,omitempty"` @@ -192,6 +192,7 @@ func (o *TypeHolderExample) SetArrayItem(v []int32) { } +// MarshalJSON returns the JSON representation of the model. func (o TypeHolderExample) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StringItem == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_user.go b/samples/client/petstore/go-experimental/go-petstore/model_user.go index 925f82d582be..174a791aa728 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_user.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// User struct for User type User struct { Id *int64 `json:"id,omitempty"` @@ -297,6 +297,7 @@ func (o *User) SetUserStatus(v int32) { } +// MarshalJSON returns the JSON representation of the model. func (o User) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Id != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go index 2f0f8f89c47e..e1b9efa8e0b9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go @@ -11,7 +11,7 @@ package petstore import ( "encoding/json" ) - +// XmlItem struct for XmlItem type XmlItem struct { AttributeString *string `json:"attribute_string,omitempty"` @@ -1031,6 +1031,7 @@ func (o *XmlItem) SetPrefixNsWrappedArray(v []int32) { } +// MarshalJSON returns the JSON representation of the model. func (o XmlItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.AttributeString != nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/response.go b/samples/client/petstore/go-experimental/go-petstore/response.go index 38f373df75ee..c16f181f4e94 100644 --- a/samples/client/petstore/go-experimental/go-petstore/response.go +++ b/samples/client/petstore/go-experimental/go-petstore/response.go @@ -13,6 +13,7 @@ import ( "net/http" ) +// APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` @@ -30,12 +31,14 @@ type APIResponse struct { Payload []byte `json:"-"` } +// NewAPIResponse returns a new APIResonse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index a0aa0040ef3c..052b43c30a61 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 5a020a1d0ab8..37a46abf4feb 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -791,6 +791,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1100,6 +1101,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1815,6 +1869,10 @@ components: number_item: example: 1.234 type: number + float_item: + example: 1.234 + format: float + type: number integer_item: example: -2 type: integer @@ -1833,6 +1891,7 @@ components: required: - array_item - bool_item + - float_item - integer_item - number_item - string_item diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go index c6d1c2625564..8402309be60f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go @@ -11,29 +11,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service /* -AnotherFakeApiService To test special tags +Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,70 +46,70 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 24b92afc3a9b..c08e9e995e90 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -11,30 +11,32 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "github.com/antihax/optional" "os" + "reflect" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeApiService FakeApi service type FakeApiService service /* -FakeApiService creates an XmlItem +CreateXmlItem creates an XmlItem this route creates an XmlItem - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param xmlItem XmlItem Body */ -func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*http.Response, error) { +func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,71 +47,71 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} + localVarHTTPContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &xmlItem - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' +type FakeOuterBooleanSerializeOpts struct { + Body optional.Bool } /* -FakeApiService +FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: * @param "Body" (optional.Bool) - Input boolean as post body @return bool */ - -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool -} - -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -121,93 +123,93 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v bool - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' +type FakeOuterCompositeSerializeOpts struct { + Body optional.Interface } /* -FakeApiService +FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body @return OuterComposite */ - -type FakeOuterCompositeSerializeOpts struct { - Body optional.Interface -} - -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -219,25 +221,25 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { @@ -248,68 +250,68 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPostBody = &localVarOptionalBody } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v OuterComposite - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' +type FakeOuterNumberSerializeOpts struct { + Body optional.Float32 } /* -FakeApiService +FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: * @param "Body" (optional.Float32) - Input number as post body @return float32 */ - -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 -} - -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -321,93 +323,93 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/number" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v float32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' +type FakeOuterStringSerializeOpts struct { + Body optional.String } /* -FakeApiService +FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: * @param "Body" (optional.String) - Input string as post body @return string */ - -type FakeOuterStringSerializeOpts struct { - Body optional.String -} - -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -419,86 +421,86 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/string" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -FakeApiService +TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSchemaTestClass) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -509,64 +511,64 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param query * @param body */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, body User) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -577,66 +579,66 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("query", parameterToString(query, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService To test \"client\" model +TestClientModel To test \"client\" model To test \"client\" model - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -648,78 +650,92 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' +type TestEndpointParametersOpts struct { + Integer optional.Int32 + Int32_ optional.Int32 + Int64_ optional.Int64 + Float optional.Float32 + String_ optional.String + Binary optional.Interface + Date optional.String + DateTime optional.Time + Password optional.String + Callback optional.String } /* -FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param number None * @param double None * @param patternWithoutDelimiter None @@ -736,23 +752,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * @param "Password" (optional.String) - None * @param "Callback" (optional.String) - None */ - -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String -} - -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -763,8 +765,8 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if number < 32.1 { return nil, reportError("number must be greater than 32.1") } @@ -779,21 +781,21 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) @@ -824,7 +826,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -833,11 +835,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) } if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { - paramJson, err := parameterToJson(localVarOptionals.DateTime.Value()) - if err != nil { - return nil, err - } - localVarFormParams.Add("dateTime", paramJson) + localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Password.IsSet() { localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) @@ -845,37 +843,49 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' +type TestEnumParametersOpts struct { + EnumHeaderStringArray optional.Interface + EnumHeaderString optional.String + EnumQueryStringArray optional.Interface + EnumQueryString optional.String + EnumQueryInteger optional.Int32 + EnumQueryDouble optional.Float64 + EnumFormStringArray optional.Interface + EnumFormString optional.String } /* -FakeApiService To test enum parameters +TestEnumParameters To test enum parameters To test enum parameters - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *TestEnumParametersOpts - Optional Parameters: * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) @@ -886,21 +896,9 @@ To test enum parameters * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) */ - -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String -} - -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -911,8 +909,8 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv")) @@ -927,21 +925,21 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") @@ -955,37 +953,44 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' +type TestGroupParametersOpts struct { + StringGroup optional.Int32 + BooleanGroup optional.Bool + Int64Group optional.Int64 } /* -FakeApiService Fake endpoint to test group parameters (optional) +TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requiredStringGroup Required String in group parameters * @param requiredBooleanGroup Required Boolean in group parameters * @param requiredInt64Group Required Integer in group parameters @@ -994,16 +999,9 @@ Fake endpoint to test group parameters (optional) * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters * @param "Int64Group" (optional.Int64) - Integer in group parameters */ - -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 -} - -func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1014,8 +1012,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) @@ -1026,61 +1024,61 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test inline additionalProperties - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param request body */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param map[string]string) (*http.Response, error) { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1091,64 +1089,64 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = ¶m - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test json serialization of form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestJsonFormData test json serialization of form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param field1 * @param param2 field2 */ -func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1159,51 +1157,134 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarFormParams.Add("param", parameterToString(param, "")) localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go index dd7a0babfed8..9db5a88cd3ca 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go @@ -11,29 +11,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service /* -FakeClassnameTags123ApiService To test class name in snake case +TestClassname To test class name in snake case To test class name in snake case - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,25 +46,25 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarPath := a.client.cfg.BasePath + "/fake_classname_test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body @@ -79,48 +80,48 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarQueryParams.Add("api_key_query", key) } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go index 6b159c5001a8..940991f0b617 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -11,10 +11,10 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" "github.com/antihax/optional" @@ -23,19 +23,20 @@ import ( // Linger please var ( - _ context.Context + _ _context.Context ) +// PetApiService PetApi service type PetApiService service /* -PetApiService Add a new pet to the store - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +AddPet Add a new pet to the store + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Pet object that needs to be added to the store */ -func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) { +func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -46,70 +47,70 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// DeletePetOpts Optional parameters for the method 'DeletePet' +type DeletePetOpts struct { + ApiKey optional.String } /* -PetApiService Deletes a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +DeletePet Deletes a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete * @param optional nil or *DeletePetOpts - Optional Parameters: * @param "ApiKey" (optional.String) - */ - -type DeletePetOpts struct { - ApiKey optional.String -} - -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -118,69 +119,69 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -PetApiService Finds Pets by status +FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param status Status values that need to be considered for filter @return []Pet */ -func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -192,83 +193,83 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("status", parameterToString(status, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Finds Pets by tags +FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param tags Tags to filter by @return []Pet */ -func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -280,83 +281,83 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe localVarPath := a.client.cfg.BasePath + "/pet/findByTags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("tags", parameterToString(tags, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Find pet by ID +GetPetById Find pet by ID Returns a single pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to return @return Pet */ -func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -366,28 +367,28 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -401,60 +402,60 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Update an existing pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Pet object that needs to be added to the store */ -func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) { +func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -465,72 +466,72 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' +type UpdatePetWithFormOpts struct { + Name optional.String + Status optional.String } /* -PetApiService Updates a pet in the store with form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePetWithForm Updates a pet in the store with form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: * @param "Name" (optional.String) - Updated name of the pet * @param "Status" (optional.String) - Updated status of the pet */ - -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String -} - -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -539,28 +540,28 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Name.IsSet() { localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) @@ -568,51 +569,51 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca if localVarOptionals != nil && localVarOptionals.Status.IsSet() { localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UploadFileOpts Optional parameters for the method 'UploadFile' +type UploadFileOpts struct { + AdditionalMetadata optional.String + File optional.Interface } /* -PetApiService uploads an image - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFile uploads an image + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param optional nil or *UploadFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server * @param "File" (optional.Interface of *os.File) - file to upload @return ApiResponse */ - -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface -} - -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -622,28 +623,28 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -658,74 +659,74 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String } /* -PetApiService uploads an image (required) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFileWithRequiredFile uploads an image (required) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param requiredFile file to upload * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server @return ApiResponse */ - -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String -} - -func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -735,28 +736,28 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in // create path and map variables localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -764,53 +765,53 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in localVarFormFileName = "requiredFile" localVarFile := requiredFile if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go index ae780c2998ed..f633003003c2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -11,30 +11,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// StoreApiService StoreApi service type StoreApiService service /* -StoreApiService Delete purchase order by ID +DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of the order that needs to be deleted */ -func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -43,65 +44,65 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -StoreApiService Returns pet inventories by status +GetInventory Returns pet inventories by status Returns a map of status codes to quantities - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return map[string]int32 */ -func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { +func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -113,25 +114,25 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarPath := a.client.cfg.BasePath + "/store/inventory" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -145,62 +146,62 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v map[string]int32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Find purchase order by ID +GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of pet that needs to be fetched @return Order */ -func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -210,11 +211,11 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -223,77 +224,77 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Place an order for a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +PlaceOrder Place an order for a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body order placed for purchasing the pet @return Order */ -func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) { +func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -305,70 +306,70 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h localVarPath := a.client.cfg.BasePath + "/store/order" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go index be573458c73f..f864cc33256f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -11,30 +11,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// UserApiService UserApi service type UserApiService service /* -UserApiService Create user +CreateUser Create user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Created user object */ -func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) { +func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,63 +46,63 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo localVarPath := a.client.cfg.BasePath + "/user" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithArrayInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body List of user object */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -112,63 +113,63 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U localVarPath := a.client.cfg.BasePath + "/user/createWithArray" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithListInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body List of user object */ -func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -179,64 +180,64 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us localVarPath := a.client.cfg.BasePath + "/user/createWithList" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Delete user +DeleteUser Delete user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be deleted */ -func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -245,65 +246,65 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Get user by user name - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +GetUserByName Get user by user name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. @return User */ -func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -313,85 +314,85 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v User - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs user into the system - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LoginUser Logs user into the system + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The user name for login * @param password The password for login in clear text @return string */ -func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { +func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -403,81 +404,81 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor localVarPath := a.client.cfg.BasePath + "/user/login" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("username", parameterToString(username, "")) localVarQueryParams.Add("password", parameterToString(password, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs out current logged in user session - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LogoutUser Logs out current logged in user session + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ -func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { +func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -488,63 +489,63 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) localVarPath := a.client.cfg.BasePath + "/user/logout" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Updated user +UpdateUser Updated user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username name that need to be deleted * @param body Updated user object */ -func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -553,54 +554,54 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 631e48fcef7d..7791762a544f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -176,7 +176,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } -// Change base path to allow switching to mocks +// ChangeBasePath changes base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/samples/client/petstore/go/go-petstore-withXml/configuration.go index 3819712b0719..d471b5661893 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/samples/client/petstore/go/go-petstore-withXml/configuration.go @@ -50,6 +50,7 @@ type APIKey struct { Prefix string } +// Configuration stores the configuration of the API client type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` @@ -59,6 +60,7 @@ type Configuration struct { HTTPClient *http.Client } +// NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "http://petstore.swagger.io:80/v2", @@ -68,6 +70,7 @@ func NewConfiguration() *Configuration { return cfg } +// AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md index b7927f181e40..9aaf2e63a96f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | @@ -539,3 +540,40 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md b/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md index abe85f9799d1..f4d62ea836b8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | **NumberItem** | **float32** | | +**FloatItem** | **float32** | | **IntegerItem** | **int32** | | **BoolItem** | **bool** | | **ArrayItem** | **[]int32** | | diff --git a/samples/client/petstore/go/go-petstore-withXml/git_push.sh b/samples/client/petstore/go/go-petstore-withXml/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/go/go-petstore-withXml/git_push.sh +++ b/samples/client/petstore/go/go-petstore-withXml/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/go/go-petstore-withXml/model_200_response.go b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go index c595db807750..4369b00ce9b8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go @@ -9,8 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - -// Model for testing model name starting with number +// Model200Response Model for testing model name starting with number type Model200Response struct { Name int32 `json:"name,omitempty" xml:"name"` Class string `json:"class,omitempty" xml:"class"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go index 6977ea451be0..fcfddb38ca8a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go index ef3055a02b38..ac004da18696 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesArray struct for AdditionalPropertiesArray type AdditionalPropertiesArray struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go index 6cd68b36627a..be33e75b25d3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean type AdditionalPropertiesBoolean struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go index 363a62f7a3e3..35aafa9f6029 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { MapString map[string]string `json:"map_string,omitempty" xml:"map_string"` MapNumber map[string]float32 `json:"map_number,omitempty" xml:"map_number"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go index 7878ce4a0661..8ea57854dba7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger type AdditionalPropertiesInteger struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go index f95c1a6e3d64..42f02627a3af 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber type AdditionalPropertiesNumber struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go index e69e51537480..f45e16a05f4f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesObject struct for AdditionalPropertiesObject type AdditionalPropertiesObject struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go index 7fb9acc4f2a1..8e12de1f66c7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// AdditionalPropertiesString struct for AdditionalPropertiesString type AdditionalPropertiesString struct { Name string `json:"name,omitempty" xml:"name"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_animal.go b/samples/client/petstore/go/go-petstore-withXml/model_animal.go index 69c91c1b3575..e8f930b66184 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_animal.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_animal.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Animal struct for Animal type Animal struct { ClassName string `json:"className" xml:"className"` Color string `json:"color,omitempty" xml:"color"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go index 9f617359fd81..8d532bbbacba 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// ApiResponse struct for ApiResponse type ApiResponse struct { Code int32 `json:"code,omitempty" xml:"code"` Type string `json:"type,omitempty" xml:"type"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go index ed5167ff2d5d..179ea4ef63a7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty" xml:"ArrayArrayNumber"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go index 1c23a80552a5..6dccb378292a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { ArrayNumber []float32 `json:"ArrayNumber,omitempty" xml:"ArrayNumber"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go index 3a0f7178d2b5..f8df9e29c33d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// ArrayTest struct for ArrayTest type ArrayTest struct { ArrayOfString []string `json:"array_of_string,omitempty" xml:"array_of_string"` ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty" xml:"array_array_of_integer"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go index 66c5fc6c1480..4dab2751ec20 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Capitalization struct for Capitalization type Capitalization struct { SmallCamel string `json:"smallCamel,omitempty" xml:"smallCamel"` CapitalCamel string `json:"CapitalCamel,omitempty" xml:"CapitalCamel"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_cat.go index f59648881a6e..b9345db85389 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Cat struct for Cat type Cat struct { ClassName string `json:"className" xml:"className"` Color string `json:"color,omitempty" xml:"color"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go index c01d44785e94..f430c16e9ac2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// CatAllOf struct for CatAllOf type CatAllOf struct { Declawed bool `json:"declawed,omitempty" xml:"declawed"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_category.go b/samples/client/petstore/go/go-petstore-withXml/model_category.go index 134f5e8534cf..8c061446d4b6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_category.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_category.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Category struct for Category type Category struct { Id int64 `json:"id,omitempty" xml:"id"` Name string `json:"name" xml:"name"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go index 8c7a002dd35e..62e2bf29b625 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go @@ -9,8 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - -// Model for testing model with \"_class\" property +// ClassModel Model for testing model with \"_class\" property type ClassModel struct { Class string `json:"_class,omitempty" xml:"_class"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_client.go b/samples/client/petstore/go/go-petstore-withXml/model_client.go index e41f7052af02..019604e186e6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_client.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_client.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Client struct for Client type Client struct { Client string `json:"client,omitempty" xml:"client"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog.go b/samples/client/petstore/go/go-petstore-withXml/model_dog.go index 8191c278bb63..4dd159b9b468 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Dog struct for Dog type Dog struct { ClassName string `json:"className" xml:"className"` Color string `json:"color,omitempty" xml:"color"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go index a679641f749b..a74acf44b73d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// DogAllOf struct for DogAllOf type DogAllOf struct { Breed string `json:"breed,omitempty" xml:"breed"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go index f4c7e5495ccd..d0c6d7dbaaf6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// EnumArrays struct for EnumArrays type EnumArrays struct { JustSymbol string `json:"just_symbol,omitempty" xml:"just_symbol"` ArrayEnum []string `json:"array_enum,omitempty" xml:"array_enum"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go index 9d3dd60a9469..bbd14cd0d045 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go @@ -9,6 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore +// EnumClass the model 'EnumClass' type EnumClass string // List of EnumClass @@ -16,4 +17,4 @@ const ( ABC EnumClass = "_abc" EFG EnumClass = "-efg" XYZ EnumClass = "(xyz)" -) \ No newline at end of file +) diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go index 02c6c920c31b..ad5572d736d3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// EnumTest struct for EnumTest type EnumTest struct { EnumString string `json:"enum_string,omitempty" xml:"enum_string"` EnumStringRequired string `json:"enum_string_required" xml:"enum_string_required"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file.go b/samples/client/petstore/go/go-petstore-withXml/model_file.go index f1d827d1e72d..36693c9add33 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file.go @@ -9,8 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - -// Must be named `File` for test. +// File Must be named `File` for test. type File struct { // Test capitalization SourceURI string `json:"sourceURI,omitempty" xml:"sourceURI"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go index 6debdd3639b9..bb90ac891fe6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { File File `json:"file,omitempty" xml:"file"` Files []File `json:"files,omitempty" xml:"files"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go index dbd780a794e9..dc9628fbd3b4 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go @@ -13,7 +13,7 @@ import ( "os" "time" ) - +// FormatTest struct for FormatTest type FormatTest struct { Integer int32 `json:"integer,omitempty" xml:"integer"` Int32 int32 `json:"int32,omitempty" xml:"int32"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go index 15edfc4349a7..cfee0a910abc 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { Bar string `json:"bar,omitempty" xml:"bar"` Foo string `json:"foo,omitempty" xml:"foo"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_list.go b/samples/client/petstore/go/go-petstore-withXml/model_list.go index 86b6d67a5fd0..04602979bb05 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_list.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_list.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// List struct for List type List struct { Var123List string `json:"123-list,omitempty" xml:"123-list"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go index 1c8e4459206f..46bfa5f97f93 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// MapTest struct for MapTest type MapTest struct { MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty" xml:"map_map_of_string"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty" xml:"map_of_enum_string"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go index 099ebd1c28a1..f0d4bd9f74a1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go @@ -12,7 +12,7 @@ package petstore import ( "time" ) - +// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass type MixedPropertiesAndAdditionalPropertiesClass struct { Uuid string `json:"uuid,omitempty" xml:"uuid"` DateTime time.Time `json:"dateTime,omitempty" xml:"dateTime"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_name.go index 684f282beb72..150b599748ac 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_name.go @@ -9,8 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - -// Model for testing model name same as property name +// Name Model for testing model name same as property name type Name struct { Name int32 `json:"name" xml:"name"` SnakeCase int32 `json:"snake_case,omitempty" xml:"snake_case"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go index 9148cddf4aec..5c65ec808350 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// NumberOnly struct for NumberOnly type NumberOnly struct { JustNumber float32 `json:"JustNumber,omitempty" xml:"JustNumber"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_order.go b/samples/client/petstore/go/go-petstore-withXml/model_order.go index c4a731b72ca7..f624fbcf7a70 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_order.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_order.go @@ -12,7 +12,7 @@ package petstore import ( "time" ) - +// Order struct for Order type Order struct { Id int64 `json:"id,omitempty" xml:"id"` PetId int64 `json:"petId,omitempty" xml:"petId"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go index 0a6cc434b976..7bae7692195e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// OuterComposite struct for OuterComposite type OuterComposite struct { MyNumber float32 `json:"my_number,omitempty" xml:"my_number"` MyString string `json:"my_string,omitempty" xml:"my_string"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go index c6b28556bf2f..759747954560 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go @@ -9,6 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore +// OuterEnum the model 'OuterEnum' type OuterEnum string // List of OuterEnum @@ -16,4 +17,4 @@ const ( PLACED OuterEnum = "placed" APPROVED OuterEnum = "approved" DELIVERED OuterEnum = "delivered" -) \ No newline at end of file +) diff --git a/samples/client/petstore/go/go-petstore-withXml/model_pet.go b/samples/client/petstore/go/go-petstore-withXml/model_pet.go index eb0d4085f772..dfe972977a7f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_pet.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Pet struct for Pet type Pet struct { Id int64 `json:"id,omitempty" xml:"id"` Category Category `json:"category,omitempty" xml:"category"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go index 47da7a75c835..3d98e701220e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { Bar string `json:"bar,omitempty" xml:"bar"` Baz string `json:"baz,omitempty" xml:"baz"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_return.go b/samples/client/petstore/go/go-petstore-withXml/model_return.go index 7ec34d521edd..5c7fc5c807e2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_return.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_return.go @@ -9,8 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - -// Model for testing reserved words +// Return Model for testing reserved words type Return struct { Return int32 `json:"return,omitempty" xml:"return"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go index be2037eb6817..df479c77e302 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// SpecialModelName struct for SpecialModelName type SpecialModelName struct { SpecialPropertyName int64 `json:"$special[property.name],omitempty" xml:"$special[property.name]"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_tag.go b/samples/client/petstore/go/go-petstore-withXml/model_tag.go index fb2232a6bf47..6f4abe36e46f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_tag.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_tag.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// Tag struct for Tag type Tag struct { Id int64 `json:"id,omitempty" xml:"id"` Name string `json:"name,omitempty" xml:"name"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go index b4883cac9599..7071cb800ab8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// TypeHolderDefault struct for TypeHolderDefault type TypeHolderDefault struct { StringItem string `json:"string_item" xml:"string_item"` NumberItem float32 `json:"number_item" xml:"number_item"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go index af3fac4aa6e7..4c7432f78d00 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go @@ -9,10 +9,11 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// TypeHolderExample struct for TypeHolderExample type TypeHolderExample struct { StringItem string `json:"string_item" xml:"string_item"` NumberItem float32 `json:"number_item" xml:"number_item"` + FloatItem float32 `json:"float_item" xml:"float_item"` IntegerItem int32 `json:"integer_item" xml:"integer_item"` BoolItem bool `json:"bool_item" xml:"bool_item"` ArrayItem []int32 `json:"array_item" xml:"array_item"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_user.go b/samples/client/petstore/go/go-petstore-withXml/model_user.go index 27f1f67e4274..2e5962660aaf 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_user.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// User struct for User type User struct { Id int64 `json:"id,omitempty" xml:"id"` Username string `json:"username,omitempty" xml:"username"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go index 0276796aca62..c81766bc22c5 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go @@ -9,7 +9,7 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package petstore - +// XmlItem struct for XmlItem type XmlItem struct { AttributeString string `json:"attribute_string,omitempty" xml:"attribute_string,attr"` AttributeNumber float32 `json:"attribute_number,omitempty" xml:"attribute_number,attr"` diff --git a/samples/client/petstore/go/go-petstore-withXml/response.go b/samples/client/petstore/go/go-petstore-withXml/response.go index 44caa48b0fde..b0682c665688 100644 --- a/samples/client/petstore/go/go-petstore-withXml/response.go +++ b/samples/client/petstore/go/go-petstore-withXml/response.go @@ -14,6 +14,7 @@ import ( "net/http" ) +// APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` @@ -31,12 +32,14 @@ type APIResponse struct { Payload []byte `json:"-"` } +// NewAPIResponse returns a new APIResonse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.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/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index a0aa0040ef3c..052b43c30a61 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 5a020a1d0ab8..37a46abf4feb 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -791,6 +791,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1100,6 +1101,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1815,6 +1869,10 @@ components: number_item: example: 1.234 type: number + float_item: + example: 1.234 + format: float + type: number integer_item: example: -2 type: integer @@ -1833,6 +1891,7 @@ components: required: - array_item - bool_item + - float_item - integer_item - number_item - string_item diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index 152bf5be285b..8d1b78ba00b1 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -10,29 +10,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service /* -AnotherFakeApiService To test special tags +Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,70 +45,70 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, body localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index e6a157d6cec2..731d5c00f421 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -10,30 +10,32 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "github.com/antihax/optional" "os" + "reflect" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeApiService FakeApi service type FakeApiService service /* -FakeApiService creates an XmlItem +CreateXmlItem creates an XmlItem this route creates an XmlItem - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param xmlItem XmlItem Body */ -func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*http.Response, error) { +func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,71 +46,71 @@ func (a *FakeApiService) CreateXmlItem(ctx context.Context, xmlItem XmlItem) (*h localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} + localVarHTTPContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &xmlItem - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' +type FakeOuterBooleanSerializeOpts struct { + Body optional.Bool } /* -FakeApiService +FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: * @param "Body" (optional.Bool) - Input boolean as post body @return bool */ - -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool -} - -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -120,93 +122,93 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v bool - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' +type FakeOuterCompositeSerializeOpts struct { + Body optional.Interface } /* -FakeApiService +FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body @return OuterComposite */ - -type FakeOuterCompositeSerializeOpts struct { - Body optional.Interface -} - -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -218,25 +220,25 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { @@ -247,68 +249,68 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPostBody = &localVarOptionalBody } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v OuterComposite - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' +type FakeOuterNumberSerializeOpts struct { + Body optional.Float32 } /* -FakeApiService +FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: * @param "Body" (optional.Float32) - Input number as post body @return float32 */ - -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 -} - -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -320,93 +322,93 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/number" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v float32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' +type FakeOuterStringSerializeOpts struct { + Body optional.String } /* -FakeApiService +FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: * @param "Body" (optional.String) - Input string as post body @return string */ - -type FakeOuterStringSerializeOpts struct { - Body optional.String -} - -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -418,86 +420,86 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/string" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -FakeApiService +TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSchemaTestClass) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -508,64 +510,64 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, body FileSc localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param query * @param body */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, body User) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -576,66 +578,66 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("query", parameterToString(query, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService To test \"client\" model +TestClientModel To test \"client\" model To test \"client\" model - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -647,78 +649,92 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' +type TestEndpointParametersOpts struct { + Integer optional.Int32 + Int32_ optional.Int32 + Int64_ optional.Int64 + Float optional.Float32 + String_ optional.String + Binary optional.Interface + Date optional.String + DateTime optional.Time + Password optional.String + Callback optional.String } /* -FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param number None * @param double None * @param patternWithoutDelimiter None @@ -735,23 +751,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * @param "Password" (optional.String) - None * @param "Callback" (optional.String) - None */ - -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String -} - -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -762,8 +764,8 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if number < 32.1 { return nil, reportError("number must be greater than 32.1") } @@ -778,21 +780,21 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) @@ -823,7 +825,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -832,11 +834,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) } if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { - paramJson, err := parameterToJson(localVarOptionals.DateTime.Value()) - if err != nil { - return nil, err - } - localVarFormParams.Add("dateTime", paramJson) + localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Password.IsSet() { localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) @@ -844,37 +842,49 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' +type TestEnumParametersOpts struct { + EnumHeaderStringArray optional.Interface + EnumHeaderString optional.String + EnumQueryStringArray optional.Interface + EnumQueryString optional.String + EnumQueryInteger optional.Int32 + EnumQueryDouble optional.Float64 + EnumFormStringArray optional.Interface + EnumFormString optional.String } /* -FakeApiService To test enum parameters +TestEnumParameters To test enum parameters To test enum parameters - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *TestEnumParametersOpts - Optional Parameters: * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) @@ -885,21 +895,9 @@ To test enum parameters * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) */ - -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String -} - -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -910,8 +908,8 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv")) @@ -926,21 +924,21 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") @@ -954,37 +952,44 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' +type TestGroupParametersOpts struct { + StringGroup optional.Int32 + BooleanGroup optional.Bool + Int64Group optional.Int64 } /* -FakeApiService Fake endpoint to test group parameters (optional) +TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requiredStringGroup Required String in group parameters * @param requiredBooleanGroup Required Boolean in group parameters * @param requiredInt64Group Required Integer in group parameters @@ -993,16 +998,9 @@ Fake endpoint to test group parameters (optional) * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters * @param "Int64Group" (optional.Int64) - Integer in group parameters */ - -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 -} - -func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1013,8 +1011,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) @@ -1025,61 +1023,61 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test inline additionalProperties - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param request body */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param map[string]string) (*http.Response, error) { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1090,64 +1088,64 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = ¶m - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test json serialization of form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestJsonFormData test json serialization of form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param field1 * @param param2 field2 */ -func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1158,51 +1156,134 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarFormParams.Add("param", parameterToString(param, "")) localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 6c04d55739a9..be67cb585ed1 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -10,29 +10,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service /* -FakeClassnameTags123ApiService To test class name in snake case +TestClassname To test class name in snake case To test class name in snake case - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body client model @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,25 +45,25 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarPath := a.client.cfg.BasePath + "/fake_classname_test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body @@ -78,48 +79,48 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarQueryParams.Add("api_key_query", key) } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 243d16197f03..77dccc27684f 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -10,10 +10,10 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" "github.com/antihax/optional" @@ -22,19 +22,20 @@ import ( // Linger please var ( - _ context.Context + _ _context.Context ) +// PetApiService PetApi service type PetApiService service /* -PetApiService Add a new pet to the store - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +AddPet Add a new pet to the store + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Pet object that needs to be added to the store */ -func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) { +func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,70 +46,70 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// DeletePetOpts Optional parameters for the method 'DeletePet' +type DeletePetOpts struct { + ApiKey optional.String } /* -PetApiService Deletes a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +DeletePet Deletes a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete * @param optional nil or *DeletePetOpts - Optional Parameters: * @param "ApiKey" (optional.String) - */ - -type DeletePetOpts struct { - ApiKey optional.String -} - -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -117,69 +118,69 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -PetApiService Finds Pets by status +FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param status Status values that need to be considered for filter @return []Pet */ -func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -191,83 +192,83 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("status", parameterToString(status, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Finds Pets by tags +FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param tags Tags to filter by @return []Pet */ -func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -279,83 +280,83 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe localVarPath := a.client.cfg.BasePath + "/pet/findByTags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("tags", parameterToString(tags, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Find pet by ID +GetPetById Find pet by ID Returns a single pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to return @return Pet */ -func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -365,28 +366,28 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -400,60 +401,60 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Update an existing pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Pet object that needs to be added to the store */ -func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) { +func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -464,72 +465,72 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' +type UpdatePetWithFormOpts struct { + Name optional.String + Status optional.String } /* -PetApiService Updates a pet in the store with form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePetWithForm Updates a pet in the store with form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: * @param "Name" (optional.String) - Updated name of the pet * @param "Status" (optional.String) - Updated status of the pet */ - -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String -} - -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -538,28 +539,28 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Name.IsSet() { localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) @@ -567,51 +568,51 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca if localVarOptionals != nil && localVarOptionals.Status.IsSet() { localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UploadFileOpts Optional parameters for the method 'UploadFile' +type UploadFileOpts struct { + AdditionalMetadata optional.String + File optional.Interface } /* -PetApiService uploads an image - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFile uploads an image + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param optional nil or *UploadFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server * @param "File" (optional.Interface of *os.File) - file to upload @return ApiResponse */ - -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface -} - -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -621,28 +622,28 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -657,74 +658,74 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String } /* -PetApiService uploads an image (required) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFileWithRequiredFile uploads an image (required) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param requiredFile file to upload * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server @return ApiResponse */ - -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String -} - -func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -734,28 +735,28 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in // create path and map variables localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -763,53 +764,53 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in localVarFormFileName = "requiredFile" localVarFile := requiredFile if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 3211860d49c3..e17fc1816ee4 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -10,30 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// StoreApiService StoreApi service type StoreApiService service /* -StoreApiService Delete purchase order by ID +DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of the order that needs to be deleted */ -func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -42,65 +43,65 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -StoreApiService Returns pet inventories by status +GetInventory Returns pet inventories by status Returns a map of status codes to quantities - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return map[string]int32 */ -func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { +func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -112,25 +113,25 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarPath := a.client.cfg.BasePath + "/store/inventory" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -144,62 +145,62 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v map[string]int32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Find purchase order by ID +GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of pet that needs to be fetched @return Order */ -func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -209,11 +210,11 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -222,77 +223,77 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Place an order for a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +PlaceOrder Place an order for a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body order placed for purchasing the pet @return Order */ -func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) { +func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -304,70 +305,70 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h localVarPath := a.client.cfg.BasePath + "/store/order" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 6a7d2b1195ae..5eb1a3ced9af 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -10,30 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// UserApiService UserApi service type UserApiService service /* -UserApiService Create user +CreateUser Create user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body Created user object */ -func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) { +func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,63 +45,63 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo localVarPath := a.client.cfg.BasePath + "/user" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithArrayInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body List of user object */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -111,63 +112,63 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U localVarPath := a.client.cfg.BasePath + "/user/createWithArray" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithListInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body List of user object */ -func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -178,64 +179,64 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us localVarPath := a.client.cfg.BasePath + "/user/createWithList" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Delete user +DeleteUser Delete user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be deleted */ -func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -244,65 +245,65 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Get user by user name - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +GetUserByName Get user by user name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. @return User */ -func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -312,85 +313,85 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v User - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs user into the system - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LoginUser Logs user into the system + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The user name for login * @param password The password for login in clear text @return string */ -func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { +func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -402,81 +403,81 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor localVarPath := a.client.cfg.BasePath + "/user/login" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("username", parameterToString(username, "")) localVarQueryParams.Add("password", parameterToString(password, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs out current logged in user session - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LogoutUser Logs out current logged in user session + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ -func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { +func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -487,63 +488,63 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) localVarPath := a.client.cfg.BasePath + "/user/logout" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Updated user +UpdateUser Updated user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username name that need to be deleted * @param body Updated user object */ -func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -552,54 +553,54 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 79a128973d9f..30377bdac64c 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -175,7 +175,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } -// Change base path to allow switching to mocks +// ChangeBasePath changes base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 19ccc325fa92..b3b81ad08246 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -49,6 +49,7 @@ type APIKey struct { Prefix string } +// Configuration stores the configuration of the API client type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` @@ -58,6 +59,7 @@ type Configuration struct { HTTPClient *http.Client } +// NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "http://petstore.swagger.io:80/v2", @@ -67,6 +69,7 @@ func NewConfiguration() *Configuration { return cfg } +// AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index b7927f181e40..9aaf2e63a96f 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | @@ -539,3 +540,40 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md b/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md index abe85f9799d1..f4d62ea836b8 100644 --- a/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md +++ b/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | **NumberItem** | **float32** | | +**FloatItem** | **float32** | | **IntegerItem** | **int32** | | **BoolItem** | **bool** | | **ArrayItem** | **[]int32** | | diff --git a/samples/client/petstore/go/go-petstore/git_push.sh b/samples/client/petstore/go/go-petstore/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/go/go-petstore/git_push.sh +++ b/samples/client/petstore/go/go-petstore/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/go/go-petstore/model_200_response.go b/samples/client/petstore/go/go-petstore/model_200_response.go index f918cabaaae2..8ae5118c9fdc 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing model name starting with number +// Model200Response Model for testing model name starting with number type Model200Response struct { Name int32 `json:"name,omitempty"` Class string `json:"class,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go index ca06584a72f7..a7b1282d7eb4 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore/model_additional_properties_array.go index 2e71585506f6..f5483849933b 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_array.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_array.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesArray struct for AdditionalPropertiesArray type AdditionalPropertiesArray struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go index 09f1ac3b32bc..144747729789 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean type AdditionalPropertiesBoolean struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go index 2e1845e194f6..00ca7fb44061 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { MapString map[string]string `json:"map_string,omitempty"` MapNumber map[string]float32 `json:"map_number,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go index 2f69fe4b0125..14b97ab34533 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger type AdditionalPropertiesInteger struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore/model_additional_properties_number.go index 900b2ec32cc9..0516142b1c50 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_number.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_number.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber type AdditionalPropertiesNumber struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore/model_additional_properties_object.go index 99fa6d02fdcc..1c7d80d22938 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_object.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_object.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesObject struct for AdditionalPropertiesObject type AdditionalPropertiesObject struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore/model_additional_properties_string.go index 82fe0e4ed30f..460dfd78bb3e 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_string.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_string.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesString struct for AdditionalPropertiesString type AdditionalPropertiesString struct { Name string `json:"name,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_animal.go b/samples/client/petstore/go/go-petstore/model_animal.go index 39d0d2d1ec32..1c09a9ddb7f7 100644 --- a/samples/client/petstore/go/go-petstore/model_animal.go +++ b/samples/client/petstore/go/go-petstore/model_animal.go @@ -8,7 +8,7 @@ */ package petstore - +// Animal struct for Animal type Animal struct { ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 12732fa32c6b..de022a0afac1 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -8,7 +8,7 @@ */ package petstore - +// ApiResponse struct for ApiResponse type ApiResponse struct { Code int32 `json:"code,omitempty"` Type string `json:"type,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index 8bf700c7eb30..a0818c181471 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -8,7 +8,7 @@ */ package petstore - +// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go index ccb473355caa..521dd4a778ce 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -8,7 +8,7 @@ */ package petstore - +// ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { ArrayNumber []float32 `json:"ArrayNumber,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_array_test_.go b/samples/client/petstore/go/go-petstore/model_array_test_.go index f8819800934b..2ea7b84212bb 100644 --- a/samples/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore/model_array_test_.go @@ -8,7 +8,7 @@ */ package petstore - +// ArrayTest struct for ArrayTest type ArrayTest struct { ArrayOfString []string `json:"array_of_string,omitempty"` ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_capitalization.go b/samples/client/petstore/go/go-petstore/model_capitalization.go index 8284ba9c7658..97d5a4733f24 100644 --- a/samples/client/petstore/go/go-petstore/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore/model_capitalization.go @@ -8,7 +8,7 @@ */ package petstore - +// Capitalization struct for Capitalization type Capitalization struct { SmallCamel string `json:"smallCamel,omitempty"` CapitalCamel string `json:"CapitalCamel,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_cat.go b/samples/client/petstore/go/go-petstore/model_cat.go index 58b3deeb938d..54374bcfebbc 100644 --- a/samples/client/petstore/go/go-petstore/model_cat.go +++ b/samples/client/petstore/go/go-petstore/model_cat.go @@ -8,7 +8,7 @@ */ package petstore - +// Cat struct for Cat type Cat struct { ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_cat_all_of.go index 3c1d802bd411..b7550adb91a5 100644 --- a/samples/client/petstore/go/go-petstore/model_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_cat_all_of.go @@ -8,7 +8,7 @@ */ package petstore - +// CatAllOf struct for CatAllOf type CatAllOf struct { Declawed bool `json:"declawed,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_category.go b/samples/client/petstore/go/go-petstore/model_category.go index 2f971417ac10..104410a316ae 100644 --- a/samples/client/petstore/go/go-petstore/model_category.go +++ b/samples/client/petstore/go/go-petstore/model_category.go @@ -8,7 +8,7 @@ */ package petstore - +// Category struct for Category type Category struct { Id int64 `json:"id,omitempty"` Name string `json:"name"` diff --git a/samples/client/petstore/go/go-petstore/model_class_model.go b/samples/client/petstore/go/go-petstore/model_class_model.go index 09c7e891968a..c87910e3dc6e 100644 --- a/samples/client/petstore/go/go-petstore/model_class_model.go +++ b/samples/client/petstore/go/go-petstore/model_class_model.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing model with \"_class\" property +// ClassModel Model for testing model with \"_class\" property type ClassModel struct { Class string `json:"_class,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_client.go b/samples/client/petstore/go/go-petstore/model_client.go index 3aa61112c4da..f7c449d2bc65 100644 --- a/samples/client/petstore/go/go-petstore/model_client.go +++ b/samples/client/petstore/go/go-petstore/model_client.go @@ -8,7 +8,7 @@ */ package petstore - +// Client struct for Client type Client struct { Client string `json:"client,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_dog.go b/samples/client/petstore/go/go-petstore/model_dog.go index 3f791ca1947d..6bc685afe291 100644 --- a/samples/client/petstore/go/go-petstore/model_dog.go +++ b/samples/client/petstore/go/go-petstore/model_dog.go @@ -8,7 +8,7 @@ */ package petstore - +// Dog struct for Dog type Dog struct { ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_dog_all_of.go b/samples/client/petstore/go/go-petstore/model_dog_all_of.go index a0db0aba4b53..758c5cc45f78 100644 --- a/samples/client/petstore/go/go-petstore/model_dog_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_dog_all_of.go @@ -8,7 +8,7 @@ */ package petstore - +// DogAllOf struct for DogAllOf type DogAllOf struct { Breed string `json:"breed,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/client/petstore/go/go-petstore/model_enum_arrays.go index ab4dce92ebbc..64df54568b4b 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/model_enum_arrays.go @@ -8,7 +8,7 @@ */ package petstore - +// EnumArrays struct for EnumArrays type EnumArrays struct { JustSymbol string `json:"just_symbol,omitempty"` ArrayEnum []string `json:"array_enum,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_enum_class.go b/samples/client/petstore/go/go-petstore/model_enum_class.go index 534ce4328817..8b7e1ee89598 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore/model_enum_class.go @@ -8,6 +8,7 @@ */ package petstore +// EnumClass the model 'EnumClass' type EnumClass string // List of EnumClass @@ -15,4 +16,4 @@ const ( ABC EnumClass = "_abc" EFG EnumClass = "-efg" XYZ EnumClass = "(xyz)" -) \ No newline at end of file +) diff --git a/samples/client/petstore/go/go-petstore/model_enum_test_.go b/samples/client/petstore/go/go-petstore/model_enum_test_.go index f85f31501a01..f8eb2967b9eb 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore/model_enum_test_.go @@ -8,7 +8,7 @@ */ package petstore - +// EnumTest struct for EnumTest type EnumTest struct { EnumString string `json:"enum_string,omitempty"` EnumStringRequired string `json:"enum_string_required"` diff --git a/samples/client/petstore/go/go-petstore/model_file.go b/samples/client/petstore/go/go-petstore/model_file.go index 2782ccc9a2aa..b07c65dcc42b 100644 --- a/samples/client/petstore/go/go-petstore/model_file.go +++ b/samples/client/petstore/go/go-petstore/model_file.go @@ -8,8 +8,7 @@ */ package petstore - -// Must be named `File` for test. +// File Must be named `File` for test. type File struct { // Test capitalization SourceURI string `json:"sourceURI,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go index 487f766c6492..29b051e77a86 100644 --- a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -8,7 +8,7 @@ */ package petstore - +// FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { File File `json:"file,omitempty"` Files []File `json:"files,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_format_test_.go b/samples/client/petstore/go/go-petstore/model_format_test_.go index d723bdfee39e..85f31cd081ed 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore/model_format_test_.go @@ -12,7 +12,7 @@ import ( "os" "time" ) - +// FormatTest struct for FormatTest type FormatTest struct { Integer int32 `json:"integer,omitempty"` Int32 int32 `json:"int32,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go index 1cf0e4f530d4..c0b9818dcdd5 100644 --- a/samples/client/petstore/go/go-petstore/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go @@ -8,7 +8,7 @@ */ package petstore - +// HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { Bar string `json:"bar,omitempty"` Foo string `json:"foo,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_list.go b/samples/client/petstore/go/go-petstore/model_list.go index 12f3bd3f6600..891ded476a4d 100644 --- a/samples/client/petstore/go/go-petstore/model_list.go +++ b/samples/client/petstore/go/go-petstore/model_list.go @@ -8,7 +8,7 @@ */ package petstore - +// List struct for List type List struct { Var123List string `json:"123-list,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_map_test_.go b/samples/client/petstore/go/go-petstore/model_map_test_.go index 830e760fe314..5c03afe831c1 100644 --- a/samples/client/petstore/go/go-petstore/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore/model_map_test_.go @@ -8,7 +8,7 @@ */ package petstore - +// MapTest struct for MapTest type MapTest struct { MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go index 0ad92e96f8ec..fcd0bc9bbddf 100644 --- a/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -11,7 +11,7 @@ package petstore import ( "time" ) - +// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass type MixedPropertiesAndAdditionalPropertiesClass struct { Uuid string `json:"uuid,omitempty"` DateTime time.Time `json:"dateTime,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_name.go b/samples/client/petstore/go/go-petstore/model_name.go index dde1b92eb6ab..0043908483df 100644 --- a/samples/client/petstore/go/go-petstore/model_name.go +++ b/samples/client/petstore/go/go-petstore/model_name.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing model name same as property name +// Name Model for testing model name same as property name type Name struct { Name int32 `json:"name"` SnakeCase int32 `json:"snake_case,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_number_only.go b/samples/client/petstore/go/go-petstore/model_number_only.go index 7a2fd5fd8f6d..7a3eccc11746 100644 --- a/samples/client/petstore/go/go-petstore/model_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_number_only.go @@ -8,7 +8,7 @@ */ package petstore - +// NumberOnly struct for NumberOnly type NumberOnly struct { JustNumber float32 `json:"JustNumber,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_order.go b/samples/client/petstore/go/go-petstore/model_order.go index c81d67ae0fa4..f8bae432ae7d 100644 --- a/samples/client/petstore/go/go-petstore/model_order.go +++ b/samples/client/petstore/go/go-petstore/model_order.go @@ -11,7 +11,7 @@ package petstore import ( "time" ) - +// Order struct for Order type Order struct { Id int64 `json:"id,omitempty"` PetId int64 `json:"petId,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_outer_composite.go b/samples/client/petstore/go/go-petstore/model_outer_composite.go index 0ebb526267e8..78ce40e67349 100644 --- a/samples/client/petstore/go/go-petstore/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore/model_outer_composite.go @@ -8,7 +8,7 @@ */ package petstore - +// OuterComposite struct for OuterComposite type OuterComposite struct { MyNumber float32 `json:"my_number,omitempty"` MyString string `json:"my_string,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_outer_enum.go b/samples/client/petstore/go/go-petstore/model_outer_enum.go index 903d31e82690..efefaf1b784a 100644 --- a/samples/client/petstore/go/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore/model_outer_enum.go @@ -8,6 +8,7 @@ */ package petstore +// OuterEnum the model 'OuterEnum' type OuterEnum string // List of OuterEnum @@ -15,4 +16,4 @@ const ( PLACED OuterEnum = "placed" APPROVED OuterEnum = "approved" DELIVERED OuterEnum = "delivered" -) \ No newline at end of file +) diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index 4930dbb92e8e..2979b06b3eca 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -8,7 +8,7 @@ */ package petstore - +// Pet struct for Pet type Pet struct { Id int64 `json:"id,omitempty"` Category Category `json:"category,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_read_only_first.go b/samples/client/petstore/go/go-petstore/model_read_only_first.go index 6b22163900b0..7d1e521f4a48 100644 --- a/samples/client/petstore/go/go-petstore/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore/model_read_only_first.go @@ -8,7 +8,7 @@ */ package petstore - +// ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { Bar string `json:"bar,omitempty"` Baz string `json:"baz,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index 7851dd851d31..9a029c4f8c04 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing reserved words +// Return Model for testing reserved words type Return struct { Return int32 `json:"return,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_special_model_name.go b/samples/client/petstore/go/go-petstore/model_special_model_name.go index f906e91987dc..e36ceb38e5fe 100644 --- a/samples/client/petstore/go/go-petstore/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore/model_special_model_name.go @@ -8,7 +8,7 @@ */ package petstore - +// SpecialModelName struct for SpecialModelName type SpecialModelName struct { SpecialPropertyName int64 `json:"$special[property.name],omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_tag.go b/samples/client/petstore/go/go-petstore/model_tag.go index 37a2b63d4451..968bd8798a32 100644 --- a/samples/client/petstore/go/go-petstore/model_tag.go +++ b/samples/client/petstore/go/go-petstore/model_tag.go @@ -8,7 +8,7 @@ */ package petstore - +// Tag struct for Tag type Tag struct { Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_default.go b/samples/client/petstore/go/go-petstore/model_type_holder_default.go index 68e1218ec951..3e75daf7151d 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_default.go @@ -8,7 +8,7 @@ */ package petstore - +// TypeHolderDefault struct for TypeHolderDefault type TypeHolderDefault struct { StringItem string `json:"string_item"` NumberItem float32 `json:"number_item"` diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_example.go b/samples/client/petstore/go/go-petstore/model_type_holder_example.go index e129bb6a765f..3d1d53f3d75d 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_example.go @@ -8,10 +8,11 @@ */ package petstore - +// TypeHolderExample struct for TypeHolderExample type TypeHolderExample struct { StringItem string `json:"string_item"` NumberItem float32 `json:"number_item"` + FloatItem float32 `json:"float_item"` IntegerItem int32 `json:"integer_item"` BoolItem bool `json:"bool_item"` ArrayItem []int32 `json:"array_item"` diff --git a/samples/client/petstore/go/go-petstore/model_user.go b/samples/client/petstore/go/go-petstore/model_user.go index caff75ebc2c5..a6da6f9a87f2 100644 --- a/samples/client/petstore/go/go-petstore/model_user.go +++ b/samples/client/petstore/go/go-petstore/model_user.go @@ -8,7 +8,7 @@ */ package petstore - +// User struct for User type User struct { Id int64 `json:"id,omitempty"` Username string `json:"username,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_xml_item.go b/samples/client/petstore/go/go-petstore/model_xml_item.go index a623bda5c742..8d74417af787 100644 --- a/samples/client/petstore/go/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore/model_xml_item.go @@ -8,7 +8,7 @@ */ package petstore - +// XmlItem struct for XmlItem type XmlItem struct { AttributeString string `json:"attribute_string,omitempty"` AttributeNumber float32 `json:"attribute_number,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/response.go b/samples/client/petstore/go/go-petstore/response.go index 38f373df75ee..c16f181f4e94 100644 --- a/samples/client/petstore/go/go-petstore/response.go +++ b/samples/client/petstore/go/go-petstore/response.go @@ -13,6 +13,7 @@ import ( "net/http" ) +// APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` @@ -30,12 +31,14 @@ type APIResponse struct { Payload []byte `json:"-"` } +// NewAPIResponse returns a new APIResonse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.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/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index d05a1ba4cc1e..baf222ae11c4 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -27,7 +27,7 @@ repositories { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" + jackson_version = "2.9.10" } dependencies { diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy index ab4b87def725..630c015aaa4e 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy @@ -13,7 +13,7 @@ class Pet { Long id - Category category = null + Category category String name diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.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/client/petstore/haskell-http-client/docs/OpenAPIPetstore-API-Fake.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-API-Fake.html index e0529db29288..fe13baa35795 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-API-Fake.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-API-Fake.html @@ -1 +1 @@ -OpenAPIPetstore.API.Fake

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.API.Fake

Description

 
Synopsis

Operations

Fake

createXmlItem

createXmlItem Source #

Arguments

:: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) 
=> ContentType contentType

request content-type (MimeType)

-> XmlItem

"xmlItem" - XmlItem Body

-> OpenAPIPetstoreRequest CreateXmlItem contentType NoContent MimeNoContent 
POST /fake/create_xml_item

creates an XmlItem

this route creates an XmlItem

data CreateXmlItem Source #

Instances
Produces CreateXmlItem MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextxmlCharsetutf8 Source #
text/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextxmlCharsetutf16 Source #
text/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextxml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam CreateXmlItem XmlItem Source #

Body Param XmlItem - XmlItem Body

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => OpenAPIPetstoreRequest CreateXmlItem contentType res accept -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType res accept Source #

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept 
POST /fake/outer/boolean

Test serialization of outer boolean types

data FakeOuterBooleanSerialize Source #

Instances
MimeType mtype => Produces FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept 
POST /fake/outer/composite

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept 
POST /fake/outer/number

Test serialization of outer number types

data FakeOuterNumberSerialize Source #

Instances
MimeType mtype => Produces FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterNumberSerialize BodyDouble Source #

Body Param "body" - Input number as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept 
POST /fake/outer/string

Test serialization of outer string types

data FakeOuterStringSerialize Source #

Instances
MimeType mtype => Produces FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

testBodyWithFileSchema

testBodyWithFileSchema Source #

PUT /fake/body-with-file-schema

For this test, the body for this request much reference a schema named File.

testBodyWithQueryParams

testClientModel

testClientModel Source #

PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances
Produces TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

testEndpointParameters

testEndpointParameters Source #

POST /fake

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

AuthMethod: AuthBasicHttpBasicTest

data TestEndpointParameters Source #

Instances
Produces TestEndpointParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEndpointParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

testEnumParameters

data TestEnumParameters Source #

Instances
Produces TestEnumParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEnumParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

testGroupParameters

testGroupParameters Source #

Arguments

:: RequiredStringGroup

"requiredStringGroup" - Required String in group parameters

-> RequiredBooleanGroup

"requiredBooleanGroup" - Required Boolean in group parameters

-> RequiredInt64Group

"requiredInt64Group" - Required Integer in group parameters

-> OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent 
DELETE /fake

Fake endpoint to test group parameters (optional)

Fake endpoint to test group parameters (optional)

data TestGroupParameters Source #

Instances
Produces TestGroupParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters StringGroup Source #

Optional Param "string_group" - String in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters Int64Group Source #

Optional Param "int64_group" - Integer in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters BooleanGroup Source #

Optional Param "boolean_group" - Boolean in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

testInlineAdditionalProperties

testJsonFormData

testJsonFormData Source #

GET /fake/jsonFormData

test json serialization of form data

data TestJsonFormData Source #

Instances
Produces TestJsonFormData MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestJsonFormData MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

\ No newline at end of file +OpenAPIPetstore.API.Fake

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.API.Fake

Description

 
Synopsis

Operations

Fake

createXmlItem

createXmlItem Source #

Arguments

:: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) 
=> ContentType contentType

request content-type (MimeType)

-> XmlItem

"xmlItem" - XmlItem Body

-> OpenAPIPetstoreRequest CreateXmlItem contentType NoContent MimeNoContent 
POST /fake/create_xml_item

creates an XmlItem

this route creates an XmlItem

data CreateXmlItem Source #

Instances
Produces CreateXmlItem MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextXmlCharsetutf8 Source #
text/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextXmlCharsetutf16 Source #
text/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextXml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam CreateXmlItem XmlItem Source #

Body Param XmlItem - XmlItem Body

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => OpenAPIPetstoreRequest CreateXmlItem contentType res accept -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType res accept Source #

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept 
POST /fake/outer/boolean

Test serialization of outer boolean types

data FakeOuterBooleanSerialize Source #

Instances
MimeType mtype => Produces FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept 
POST /fake/outer/composite

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept 
POST /fake/outer/number

Test serialization of outer number types

data FakeOuterNumberSerialize Source #

Instances
MimeType mtype => Produces FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterNumberSerialize BodyDouble Source #

Body Param "body" - Input number as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept 
POST /fake/outer/string

Test serialization of outer string types

data FakeOuterStringSerialize Source #

Instances
MimeType mtype => Produces FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

testBodyWithFileSchema

testBodyWithFileSchema Source #

PUT /fake/body-with-file-schema

For this test, the body for this request much reference a schema named File.

testBodyWithQueryParams

testClientModel

testClientModel Source #

PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances
Produces TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

testEndpointParameters

testEndpointParameters Source #

POST /fake

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

AuthMethod: AuthBasicHttpBasicTest

data TestEndpointParameters Source #

Instances
Produces TestEndpointParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEndpointParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

testEnumParameters

data TestEnumParameters Source #

Instances
Produces TestEnumParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEnumParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

testGroupParameters

testGroupParameters Source #

Arguments

:: RequiredStringGroup

"requiredStringGroup" - Required String in group parameters

-> RequiredBooleanGroup

"requiredBooleanGroup" - Required Boolean in group parameters

-> RequiredInt64Group

"requiredInt64Group" - Required Integer in group parameters

-> OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent 
DELETE /fake

Fake endpoint to test group parameters (optional)

Fake endpoint to test group parameters (optional)

data TestGroupParameters Source #

Instances
Produces TestGroupParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters StringGroup Source #

Optional Param "string_group" - String in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters Int64Group Source #

Optional Param "int64_group" - Integer in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters BooleanGroup Source #

Optional Param "boolean_group" - Boolean in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

testInlineAdditionalProperties

testJsonFormData

testJsonFormData Source #

GET /fake/jsonFormData

test json serialization of form data

data TestJsonFormData Source #

Instances
Produces TestJsonFormData MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestJsonFormData MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

testQueryParameterCollectionFormat

testQueryParameterCollectionFormat Source #

PUT /fake/test-query-paramters

To test the collection format in query parameters

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html index a0996b5c3fcf..f85cd98205e8 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html @@ -1 +1 @@ -OpenAPIPetstore.Client

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Client

Description

 
Synopsis

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances
Functor MimeResult Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

Instances
Eq MimeError Source # 
Instance details

Defined in OpenAPIPetstore.Client

Show MimeError Source # 
Instance details

Defined in OpenAPIPetstore.Client

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 
Instances
Show (InitRequest req contentType res accept) Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file +OpenAPIPetstore.Client

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Client

Description

 
Synopsis

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances
Functor MimeResult Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

Instances
Eq MimeError Source # 
Instance details

Defined in OpenAPIPetstore.Client

Show MimeError Source # 
Instance details

Defined in OpenAPIPetstore.Client

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Fields

Instances
Show (InitRequest req contentType res accept) Source # 
Instance details

Defined in OpenAPIPetstore.Client

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html index 527cb8f3f161..f433b3bbe683 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html @@ -1 +1 @@ -OpenAPIPetstore.Core

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Core

Description

 
Synopsis

OpenAPIPetstoreConfig

data OpenAPIPetstoreConfig Source #

 

Constructors

OpenAPIPetstoreConfig 

Fields

newConfig :: IO OpenAPIPetstoreConfig Source #

constructs a default OpenAPIPetstoreConfig

configHost:

http://petstore.swagger.io:80/v2

configUserAgent:

"openapi-petstore/0.1.0.0"

addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig Source #

updates config use AuthMethod on matching requests

withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stdout logging

withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stderr logging

withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig Source #

updates the config to disable logging

OpenAPIPetstoreRequest

data OpenAPIPetstoreRequest req contentType res accept Source #

Represents a request.

Type Variables:

  • req - request operation
  • contentType - MimeType associated with request body
  • res - response model
  • accept - MimeType associated with response body

Constructors

OpenAPIPetstoreRequest 

Fields

Instances
Show (OpenAPIPetstoreRequest req contentType res accept) Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

showsPrec :: Int -> OpenAPIPetstoreRequest req contentType res accept -> ShowS #

show :: OpenAPIPetstoreRequest req contentType res accept -> String #

showList :: [OpenAPIPetstoreRequest req contentType res accept] -> ShowS #

rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Method Source #

rMethod Lens

rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [ByteString] Source #

rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params Source #

rParams Lens

rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [TypeRep] Source #

rParams Lens

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Minimal complete definition

Nothing

Methods

setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Instances
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Instance details

Defined in OpenAPIPetstore.API.Store

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestInlineAdditionalProperties ParamMapMapStringText Source #

Body Param "param" - request body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam TestBodyWithQueryParams User Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam TestBodyWithFileSchema FileSchemaTestClass Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterNumberSerialize BodyDouble Source #

Body Param "body" - Input number as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param "body" - Input composite as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam CreateXmlItem XmlItem Source #

Body Param XmlItem - XmlItem Body

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => OpenAPIPetstoreRequest CreateXmlItem contentType res accept -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType res accept Source #

HasBodyParam Op123testSpecialTags Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Methods

setBodyParam :: (Consumes Op123testSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept Source #

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Apply an optional parameter to a request

(-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept infixl 2 Source #

infix operator / alias for addOptionalParam

Instances
HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UploadFile File2 Source #

Optional Param "file" - file to upload

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam DeletePet ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

HasOptionalParam TestGroupParameters StringGroup Source #

Optional Param "string_group" - String in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters Int64Group Source #

Optional Param "int64_group" - Integer in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters BooleanGroup Source #

Optional Param "boolean_group" - Boolean in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

data Params Source #

Request Params

Instances
Show Params Source # 
Instance details

Defined in OpenAPIPetstore.Core

OpenAPIPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> OpenAPIPetstoreRequest req contentType res accept

req: Request Type, res: Response Type

setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [Header] -> OpenAPIPetstoreRequest req contentType res accept Source #

removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [HeaderName] -> OpenAPIPetstoreRequest req contentType res accept Source #

_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept Source #

addForm :: OpenAPIPetstoreRequest req contentType res accept -> Form -> OpenAPIPetstoreRequest req contentType res accept Source #

_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> Part -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept Source #

Params Utils

OpenAPI CollectionFormat Utils

data CollectionFormat Source #

Determines the format of the array if type array is used.

Constructors

CommaSeparated

CSV format for multiple parameters.

SpaceSeparated

Also called SSV

TabSeparated

Also called TSV

PipeSeparated

`value1|value2|value2`

MultiParamArray

Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" (Query) or "formData" (Form)

_toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)] Source #

_toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)] Source #

_toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] Source #

AuthMethods

class Typeable a => AuthMethod a where Source #

Provides a method to apply auth methods to requests

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> a -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

Instances
AuthMethod AnyAuthMethod Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AnyAuthMethod -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthOAuthPetstoreAuth Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthOAuthPetstoreAuth -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthBasicHttpBasicTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthBasicHttpBasicTest -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthApiKeyApiKeyQuery Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthApiKeyApiKeyQuery -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthApiKeyApiKey Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthApiKeyApiKey -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 
Instances
AuthMethod AnyAuthMethod Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AnyAuthMethod -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

_applyAuthMethods :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

apply all matching AuthMethods in config to request

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

Encodes fields using WH.toQueryParam

_emptyToNothing :: Maybe String -> Maybe String Source #

Collapse (Just "") to Nothing

_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a Source #

Collapse (Just mempty) to Nothing

DateTime Formatting

newtype DateTime Source #

Constructors

DateTime 

Fields

Instances
Eq DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Data DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DateTime -> c DateTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DateTime #

toConstr :: DateTime -> Constr #

dataTypeOf :: DateTime -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DateTime) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DateTime) #

gmapT :: (forall b. Data b => b -> b) -> DateTime -> DateTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DateTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DateTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

Ord DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Show DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToJSON DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromJSON DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: DateTime -> () #

ToHttpApiData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromHttpApiData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

FormatTime DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

ParseTime DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

parse an ISO8601 date-time string

Date Formatting

newtype Date Source #

Constructors

Date 

Fields

Instances
Enum Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

succ :: Date -> Date #

pred :: Date -> Date #

toEnum :: Int -> Date #

fromEnum :: Date -> Int #

enumFrom :: Date -> [Date] #

enumFromThen :: Date -> Date -> [Date] #

enumFromTo :: Date -> Date -> [Date] #

enumFromThenTo :: Date -> Date -> Date -> [Date] #

Eq Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Data Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Date -> c Date #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Date #

toConstr :: Date -> Constr #

dataTypeOf :: Date -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Date) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Date) #

gmapT :: (forall b. Data b => b -> b) -> Date -> Date #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQ :: (forall d. Data d => d -> u) -> Date -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Date -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

Ord Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Ix Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

range :: (Date, Date) -> [Date] #

index :: (Date, Date) -> Date -> Int #

unsafeIndex :: (Date, Date) -> Date -> Int

inRange :: (Date, Date) -> Date -> Bool #

rangeSize :: (Date, Date) -> Int #

unsafeRangeSize :: (Date, Date) -> Int

ToJSON Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromJSON Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: Date -> () #

ToHttpApiData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromHttpApiData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

FormatTime Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

ParseTime Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Date #

MimeRender MimeMultipartFormData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"

Byte/Binary Formatting

newtype ByteArray Source #

base64 encoded characters

Constructors

ByteArray 
Instances
Eq ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Data ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray #

toConstr :: ByteArray -> Constr #

dataTypeOf :: ByteArray -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) #

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

Ord ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Show ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToJSON ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromJSON ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: ByteArray -> () #

ToHttpApiData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromHttpApiData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

_readByteArray :: Monad m => Text -> m ByteArray Source #

read base64 encoded characters

_showByteArray :: ByteArray -> Text Source #

show base64 encoded characters

newtype Binary Source #

any sequence of octets

Constructors

Binary 

Fields

Instances
Eq Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Data Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binary -> c Binary #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Binary #

toConstr :: Binary -> Constr #

dataTypeOf :: Binary -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Binary) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Binary) #

gmapT :: (forall b. Data b => b -> b) -> Binary -> Binary #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQ :: (forall d. Data d => d -> u) -> Binary -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Binary -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

Ord Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Show Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToJSON Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromJSON Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: Binary -> () #

ToHttpApiData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

FromHttpApiData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Lens Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t Source #

\ No newline at end of file +OpenAPIPetstore.Core

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Core

Description

 
Synopsis

OpenAPIPetstoreConfig

data OpenAPIPetstoreConfig Source #

 

Constructors

OpenAPIPetstoreConfig 

Fields

newConfig :: IO OpenAPIPetstoreConfig Source #

constructs a default OpenAPIPetstoreConfig

configHost:

http://petstore.swagger.io:80/v2

configUserAgent:

"openapi-petstore/0.1.0.0"

addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig Source #

updates config use AuthMethod on matching requests

withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stdout logging

withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stderr logging

withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig Source #

updates the config to disable logging

OpenAPIPetstoreRequest

data OpenAPIPetstoreRequest req contentType res accept Source #

Represents a request.

Type Variables:

  • req - request operation
  • contentType - MimeType associated with request body
  • res - response model
  • accept - MimeType associated with response body

Constructors

OpenAPIPetstoreRequest 

Fields

Instances
Show (OpenAPIPetstoreRequest req contentType res accept) Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

showsPrec :: Int -> OpenAPIPetstoreRequest req contentType res accept -> ShowS #

show :: OpenAPIPetstoreRequest req contentType res accept -> String #

showList :: [OpenAPIPetstoreRequest req contentType res accept] -> ShowS #

rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Method Source #

rMethod Lens

rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [ByteString] Source #

rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params Source #

rParams Lens

rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [TypeRep] Source #

rParams Lens

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Minimal complete definition

Nothing

Methods

setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Instances
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Instance details

Defined in OpenAPIPetstore.API.Store

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestInlineAdditionalProperties ParamMapMapStringText Source #

Body Param "param" - request body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam TestBodyWithQueryParams User Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam TestBodyWithFileSchema FileSchemaTestClass Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterNumberSerialize BodyDouble Source #

Body Param "body" - Input number as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param "body" - Input composite as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

HasBodyParam CreateXmlItem XmlItem Source #

Body Param XmlItem - XmlItem Body

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => OpenAPIPetstoreRequest CreateXmlItem contentType res accept -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType res accept Source #

HasBodyParam Op123testSpecialTags Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Methods

setBodyParam :: (Consumes Op123testSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept Source #

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Apply an optional parameter to a request

(-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept infixl 2 Source #

infix operator / alias for addOptionalParam

Instances
HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UploadFile File2 Source #

Optional Param "file" - file to upload

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam DeletePet ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

HasOptionalParam TestGroupParameters StringGroup Source #

Optional Param "string_group" - String in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters Int64Group Source #

Optional Param "int64_group" - Integer in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestGroupParameters BooleanGroup Source #

Optional Param "boolean_group" - Boolean in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

data Params Source #

Request Params

Constructors

Params 

Fields

Instances
Show Params Source # 
Instance details

Defined in OpenAPIPetstore.Core

OpenAPIPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> OpenAPIPetstoreRequest req contentType res accept

req: Request Type, res: Response Type

setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [Header] -> OpenAPIPetstoreRequest req contentType res accept Source #

removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [HeaderName] -> OpenAPIPetstoreRequest req contentType res accept Source #

_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept Source #

addForm :: OpenAPIPetstoreRequest req contentType res accept -> Form -> OpenAPIPetstoreRequest req contentType res accept Source #

_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> Part -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept Source #

Params Utils

toPath :: ToHttpApiData a => a -> ByteString Source #

toHeader :: ToHttpApiData a => (HeaderName, a) -> [Header] Source #

toForm :: ToHttpApiData v => (ByteString, v) -> Form Source #

toQuery :: ToHttpApiData a => (ByteString, Maybe a) -> [QueryItem] Source #

OpenAPI CollectionFormat Utils

data CollectionFormat Source #

Determines the format of the array if type array is used.

Constructors

CommaSeparated

CSV format for multiple parameters.

SpaceSeparated

Also called SSV

TabSeparated

Also called TSV

PipeSeparated

`value1|value2|value2`

MultiParamArray

Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" (Query) or "formData" (Form)

toHeaderColl :: ToHttpApiData a => CollectionFormat -> (HeaderName, [a]) -> [Header] Source #

toFormColl :: ToHttpApiData v => CollectionFormat -> (ByteString, [v]) -> Form Source #

toQueryColl :: ToHttpApiData a => CollectionFormat -> (ByteString, Maybe [a]) -> Query Source #

_toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)] Source #

_toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)] Source #

_toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] Source #

AuthMethods

class Typeable a => AuthMethod a where Source #

Provides a method to apply auth methods to requests

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> a -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

Instances
AuthMethod AnyAuthMethod Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AnyAuthMethod -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthOAuthPetstoreAuth Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthOAuthPetstoreAuth -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthBasicHttpBasicTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthBasicHttpBasicTest -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthApiKeyApiKeyQuery Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthApiKeyApiKeyQuery -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

AuthMethod AuthApiKeyApiKey Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AuthApiKeyApiKey -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 
Instances
AuthMethod AnyAuthMethod Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AnyAuthMethod -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

_applyAuthMethods :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

apply all matching AuthMethods in config to request

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

Encodes fields using WH.toQueryParam

_emptyToNothing :: Maybe String -> Maybe String Source #

Collapse (Just "") to Nothing

_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a Source #

Collapse (Just mempty) to Nothing

DateTime Formatting

newtype DateTime Source #

Constructors

DateTime 

Fields

Instances
Eq DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Data DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DateTime -> c DateTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DateTime #

toConstr :: DateTime -> Constr #

dataTypeOf :: DateTime -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DateTime) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DateTime) #

gmapT :: (forall b. Data b => b -> b) -> DateTime -> DateTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DateTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DateTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

Ord DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Show DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: DateTime -> () #

FormatTime DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

ParseTime DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToJSON DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

toJSON :: DateTime -> Value

toEncoding :: DateTime -> Encoding

toJSONList :: [DateTime] -> Value

toEncodingList :: [DateTime] -> Encoding

FromJSON DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

parseJSON :: Value -> Parser DateTime

parseJSONList :: Value -> Parser [DateTime]

FromHttpApiData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToHttpApiData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

parse an ISO8601 date-time string

Date Formatting

newtype Date Source #

Constructors

Date 

Fields

Instances
Enum Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

succ :: Date -> Date #

pred :: Date -> Date #

toEnum :: Int -> Date #

fromEnum :: Date -> Int #

enumFrom :: Date -> [Date] #

enumFromThen :: Date -> Date -> [Date] #

enumFromTo :: Date -> Date -> [Date] #

enumFromThenTo :: Date -> Date -> Date -> [Date] #

Eq Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Data Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Date -> c Date #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Date #

toConstr :: Date -> Constr #

dataTypeOf :: Date -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Date) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Date) #

gmapT :: (forall b. Data b => b -> b) -> Date -> Date #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQ :: (forall d. Data d => d -> u) -> Date -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Date -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

Ord Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Ix Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

range :: (Date, Date) -> [Date] #

index :: (Date, Date) -> Date -> Int #

unsafeIndex :: (Date, Date) -> Date -> Int

inRange :: (Date, Date) -> Date -> Bool #

rangeSize :: (Date, Date) -> Int #

unsafeRangeSize :: (Date, Date) -> Int

NFData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: Date -> () #

FormatTime Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

ParseTime Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Date #

ToJSON Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

toJSON :: Date -> Value

toEncoding :: Date -> Encoding

toJSONList :: [Date] -> Value

toEncodingList :: [Date] -> Encoding

FromJSON Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

parseJSON :: Value -> Parser Date

parseJSONList :: Value -> Parser [Date]

FromHttpApiData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToHttpApiData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"

Byte/Binary Formatting

newtype ByteArray Source #

base64 encoded characters

Constructors

ByteArray 
Instances
Eq ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Data ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray #

toConstr :: ByteArray -> Constr #

dataTypeOf :: ByteArray -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) #

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

Ord ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Show ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: ByteArray -> () #

ToJSON ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

toJSON :: ByteArray -> Value

toEncoding :: ByteArray -> Encoding

toJSONList :: [ByteArray] -> Value

toEncodingList :: [ByteArray] -> Encoding

FromJSON ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

parseJSON :: Value -> Parser ByteArray

parseJSONList :: Value -> Parser [ByteArray]

FromHttpApiData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToHttpApiData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

_readByteArray :: Monad m => Text -> m ByteArray Source #

read base64 encoded characters

_showByteArray :: ByteArray -> Text Source #

show base64 encoded characters

newtype Binary Source #

any sequence of octets

Constructors

Binary 

Fields

Instances
Eq Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Data Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binary -> c Binary #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Binary #

toConstr :: Binary -> Constr #

dataTypeOf :: Binary -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Binary) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Binary) #

gmapT :: (forall b. Data b => b -> b) -> Binary -> Binary #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQ :: (forall d. Data d => d -> u) -> Binary -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Binary -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

Ord Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Show Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

NFData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

rnf :: Binary -> () #

ToJSON Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

toJSON :: Binary -> Value

toEncoding :: Binary -> Encoding

toJSONList :: [Binary] -> Value

toEncodingList :: [Binary] -> Encoding

FromJSON Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Methods

parseJSON :: Value -> Parser Binary

parseJSONList :: Value -> Parser [Binary]

FromHttpApiData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

ToHttpApiData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

Lens Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html index 44e98fe39143..56c7ff06642d 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html @@ -1 +1 @@ -OpenAPIPetstore.Logging

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellSafe
LanguageHaskell2010

OpenAPIPetstore.Logging

Description

Logging functions

Type Aliases (for compatibility)

type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #

Runs a monad-logger block with the filter predicate

type LogExec m = forall a. LoggingT m a -> m a Source #

A monad-logger block

type LogContext = LogSource -> LogLevel -> Bool Source #

A monad-logger filter predicate

type LogLevel = LogLevel Source #

A monad-logger log level

default logger

initLogContext :: IO LogContext Source #

the default log environment

runDefaultLogExecWithContext :: LogExecWithContext Source #

Runs a monad-logger block with the filter predicate

stdout logger

stdoutLoggingExec :: LogExecWithContext Source #

Runs a monad-logger block targeting stdout, with the filter predicate

stderr logger

stderrLoggingExec :: LogExecWithContext Source #

Runs a monad-logger block targeting stderr, with the filter predicate

Null logger

runNullLogExec :: LogExecWithContext Source #

Disables monad-logger logging

nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO () Source #

monad-logger which does nothing

Log Msg

_log :: (MonadIO m, MonadLogger m) => Text -> LogLevel -> Text -> m () Source #

Log a message using the current time

Log Exceptions

logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

Log Level

Level Filter

\ No newline at end of file +OpenAPIPetstore.Logging

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Logging

Description

Logging functions

Type Aliases (for compatibility)

type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #

Runs a Katip logging block with the Log environment

type LogExec m = forall a. KatipT m a -> m a Source #

A Katip logging block

type LogContext = LogEnv Source #

A Katip Log environment

type LogLevel = Severity Source #

A Katip Log severity

default logger

initLogContext :: IO LogContext Source #

the default log environment

runDefaultLogExecWithContext :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdout logger

stdoutLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdoutLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stdout

stderr logger

stderrLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stderrLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stderr

Null logger

runNullLogExec :: LogExecWithContext Source #

Disables Katip logging

Log Msg

_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m () Source #

Log a katip message

Log Exceptions

logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

Log Level

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html index 2adaac93b371..96c8e2b024ee 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html @@ -1 +1 @@ -OpenAPIPetstore.MimeTypes

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.MimeTypes

Description

 

ContentType MimeType

data ContentType a Source #

Constructors

MimeType a => ContentType 

Fields

Accept MimeType

data Accept a Source #

Constructors

MimeType a => Accept 

Fields

Consumes Class

class MimeType mtype => Consumes req mtype Source #

Instances
MimeType mtype => Consumes UpdateUser mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes CreateUsersWithListInput mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes CreateUsersWithArrayInput mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes CreateUser mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes PlaceOrder mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Store

Consumes UploadFileWithRequiredFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Consumes TestJsonFormData MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEnumParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEndpointParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithQueryParams MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithFileSchema MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterCompositeSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextxmlCharsetutf8 Source #
text/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextxmlCharsetutf16 Source #
text/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextxml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Produces Class

class MimeType mtype => Produces req mtype Source #

Instances
Produces UpdateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces LogoutUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces LoginUser MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces LoginUser MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces DeleteUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithListInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithArrayInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces PlaceOrder MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces PlaceOrder MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetInventory MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces DeleteOrder MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Store

Produces UploadFileWithRequiredFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UploadFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UpdatePetWithForm MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UpdatePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces GetPetById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces GetPetById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces DeletePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces AddPet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Produces TestJsonFormData MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestInlineAdditionalProperties MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestGroupParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEnumParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEndpointParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithQueryParams MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithFileSchema MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterCompositeSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces CreateXmlItem MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Default Mime Types

data MimeJSON Source #

Constructors

MimeJSON 
Instances
MimeType MimeJSON Source #
application/json; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
Instance details

Defined in OpenAPIPetstore.MimeTypes

ToJSON a => MimeRender MimeJSON a Source #

encode

Instance details

Defined in OpenAPIPetstore.MimeTypes

Produces LoginUser MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces PlaceOrder MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetInventory MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces UploadFileWithRequiredFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UploadFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces GetPetById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Produces TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Consumes UpdatePet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithQueryParams MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithFileSchema MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

data MimeXML Source #

Constructors

MimeXML 
Instances
MimeType MimeXML Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Produces LoginUser MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces PlaceOrder MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetPetById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes CreateXmlItem MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

data MimePlainText Source #

Constructors

MimePlainText 
Instances
MimeType MimePlainText Source #
text/plain; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

data MimeFormUrlEncoded Source #

Constructors

MimeFormUrlEncoded 
Instances
MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes TestJsonFormData MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEnumParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEndpointParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

data MimeMultipartFormData Source #

Constructors

MimeMultipartFormData 
Instances
MimeType MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Bool Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Char Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Double Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Float Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Int Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Integer Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData ByteString Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Text Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData String Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Consumes UploadFileWithRequiredFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

data MimeOctetStream Source #

Constructors

MimeOctetStream 
Instances
MimeType MimeOctetStream Source #
application/octet-stream
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

data MimeNoContent Source #

Constructors

MimeNoContent 
Instances
MimeType MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

Produces UpdateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces LogoutUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces DeleteUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithListInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithArrayInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces DeleteOrder MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Store

Produces UpdatePetWithForm MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UpdatePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces DeletePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces AddPet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces TestJsonFormData MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestInlineAdditionalProperties MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestGroupParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEnumParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEndpointParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithQueryParams MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithFileSchema MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces CreateXmlItem MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

data NoContent Source #

A type for responses without content-body.

Constructors

NoContent 

MimeType Class

class Typeable mtype => MimeType mtype where Source #

Minimal complete definition

mimeType | mimeTypes

Instances
MimeType MimeTextxmlCharsetutf8 Source #
text/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeTextxmlCharsetutf16 Source #
text/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeTextxml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeAny Source #
"*/*"
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeOctetStream Source #
application/octet-stream
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimePlainText Source #
text/plain; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeXML Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeJSON Source #
application/json; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender Class

class MimeType mtype => MimeRender mtype x where Source #

Minimal complete definition

mimeRender

Methods

mimeRender :: Proxy mtype -> x -> ByteString Source #

mimeRender' :: mtype -> x -> ByteString Source #

Instances
MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Bool Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Char Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Double Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Float Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Int Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Integer Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData ByteString Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Text Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData String Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

ToJSON a => MimeRender MimeJSON a Source #

encode

Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender Class

class MimeType mtype => MimeUnrender mtype o where Source #

Minimal complete definition

mimeUnrender

Instances
MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
Instance details

Defined in OpenAPIPetstore.MimeTypes

Custom Mime Types

MimeXmlCharsetutf16

MimeXmlCharsetutf8

MimeTextxml

MimeTextxmlCharsetutf16

MimeTextxmlCharsetutf8

\ No newline at end of file +OpenAPIPetstore.MimeTypes

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.MimeTypes

Description

 

ContentType MimeType

data ContentType a Source #

Constructors

MimeType a => ContentType 

Fields

Accept MimeType

data Accept a Source #

Constructors

MimeType a => Accept 

Fields

Consumes Class

class MimeType mtype => Consumes req mtype Source #

Instances
MimeType mtype => Consumes UpdateUser mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes CreateUsersWithListInput mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes CreateUsersWithArrayInput mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes CreateUser mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.User

MimeType mtype => Consumes PlaceOrder mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Store

Consumes UploadFileWithRequiredFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Consumes TestJsonFormData MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEnumParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEndpointParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithQueryParams MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithFileSchema MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterCompositeSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Consumes FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextXmlCharsetutf8 Source #
text/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextXmlCharsetutf16 Source #
text/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeTextXml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes CreateXmlItem MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Produces Class

class MimeType mtype => Produces req mtype Source #

Instances
Produces UpdateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces LogoutUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces LoginUser MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces LoginUser MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces DeleteUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithListInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithArrayInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces PlaceOrder MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces PlaceOrder MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetInventory MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces DeleteOrder MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Store

Produces UploadFileWithRequiredFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UploadFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UpdatePetWithForm MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UpdatePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces GetPetById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces GetPetById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces DeletePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces AddPet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Produces TestQueryParameterCollectionFormat MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestJsonFormData MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestInlineAdditionalProperties MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestGroupParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEnumParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEndpointParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithQueryParams MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithFileSchema MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterStringSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterNumberSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterCompositeSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeType mtype => Produces FakeOuterBooleanSerialize mtype Source #
*/*
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces CreateXmlItem MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Default Mime Types

data MimeJSON Source #

Constructors

MimeJSON 
Instances
MimeType MimeJSON Source #
application/json; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeJSON -> [MediaType] Source #

mimeType :: Proxy MimeJSON -> Maybe MediaType Source #

mimeType' :: MimeJSON -> Maybe MediaType Source #

mimeTypes' :: MimeJSON -> [MediaType] Source #

FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
Instance details

Defined in OpenAPIPetstore.MimeTypes

ToJSON a => MimeRender MimeJSON a Source #

encode

Instance details

Defined in OpenAPIPetstore.MimeTypes

Produces LoginUser MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.User

Produces PlaceOrder MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetInventory MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Store

Produces UploadFileWithRequiredFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UploadFile MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces GetPetById MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Produces TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Consumes UpdatePet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes TestClassname MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestClientModel MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithQueryParams MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestBodyWithFileSchema MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes Op123testSpecialTags MimeJSON Source #
application/json
Instance details

Defined in OpenAPIPetstore.API.AnotherFake

data MimeXML Source #

Constructors

MimeXML 
Instances
MimeType MimeXML Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeXML -> [MediaType] Source #

mimeType :: Proxy MimeXML -> Maybe MediaType Source #

mimeType' :: MimeXML -> Maybe MediaType Source #

mimeTypes' :: MimeXML -> [MediaType] Source #

Produces LoginUser MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces GetUserByName MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.User

Produces PlaceOrder MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetOrderById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Store

Produces GetPetById MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByTags MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces FindPetsByStatus MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UpdatePet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes AddPet MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes CreateXmlItem MimeXML Source #
application/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

data MimePlainText Source #

Constructors

MimePlainText 
Instances
MimeType MimePlainText Source #
text/plain; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimePlainText -> [MediaType] Source #

mimeType :: Proxy MimePlainText -> Maybe MediaType Source #

mimeType' :: MimePlainText -> Maybe MediaType Source #

mimeTypes' :: MimePlainText -> [MediaType] Source #

MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

data MimeFormUrlEncoded Source #

Constructors

MimeFormUrlEncoded 
Instances
MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes TestJsonFormData MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEnumParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

Consumes TestEndpointParameters MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.API.Fake

data MimeMultipartFormData Source #

Constructors

MimeMultipartFormData 
Instances
MimeType MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Bool Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Char Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Double Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Float Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Int Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Integer Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData String Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData ByteString Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Text Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Consumes UploadFileWithRequiredFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.API.Pet

data MimeOctetStream Source #

Constructors

MimeOctetStream 
Instances
MimeType MimeOctetStream Source #
application/octet-stream
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

data MimeNoContent Source #

Constructors

MimeNoContent 
Instances
MimeType MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeNoContent -> [MediaType] Source #

mimeType :: Proxy MimeNoContent -> Maybe MediaType Source #

mimeType' :: MimeNoContent -> Maybe MediaType Source #

mimeTypes' :: MimeNoContent -> [MediaType] Source #

MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

Produces UpdateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces LogoutUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces DeleteUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithListInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUsersWithArrayInput MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces CreateUser MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.User

Produces DeleteOrder MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Store

Produces UpdatePetWithForm MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces UpdatePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces DeletePet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces AddPet MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Produces TestQueryParameterCollectionFormat MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestJsonFormData MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestInlineAdditionalProperties MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestGroupParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEnumParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestEndpointParameters MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithQueryParams MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces TestBodyWithFileSchema MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

Produces CreateXmlItem MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

data MimeAny Source #

Constructors

MimeAny 
Instances
MimeType MimeAny Source #
"*/*"
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeAny -> [MediaType] Source #

mimeType :: Proxy MimeAny -> Maybe MediaType Source #

mimeType' :: MimeAny -> Maybe MediaType Source #

mimeTypes' :: MimeAny -> [MediaType] Source #

data NoContent Source #

A type for responses without content-body.

Constructors

NoContent 

MimeType Class

class Typeable mtype => MimeType mtype where Source #

Minimal complete definition

mimeType | mimeTypes

Methods

mimeTypes :: Proxy mtype -> [MediaType] Source #

mimeType :: Proxy mtype -> Maybe MediaType Source #

mimeType' :: mtype -> Maybe MediaType Source #

mimeTypes' :: mtype -> [MediaType] Source #

Instances
MimeType MimeTextXmlCharsetutf8 Source #
text/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeTextXmlCharsetutf16 Source #
text/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeTextXml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeTextXml -> [MediaType] Source #

mimeType :: Proxy MimeTextXml -> Maybe MediaType Source #

mimeType' :: MimeTextXml -> Maybe MediaType Source #

mimeTypes' :: MimeTextXml -> [MediaType] Source #

MimeType MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeAny Source #
"*/*"
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeAny -> [MediaType] Source #

mimeType :: Proxy MimeAny -> Maybe MediaType Source #

mimeType' :: MimeAny -> Maybe MediaType Source #

mimeTypes' :: MimeAny -> [MediaType] Source #

MimeType MimeNoContent Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeNoContent -> [MediaType] Source #

mimeType :: Proxy MimeNoContent -> Maybe MediaType Source #

mimeType' :: MimeNoContent -> Maybe MediaType Source #

mimeTypes' :: MimeNoContent -> [MediaType] Source #

MimeType MimeOctetStream Source #
application/octet-stream
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeMultipartFormData Source #
multipart/form-data
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeType MimePlainText Source #
text/plain; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimePlainText -> [MediaType] Source #

mimeType :: Proxy MimePlainText -> Maybe MediaType Source #

mimeType' :: MimePlainText -> Maybe MediaType Source #

mimeTypes' :: MimePlainText -> [MediaType] Source #

MimeType MimeXML Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeXML -> [MediaType] Source #

mimeType :: Proxy MimeXML -> Maybe MediaType Source #

mimeType' :: MimeXML -> Maybe MediaType Source #

mimeTypes' :: MimeXML -> [MediaType] Source #

MimeType MimeJSON Source #
application/json; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeJSON -> [MediaType] Source #

mimeType :: Proxy MimeJSON -> Maybe MediaType Source #

mimeType' :: MimeJSON -> Maybe MediaType Source #

mimeTypes' :: MimeJSON -> [MediaType] Source #

MimeRender Class

class MimeType mtype => MimeRender mtype x where Source #

Minimal complete definition

mimeRender

Methods

mimeRender :: Proxy mtype -> x -> ByteString Source #

mimeRender' :: mtype -> x -> ByteString Source #

Instances
MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Bool Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Char Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Double Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Float Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Int Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Integer Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData String Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData ByteString Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Text Source # 
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimeMultipartFormData Binary Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData ByteArray Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData Date Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData DateTime Source # 
Instance details

Defined in OpenAPIPetstore.Core

MimeRender MimeMultipartFormData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText String Source #
BCL.pack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText ByteString Source #
P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
Instance details

Defined in OpenAPIPetstore.MimeTypes

ToJSON a => MimeRender MimeJSON a Source #

encode

Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender Class

class MimeType mtype => MimeUnrender mtype o where Source #

Minimal complete definition

mimeUnrender

Instances
MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
Instance details

Defined in OpenAPIPetstore.MimeTypes

MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
Instance details

Defined in OpenAPIPetstore.MimeTypes

FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
Instance details

Defined in OpenAPIPetstore.MimeTypes

Custom Mime Types

MimeXmlCharsetutf16

data MimeXmlCharsetutf16 Source #

Constructors

MimeXmlCharsetutf16 
Instances
MimeType MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.MimeTypes

Consumes CreateXmlItem MimeXmlCharsetutf16 Source #
application/xml; charset=utf-16
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeXmlCharsetutf8

data MimeXmlCharsetutf8 Source #

Constructors

MimeXmlCharsetutf8 
Instances
MimeType MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.MimeTypes

Consumes CreateXmlItem MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeTextXml

data MimeTextXml Source #

Constructors

MimeTextXml 
Instances
MimeType MimeTextXml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.MimeTypes

Methods

mimeTypes :: Proxy MimeTextXml -> [MediaType] Source #

mimeType :: Proxy MimeTextXml -> Maybe MediaType Source #

mimeType' :: MimeTextXml -> Maybe MediaType Source #

mimeTypes' :: MimeTextXml -> [MediaType] Source #

Consumes CreateXmlItem MimeTextXml Source #
text/xml
Instance details

Defined in OpenAPIPetstore.API.Fake

MimeTextXmlCharsetutf16

MimeTextXmlCharsetutf8

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html index dd3f7b29a225..012635d2579b 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html @@ -1,9 +1,9 @@ -OpenAPIPetstore.Model

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Model

Description

 
Synopsis

Parameter newtypes

AdditionalMetadata

newtype AdditionalMetadata Source #

Instances
Eq AdditionalMetadata Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show AdditionalMetadata Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

ApiKey

newtype ApiKey Source #

Constructors

ApiKey 

Fields

Instances
Eq ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: ApiKey -> ApiKey -> Bool #

(/=) :: ApiKey -> ApiKey -> Bool #

Show ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam DeletePet ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

Body

newtype Body Source #

Constructors

Body 

Fields

Instances
Eq Body Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

ToJSON Body Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

BodyBool

newtype BodyBool Source #

Constructors

BodyBool 

Fields

Instances
Eq BodyBool Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BodyBool Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON BodyBool Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

BodyDouble

newtype BodyDouble Source #

Constructors

BodyDouble 

Fields

Instances
Eq BodyDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BodyDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON BodyDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam FakeOuterNumberSerialize BodyDouble Source #

Body Param "body" - Input number as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

BodyText

newtype BodyText Source #

Constructors

BodyText 

Fields

Instances
Eq BodyText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BodyText Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON BodyText Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

BooleanGroup

newtype BooleanGroup Source #

Constructors

BooleanGroup 

Fields

Instances
Eq BooleanGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BooleanGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestGroupParameters BooleanGroup Source #

Optional Param "boolean_group" - Boolean in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

Byte

newtype Byte Source #

Constructors

Byte 

Fields

Instances
Eq Byte Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Byte -> Byte -> Bool #

(/=) :: Byte -> Byte -> Bool #

Show Byte Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Byte -> ShowS #

show :: Byte -> String #

showList :: [Byte] -> ShowS #

Callback

newtype Callback Source #

Constructors

Callback 

Fields

Instances
Eq Callback Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Callback Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

EnumFormString

newtype EnumFormString Source #

Instances
Eq EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

EnumFormStringArray

EnumHeaderString

EnumHeaderStringArray

EnumQueryDouble

newtype EnumQueryDouble Source #

Instances
Eq EnumQueryDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumQueryDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

EnumQueryInteger

EnumQueryString

EnumQueryStringArray

File2

newtype File2 Source #

Constructors

File2 

Fields

Instances
Eq File2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: File2 -> File2 -> Bool #

(/=) :: File2 -> File2 -> Bool #

Show File2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> File2 -> ShowS #

show :: File2 -> String #

showList :: [File2] -> ShowS #

HasOptionalParam UploadFile File2 Source #

Optional Param "file" - file to upload

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

Int32

newtype Int32 Source #

Constructors

Int32 

Fields

Instances
Eq Int32 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Int32 -> Int32 -> Bool #

(/=) :: Int32 -> Int32 -> Bool #

Show Int32 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

Int64

newtype Int64 Source #

Constructors

Int64 

Fields

Instances
Eq Int64 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Int64 -> Int64 -> Bool #

(/=) :: Int64 -> Int64 -> Bool #

Show Int64 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

Int64Group

newtype Int64Group Source #

Constructors

Int64Group 
Instances
Eq Int64Group Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Int64Group Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestGroupParameters Int64Group Source #

Optional Param "int64_group" - Integer in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

Name2

newtype Name2 Source #

Constructors

Name2 

Fields

Instances
Eq Name2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Name2 -> Name2 -> Bool #

(/=) :: Name2 -> Name2 -> Bool #

Show Name2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Name2 -> ShowS #

show :: Name2 -> String #

showList :: [Name2] -> ShowS #

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

Number

newtype Number Source #

Constructors

Number 

Fields

Instances
Eq Number Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Number -> Number -> Bool #

(/=) :: Number -> Number -> Bool #

Show Number Source # 
Instance details

Defined in OpenAPIPetstore.Model

OrderId

newtype OrderId Source #

Constructors

OrderId 

Fields

Instances
Eq OrderId Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: OrderId -> OrderId -> Bool #

(/=) :: OrderId -> OrderId -> Bool #

Show OrderId Source # 
Instance details

Defined in OpenAPIPetstore.Model

OrderIdText

newtype OrderIdText Source #

Constructors

OrderIdText 

Fields

Instances
Eq OrderIdText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show OrderIdText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Param

newtype Param Source #

Constructors

Param 

Fields

Instances
Eq Param Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Param -> Param -> Bool #

(/=) :: Param -> Param -> Bool #

Show Param Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Param -> ShowS #

show :: Param -> String #

showList :: [Param] -> ShowS #

Param2

newtype Param2 Source #

Constructors

Param2 

Fields

Instances
Eq Param2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Param2 -> Param2 -> Bool #

(/=) :: Param2 -> Param2 -> Bool #

Show Param2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

ParamBinary

ParamDate

newtype ParamDate Source #

Constructors

ParamDate 

Fields

Instances
Eq ParamDate Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ParamDate Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

ParamDateTime

ParamDouble

newtype ParamDouble Source #

Constructors

ParamDouble 
Instances
Eq ParamDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ParamDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

ParamFloat

ParamInteger

ParamMapMapStringText

ParamString

Password

newtype Password Source #

Constructors

Password 

Fields

Instances
Eq Password Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Password Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

PatternWithoutDelimiter

PetId

newtype PetId Source #

Constructors

PetId 

Fields

Instances
Eq PetId Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: PetId -> PetId -> Bool #

(/=) :: PetId -> PetId -> Bool #

Show PetId Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> PetId -> ShowS #

show :: PetId -> String #

showList :: [PetId] -> ShowS #

Query

newtype Query Source #

Constructors

Query 

Fields

Instances
Eq Query Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Query -> Query -> Bool #

(/=) :: Query -> Query -> Bool #

Show Query Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

RequiredBooleanGroup

RequiredFile

RequiredInt64Group

RequiredStringGroup

Status

newtype Status Source #

Constructors

Status 

Fields

Instances
Eq Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Status -> Status -> Bool #

(/=) :: Status -> Status -> Bool #

Show Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

StatusText

newtype StatusText Source #

Constructors

StatusText 

Fields

Instances
Eq StatusText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show StatusText Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

StringGroup

newtype StringGroup Source #

Constructors

StringGroup 

Fields

Instances
Eq StringGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show StringGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestGroupParameters StringGroup Source #

Optional Param "string_group" - String in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

Tags

newtype Tags Source #

Constructors

Tags 

Fields

Instances
Eq Tags Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Tags -> Tags -> Bool #

(/=) :: Tags -> Tags -> Bool #

Show Tags Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

Username

newtype Username Source #

Constructors

Username 

Fields

Instances
Eq Username Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Username Source # 
Instance details

Defined in OpenAPIPetstore.Model

Models

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

Construct a value of type AdditionalPropertiesClass (by applying it's required fields, if any)

Animal

data Animal Source #

Animal

Constructors

Animal 

Fields

Instances
Eq Animal Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Animal -> Animal -> Bool #

(/=) :: Animal -> Animal -> Bool #

Show Animal Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Animal Source #

ToJSON Animal

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Animal Source #

FromJSON Animal

Instance details

Defined in OpenAPIPetstore.Model

mkAnimal Source #

Arguments

:: Text

animalClassName

-> Animal 

Construct a value of type Animal (by applying it's required fields, if any)

ApiResponse

data ApiResponse Source #

ApiResponse

Constructors

ApiResponse 

Fields

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

ArrayOfArrayOfNumberOnly

mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly Source #

Construct a value of type ArrayOfArrayOfNumberOnly (by applying it's required fields, if any)

ArrayOfNumberOnly

mkArrayOfNumberOnly :: ArrayOfNumberOnly Source #

Construct a value of type ArrayOfNumberOnly (by applying it's required fields, if any)

ArrayTest

data ArrayTest Source #

ArrayTest

Constructors

ArrayTest 

Fields

Instances
Eq ArrayTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ArrayTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ArrayTest Source #

ToJSON ArrayTest

Instance details

Defined in OpenAPIPetstore.Model

FromJSON ArrayTest Source #

FromJSON ArrayTest

Instance details

Defined in OpenAPIPetstore.Model

mkArrayTest :: ArrayTest Source #

Construct a value of type ArrayTest (by applying it's required fields, if any)

Capitalization

mkCapitalization :: Capitalization Source #

Construct a value of type Capitalization (by applying it's required fields, if any)

Cat

data Cat Source #

Cat

Constructors

Cat 

Fields

Instances
Eq Cat Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Cat -> Cat -> Bool #

(/=) :: Cat -> Cat -> Bool #

Show Cat Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Cat -> ShowS #

show :: Cat -> String #

showList :: [Cat] -> ShowS #

ToJSON Cat Source #

ToJSON Cat

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Cat Source #

FromJSON Cat

Instance details

Defined in OpenAPIPetstore.Model

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

Construct a value of type Cat (by applying it's required fields, if any)

Category

data Category Source #

Category

Constructors

Category 

Fields

Instances
Eq Category Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Category Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Category Source #

ToJSON Category

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Category Source #

FromJSON Category

Instance details

Defined in OpenAPIPetstore.Model

mkCategory Source #

Arguments

:: Text

categoryName

-> Category 

Construct a value of type Category (by applying it's required fields, if any)

ClassModel

data ClassModel Source #

ClassModel - Model for testing model with "_class" property

Constructors

ClassModel 

Fields

Instances
Eq ClassModel Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ClassModel Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ClassModel Source #

ToJSON ClassModel

Instance details

Defined in OpenAPIPetstore.Model

FromJSON ClassModel Source #

FromJSON ClassModel

Instance details

Defined in OpenAPIPetstore.Model

mkClassModel :: ClassModel Source #

Construct a value of type ClassModel (by applying it's required fields, if any)

Client

data Client Source #

Client

Constructors

Client 

Fields

Instances
Eq Client Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

Show Client Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Client Source #

ToJSON Client

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Client Source #

FromJSON Client

Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam Op123testSpecialTags Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Methods

setBodyParam :: (Consumes Op123testSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept Source #

mkClient :: Client Source #

Construct a value of type Client (by applying it's required fields, if any)

Dog

data Dog Source #

Dog

Constructors

Dog 

Fields

Instances
Eq Dog Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Dog -> Dog -> Bool #

(/=) :: Dog -> Dog -> Bool #

Show Dog Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Dog -> ShowS #

show :: Dog -> String #

showList :: [Dog] -> ShowS #

ToJSON Dog Source #

ToJSON Dog

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Dog Source #

FromJSON Dog

Instance details

Defined in OpenAPIPetstore.Model

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

Construct a value of type Dog (by applying it's required fields, if any)

EnumArrays

data EnumArrays Source #

EnumArrays

Constructors

EnumArrays 

Fields

Instances
Eq EnumArrays Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumArrays Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON EnumArrays Source #

ToJSON EnumArrays

Instance details

Defined in OpenAPIPetstore.Model

FromJSON EnumArrays Source #

FromJSON EnumArrays

Instance details

Defined in OpenAPIPetstore.Model

mkEnumArrays :: EnumArrays Source #

Construct a value of type EnumArrays (by applying it's required fields, if any)

EnumTest

data EnumTest Source #

EnumTest

Constructors

EnumTest 

Fields

Instances
Eq EnumTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON EnumTest Source #

ToJSON EnumTest

Instance details

Defined in OpenAPIPetstore.Model

FromJSON EnumTest Source #

FromJSON EnumTest

Instance details

Defined in OpenAPIPetstore.Model

mkEnumTest Source #

Construct a value of type EnumTest (by applying it's required fields, if any)

File

data File Source #

File - Must be named File for test.

Constructors

File 

Fields

Instances
Eq File Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

ToJSON File Source #

ToJSON File

Instance details

Defined in OpenAPIPetstore.Model

FromJSON File Source #

FromJSON File

Instance details

Defined in OpenAPIPetstore.Model

mkFile :: File Source #

Construct a value of type File (by applying it's required fields, if any)

FileSchemaTestClass

data FileSchemaTestClass Source #

FileSchemaTestClass

mkFileSchemaTestClass :: FileSchemaTestClass Source #

Construct a value of type FileSchemaTestClass (by applying it's required fields, if any)

FormatTest

data FormatTest Source #

FormatTest

Constructors

FormatTest 

Fields

Instances
Eq FormatTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show FormatTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON FormatTest Source #

ToJSON FormatTest

Instance details

Defined in OpenAPIPetstore.Model

FromJSON FormatTest Source #

FromJSON FormatTest

Instance details

Defined in OpenAPIPetstore.Model

mkFormatTest Source #

Construct a value of type FormatTest (by applying it's required fields, if any)

HasOnlyReadOnly

mkHasOnlyReadOnly :: HasOnlyReadOnly Source #

Construct a value of type HasOnlyReadOnly (by applying it's required fields, if any)

MapTest

data MapTest Source #

MapTest

Constructors

MapTest 

Fields

Instances
Eq MapTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: MapTest -> MapTest -> Bool #

(/=) :: MapTest -> MapTest -> Bool #

Show MapTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON MapTest Source #

ToJSON MapTest

Instance details

Defined in OpenAPIPetstore.Model

FromJSON MapTest Source #

FromJSON MapTest

Instance details

Defined in OpenAPIPetstore.Model

mkMapTest :: MapTest Source #

Construct a value of type MapTest (by applying it's required fields, if any)

MixedPropertiesAndAdditionalPropertiesClass

data MixedPropertiesAndAdditionalPropertiesClass Source #

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

data Model200Response Source #

Model200Response - Model for testing model name starting with number

mkModel200Response :: Model200Response Source #

Construct a value of type Model200Response (by applying it's required fields, if any)

ModelList

data ModelList Source #

ModelList

Constructors

ModelList 

Fields

Instances
Eq ModelList Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ModelList Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ModelList Source #

ToJSON ModelList

Instance details

Defined in OpenAPIPetstore.Model

FromJSON ModelList Source #

FromJSON ModelList

Instance details

Defined in OpenAPIPetstore.Model

mkModelList :: ModelList Source #

Construct a value of type ModelList (by applying it's required fields, if any)

ModelReturn

data ModelReturn Source #

ModelReturn - Model for testing reserved words

Constructors

ModelReturn 

Fields

mkModelReturn :: ModelReturn Source #

Construct a value of type ModelReturn (by applying it's required fields, if any)

Name

data Name Source #

Name - Model for testing model name same as property name

Constructors

Name 

Fields

Instances
Eq Name Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Show Name Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

ToJSON Name Source #

ToJSON Name

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Name Source #

FromJSON Name

Instance details

Defined in OpenAPIPetstore.Model

mkName Source #

Arguments

:: Int

nameName

-> Name 

Construct a value of type Name (by applying it's required fields, if any)

NumberOnly

data NumberOnly Source #

NumberOnly

Instances
Eq NumberOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show NumberOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON NumberOnly Source #

ToJSON NumberOnly

Instance details

Defined in OpenAPIPetstore.Model

FromJSON NumberOnly Source #

FromJSON NumberOnly

Instance details

Defined in OpenAPIPetstore.Model

mkNumberOnly :: NumberOnly Source #

Construct a value of type NumberOnly (by applying it's required fields, if any)

Order

data Order Source #

Order

Constructors

Order 

Fields

Instances
Eq Order Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source #

ToJSON Order

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Order Source #

FromJSON Order

Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Instance details

Defined in OpenAPIPetstore.API.Store

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

OuterComposite

data OuterComposite Source #

OuterComposite

Constructors

OuterComposite 

Fields

mkOuterComposite :: OuterComposite Source #

Construct a value of type OuterComposite (by applying it's required fields, if any)

Pet

data Pet Source #

Pet

Constructors

Pet 

Fields

Instances
Eq Pet Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source #

ToJSON Pet

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Pet Source #

FromJSON Pet

Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

ReadOnlyFirst

mkReadOnlyFirst :: ReadOnlyFirst Source #

Construct a value of type ReadOnlyFirst (by applying it's required fields, if any)

SpecialModelName

mkSpecialModelName :: SpecialModelName Source #

Construct a value of type SpecialModelName (by applying it's required fields, if any)

Tag

data Tag Source #

Tag

Constructors

Tag 

Fields

Instances
Eq Tag Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Show Tag Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

ToJSON Tag Source #

ToJSON Tag

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Tag Source #

FromJSON Tag

Instance details

Defined in OpenAPIPetstore.Model

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

TypeHolderDefault

TypeHolderExample

User

data User Source #

User

Constructors

User 

Fields

Instances
Eq User Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source #

ToJSON User

Instance details

Defined in OpenAPIPetstore.Model

FromJSON User Source #

FromJSON User

Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam TestBodyWithQueryParams User Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

XmlItem

data XmlItem Source #

XmlItem

Constructors

XmlItem 

Fields

Instances
Eq XmlItem Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: XmlItem -> XmlItem -> Bool #

(/=) :: XmlItem -> XmlItem -> Bool #

Show XmlItem Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON XmlItem Source #

ToJSON XmlItem

Instance details

Defined in OpenAPIPetstore.Model

FromJSON XmlItem Source #

FromJSON XmlItem

Instance details

Defined in OpenAPIPetstore.Model

HasBodyParam CreateXmlItem XmlItem Source #

Body Param XmlItem - XmlItem Body

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => OpenAPIPetstoreRequest CreateXmlItem contentType res accept -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType res accept Source #

mkXmlItem :: XmlItem Source #

Construct a value of type XmlItem (by applying it's required fields, if any)

Enums

E'ArrayEnum

data E'ArrayEnum Source #

Enum of Text

Constructors

E'ArrayEnum'Fish
"fish"
E'ArrayEnum'Crab
"crab"
Instances
Bounded E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumFormString

data E'EnumFormString Source #

Enum of Text . - Form parameter enum test (string)

Instances
Bounded E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumFormStringArray

data E'EnumFormStringArray Source #

Enum of Text

Instances
Bounded E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumInteger

data E'EnumInteger Source #

Enum of Int

Instances
Bounded E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumNumber

data E'EnumNumber Source #

Enum of Double

Instances
Bounded E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumQueryInteger

data E'EnumQueryInteger Source #

Enum of Int

Instances
Bounded E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumString

data E'EnumString Source #

Enum of Text

Instances
Bounded E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'Inner

data E'Inner Source #

Enum of Text

Instances
Bounded E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: E'Inner -> E'Inner -> Bool #

(/=) :: E'Inner -> E'Inner -> Bool #

Ord E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'JustSymbol

data E'JustSymbol Source #

Enum of Text

Instances
Bounded E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'Status

data E'Status Source #

Enum of Text . - Order Status

Constructors

E'Status'Placed
"placed"
E'Status'Approved
"approved"
E'Status'Delivered
"delivered"
Instances
Bounded E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'Status2

data E'Status2 Source #

Enum of Text . - pet status in the store

Constructors

E'Status2'Available
"available"
E'Status2'Pending
"pending"
E'Status2'Sold
"sold"
Instances
Bounded E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

EnumClass

data EnumClass Source #

Enum of Text

Constructors

EnumClass'_abc
"_abc"
EnumClass'_efg
"-efg"
EnumClass'_xyz
"(xyz)"
Instances
Bounded EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

OuterEnum

data OuterEnum Source #

Enum of Text

Constructors

OuterEnum'Placed
"placed"
OuterEnum'Approved
"approved"
OuterEnum'Delivered
"delivered"
Instances
Bounded OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromHttpApiData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file +OpenAPIPetstore.Model

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Model

Description

 
Synopsis

Parameter newtypes

AdditionalMetadata

newtype AdditionalMetadata Source #

Instances
Eq AdditionalMetadata Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show AdditionalMetadata Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Instance details

Defined in OpenAPIPetstore.API.Pet

ApiKey

newtype ApiKey Source #

Constructors

ApiKey 

Fields

Instances
Eq ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: ApiKey -> ApiKey -> Bool #

(/=) :: ApiKey -> ApiKey -> Bool #

Show ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam DeletePet ApiKey Source # 
Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

Body

newtype Body Source #

Constructors

Body 

Fields

Instances
Eq Body Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

ToJSON Body Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Body -> Value

toEncoding :: Body -> Encoding

toJSONList :: [Body] -> Value

toEncodingList :: [Body] -> Encoding

HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

Instance details

Defined in OpenAPIPetstore.API.User

BodyBool

newtype BodyBool Source #

Constructors

BodyBool 

Fields

Instances
Eq BodyBool Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BodyBool Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON BodyBool Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: BodyBool -> Value

toEncoding :: BodyBool -> Encoding

toJSONList :: [BodyBool] -> Value

toEncodingList :: [BodyBool] -> Encoding

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

BodyDouble

newtype BodyDouble Source #

Constructors

BodyDouble 

Fields

Instances
Eq BodyDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BodyDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON BodyDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: BodyDouble -> Value

toEncoding :: BodyDouble -> Encoding

toJSONList :: [BodyDouble] -> Value

toEncodingList :: [BodyDouble] -> Encoding

HasBodyParam FakeOuterNumberSerialize BodyDouble Source #

Body Param "body" - Input number as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

BodyText

newtype BodyText Source #

Constructors

BodyText 

Fields

Instances
Eq BodyText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BodyText Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON BodyText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: BodyText -> Value

toEncoding :: BodyText -> Encoding

toJSONList :: [BodyText] -> Value

toEncodingList :: [BodyText] -> Encoding

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

BooleanGroup

newtype BooleanGroup Source #

Constructors

BooleanGroup 

Fields

Instances
Eq BooleanGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show BooleanGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestGroupParameters BooleanGroup Source #

Optional Param "boolean_group" - Boolean in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

Byte

newtype Byte Source #

Constructors

Byte 

Fields

Instances
Eq Byte Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Byte -> Byte -> Bool #

(/=) :: Byte -> Byte -> Bool #

Show Byte Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Byte -> ShowS #

show :: Byte -> String #

showList :: [Byte] -> ShowS #

Callback

newtype Callback Source #

Constructors

Callback 

Fields

Instances
Eq Callback Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Callback Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

Context

newtype Context Source #

Constructors

Context 

Fields

Instances
Eq Context Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

Show Context Source # 
Instance details

Defined in OpenAPIPetstore.Model

EnumFormString

newtype EnumFormString Source #

Instances
Eq EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

Instance details

Defined in OpenAPIPetstore.API.Fake

EnumFormStringArray

EnumHeaderString

EnumHeaderStringArray

EnumQueryDouble

newtype EnumQueryDouble Source #

Instances
Eq EnumQueryDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumQueryDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

Instance details

Defined in OpenAPIPetstore.API.Fake

EnumQueryInteger

EnumQueryString

EnumQueryStringArray

File2

newtype File2 Source #

Constructors

File2 

Fields

Instances
Eq File2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: File2 -> File2 -> Bool #

(/=) :: File2 -> File2 -> Bool #

Show File2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> File2 -> ShowS #

show :: File2 -> String #

showList :: [File2] -> ShowS #

HasOptionalParam UploadFile File2 Source #

Optional Param "file" - file to upload

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File2 -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

Http

newtype Http Source #

Constructors

Http 

Fields

Instances
Eq Http Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Http -> Http -> Bool #

(/=) :: Http -> Http -> Bool #

Show Http Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Http -> ShowS #

show :: Http -> String #

showList :: [Http] -> ShowS #

Int32

newtype Int32 Source #

Constructors

Int32 

Fields

Instances
Eq Int32 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Int32 -> Int32 -> Bool #

(/=) :: Int32 -> Int32 -> Bool #

Show Int32 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

Int64

newtype Int64 Source #

Constructors

Int64 

Fields

Instances
Eq Int64 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Int64 -> Int64 -> Bool #

(/=) :: Int64 -> Int64 -> Bool #

Show Int64 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

Int64Group

newtype Int64Group Source #

Constructors

Int64Group 
Instances
Eq Int64Group Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Int64Group Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestGroupParameters Int64Group Source #

Optional Param "int64_group" - Integer in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

Ioutil

newtype Ioutil Source #

Constructors

Ioutil 

Fields

Instances
Eq Ioutil Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Ioutil -> Ioutil -> Bool #

(/=) :: Ioutil -> Ioutil -> Bool #

Show Ioutil Source # 
Instance details

Defined in OpenAPIPetstore.Model

Name2

newtype Name2 Source #

Constructors

Name2 

Fields

Instances
Eq Name2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Name2 -> Name2 -> Bool #

(/=) :: Name2 -> Name2 -> Bool #

Show Name2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Name2 -> ShowS #

show :: Name2 -> String #

showList :: [Name2] -> ShowS #

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

Number

newtype Number Source #

Constructors

Number 

Fields

Instances
Eq Number Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Number -> Number -> Bool #

(/=) :: Number -> Number -> Bool #

Show Number Source # 
Instance details

Defined in OpenAPIPetstore.Model

OrderId

newtype OrderId Source #

Constructors

OrderId 

Fields

Instances
Eq OrderId Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: OrderId -> OrderId -> Bool #

(/=) :: OrderId -> OrderId -> Bool #

Show OrderId Source # 
Instance details

Defined in OpenAPIPetstore.Model

OrderIdText

newtype OrderIdText Source #

Constructors

OrderIdText 

Fields

Instances
Eq OrderIdText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show OrderIdText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Param

newtype Param Source #

Constructors

Param 

Fields

Instances
Eq Param Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Param -> Param -> Bool #

(/=) :: Param -> Param -> Bool #

Show Param Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Param -> ShowS #

show :: Param -> String #

showList :: [Param] -> ShowS #

Param2

newtype Param2 Source #

Constructors

Param2 

Fields

Instances
Eq Param2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Param2 -> Param2 -> Bool #

(/=) :: Param2 -> Param2 -> Bool #

Show Param2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

ParamBinary

ParamDate

newtype ParamDate Source #

Constructors

ParamDate 

Fields

Instances
Eq ParamDate Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ParamDate Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

ParamDateTime

ParamDouble

newtype ParamDouble Source #

Constructors

ParamDouble 
Instances
Eq ParamDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ParamDouble Source # 
Instance details

Defined in OpenAPIPetstore.Model

ParamFloat

ParamInteger

ParamMapMapStringText

ParamString

Password

newtype Password Source #

Constructors

Password 

Fields

Instances
Eq Password Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Password Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

Instance details

Defined in OpenAPIPetstore.API.Fake

PatternWithoutDelimiter

PetId

newtype PetId Source #

Constructors

PetId 

Fields

Instances
Eq PetId Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: PetId -> PetId -> Bool #

(/=) :: PetId -> PetId -> Bool #

Show PetId Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> PetId -> ShowS #

show :: PetId -> String #

showList :: [PetId] -> ShowS #

Pipe

newtype Pipe Source #

Constructors

Pipe 

Fields

Instances
Eq Pipe Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Pipe -> Pipe -> Bool #

(/=) :: Pipe -> Pipe -> Bool #

Show Pipe Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Pipe -> ShowS #

show :: Pipe -> String #

showList :: [Pipe] -> ShowS #

Query

newtype Query Source #

Constructors

Query 

Fields

Instances
Eq Query Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Query -> Query -> Bool #

(/=) :: Query -> Query -> Bool #

Show Query Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

RequiredBooleanGroup

RequiredFile

RequiredInt64Group

RequiredStringGroup

Status

newtype Status Source #

Constructors

Status 

Fields

Instances
Eq Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Status -> Status -> Bool #

(/=) :: Status -> Status -> Bool #

Show Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

StatusText

newtype StatusText Source #

Constructors

StatusText 

Fields

Instances
Eq StatusText Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show StatusText Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

Instance details

Defined in OpenAPIPetstore.API.Pet

StringGroup

newtype StringGroup Source #

Constructors

StringGroup 

Fields

Instances
Eq StringGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show StringGroup Source # 
Instance details

Defined in OpenAPIPetstore.Model

HasOptionalParam TestGroupParameters StringGroup Source #

Optional Param "string_group" - String in group parameters

Instance details

Defined in OpenAPIPetstore.API.Fake

Tags

newtype Tags Source #

Constructors

Tags 

Fields

Instances
Eq Tags Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Tags -> Tags -> Bool #

(/=) :: Tags -> Tags -> Bool #

Show Tags Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

Url

newtype Url Source #

Constructors

Url 

Fields

Instances
Eq Url Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Url -> Url -> Bool #

(/=) :: Url -> Url -> Bool #

Show Url Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Url -> ShowS #

show :: Url -> String #

showList :: [Url] -> ShowS #

Username

newtype Username Source #

Constructors

Username 

Fields

Instances
Eq Username Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Username Source # 
Instance details

Defined in OpenAPIPetstore.Model

Models

AdditionalPropertiesAnyType

mkAdditionalPropertiesAnyType :: AdditionalPropertiesAnyType Source #

Construct a value of type AdditionalPropertiesAnyType (by applying it's required fields, if any)

AdditionalPropertiesArray

mkAdditionalPropertiesArray :: AdditionalPropertiesArray Source #

Construct a value of type AdditionalPropertiesArray (by applying it's required fields, if any)

AdditionalPropertiesBoolean

mkAdditionalPropertiesBoolean :: AdditionalPropertiesBoolean Source #

Construct a value of type AdditionalPropertiesBoolean (by applying it's required fields, if any)

AdditionalPropertiesClass

data AdditionalPropertiesClass Source #

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

Construct a value of type AdditionalPropertiesClass (by applying it's required fields, if any)

AdditionalPropertiesInteger

mkAdditionalPropertiesInteger :: AdditionalPropertiesInteger Source #

Construct a value of type AdditionalPropertiesInteger (by applying it's required fields, if any)

AdditionalPropertiesNumber

mkAdditionalPropertiesNumber :: AdditionalPropertiesNumber Source #

Construct a value of type AdditionalPropertiesNumber (by applying it's required fields, if any)

AdditionalPropertiesObject

mkAdditionalPropertiesObject :: AdditionalPropertiesObject Source #

Construct a value of type AdditionalPropertiesObject (by applying it's required fields, if any)

AdditionalPropertiesString

mkAdditionalPropertiesString :: AdditionalPropertiesString Source #

Construct a value of type AdditionalPropertiesString (by applying it's required fields, if any)

Animal

data Animal Source #

Animal

Constructors

Animal 

Fields

Instances
Eq Animal Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Animal -> Animal -> Bool #

(/=) :: Animal -> Animal -> Bool #

Show Animal Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Animal Source #

ToJSON Animal

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Animal -> Value

toEncoding :: Animal -> Encoding

toJSONList :: [Animal] -> Value

toEncodingList :: [Animal] -> Encoding

FromJSON Animal Source #

FromJSON Animal

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Animal

parseJSONList :: Value -> Parser [Animal]

mkAnimal Source #

Arguments

:: Text

animalClassName

-> Animal 

Construct a value of type Animal (by applying it's required fields, if any)

ApiResponse

data ApiResponse Source #

ApiResponse

Constructors

ApiResponse 

Fields

Instances
Eq ApiResponse Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ApiResponse Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ApiResponse Source #

ToJSON ApiResponse

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: ApiResponse -> Value

toEncoding :: ApiResponse -> Encoding

toJSONList :: [ApiResponse] -> Value

toEncodingList :: [ApiResponse] -> Encoding

FromJSON ApiResponse Source #

FromJSON ApiResponse

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ApiResponse

parseJSONList :: Value -> Parser [ApiResponse]

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

ArrayOfArrayOfNumberOnly

mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly Source #

Construct a value of type ArrayOfArrayOfNumberOnly (by applying it's required fields, if any)

ArrayOfNumberOnly

data ArrayOfNumberOnly Source #

ArrayOfNumberOnly

Instances
Eq ArrayOfNumberOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ArrayOfNumberOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ArrayOfNumberOnly Source #

ToJSON ArrayOfNumberOnly

Instance details

Defined in OpenAPIPetstore.Model

FromJSON ArrayOfNumberOnly Source #

FromJSON ArrayOfNumberOnly

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ArrayOfNumberOnly

parseJSONList :: Value -> Parser [ArrayOfNumberOnly]

mkArrayOfNumberOnly :: ArrayOfNumberOnly Source #

Construct a value of type ArrayOfNumberOnly (by applying it's required fields, if any)

ArrayTest

data ArrayTest Source #

ArrayTest

Constructors

ArrayTest 

Fields

Instances
Eq ArrayTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ArrayTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ArrayTest Source #

ToJSON ArrayTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: ArrayTest -> Value

toEncoding :: ArrayTest -> Encoding

toJSONList :: [ArrayTest] -> Value

toEncodingList :: [ArrayTest] -> Encoding

FromJSON ArrayTest Source #

FromJSON ArrayTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ArrayTest

parseJSONList :: Value -> Parser [ArrayTest]

mkArrayTest :: ArrayTest Source #

Construct a value of type ArrayTest (by applying it's required fields, if any)

Capitalization

data Capitalization Source #

Capitalization

Instances
Eq Capitalization Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Capitalization Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Capitalization Source #

ToJSON Capitalization

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Capitalization -> Value

toEncoding :: Capitalization -> Encoding

toJSONList :: [Capitalization] -> Value

toEncodingList :: [Capitalization] -> Encoding

FromJSON Capitalization Source #

FromJSON Capitalization

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Capitalization

parseJSONList :: Value -> Parser [Capitalization]

mkCapitalization :: Capitalization Source #

Construct a value of type Capitalization (by applying it's required fields, if any)

Cat

data Cat Source #

Cat

Constructors

Cat 

Fields

Instances
Eq Cat Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Cat -> Cat -> Bool #

(/=) :: Cat -> Cat -> Bool #

Show Cat Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Cat -> ShowS #

show :: Cat -> String #

showList :: [Cat] -> ShowS #

ToJSON Cat Source #

ToJSON Cat

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Cat -> Value

toEncoding :: Cat -> Encoding

toJSONList :: [Cat] -> Value

toEncodingList :: [Cat] -> Encoding

FromJSON Cat Source #

FromJSON Cat

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Cat

parseJSONList :: Value -> Parser [Cat]

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

Construct a value of type Cat (by applying it's required fields, if any)

CatAllOf

data CatAllOf Source #

CatAllOf

Constructors

CatAllOf 

Fields

Instances
Eq CatAllOf Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show CatAllOf Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON CatAllOf Source #

ToJSON CatAllOf

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: CatAllOf -> Value

toEncoding :: CatAllOf -> Encoding

toJSONList :: [CatAllOf] -> Value

toEncodingList :: [CatAllOf] -> Encoding

FromJSON CatAllOf Source #

FromJSON CatAllOf

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser CatAllOf

parseJSONList :: Value -> Parser [CatAllOf]

mkCatAllOf :: CatAllOf Source #

Construct a value of type CatAllOf (by applying it's required fields, if any)

Category

data Category Source #

Category

Constructors

Category 

Fields

Instances
Eq Category Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Category Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Category Source #

ToJSON Category

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Category -> Value

toEncoding :: Category -> Encoding

toJSONList :: [Category] -> Value

toEncodingList :: [Category] -> Encoding

FromJSON Category Source #

FromJSON Category

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Category

parseJSONList :: Value -> Parser [Category]

mkCategory Source #

Arguments

:: Text

categoryName

-> Category 

Construct a value of type Category (by applying it's required fields, if any)

ClassModel

data ClassModel Source #

ClassModel + Model for testing model with "_class" property

Constructors

ClassModel 

Fields

Instances
Eq ClassModel Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ClassModel Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ClassModel Source #

ToJSON ClassModel

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: ClassModel -> Value

toEncoding :: ClassModel -> Encoding

toJSONList :: [ClassModel] -> Value

toEncodingList :: [ClassModel] -> Encoding

FromJSON ClassModel Source #

FromJSON ClassModel

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ClassModel

parseJSONList :: Value -> Parser [ClassModel]

mkClassModel :: ClassModel Source #

Construct a value of type ClassModel (by applying it's required fields, if any)

Client

data Client Source #

Client

Constructors

Client 

Fields

Instances
Eq Client Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

Show Client Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Client Source #

ToJSON Client

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Client -> Value

toEncoding :: Client -> Encoding

toJSONList :: [Client] -> Value

toEncodingList :: [Client] -> Encoding

FromJSON Client Source #

FromJSON Client

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Client

parseJSONList :: Value -> Parser [Client]

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.FakeClassnameTags123

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam Op123testSpecialTags Client Source #

Body Param "body" - client model

Instance details

Defined in OpenAPIPetstore.API.AnotherFake

Methods

setBodyParam :: (Consumes Op123testSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest Op123testSpecialTags contentType res accept Source #

mkClient :: Client Source #

Construct a value of type Client (by applying it's required fields, if any)

Dog

data Dog Source #

Dog

Constructors

Dog 

Fields

Instances
Eq Dog Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Dog -> Dog -> Bool #

(/=) :: Dog -> Dog -> Bool #

Show Dog Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Dog -> ShowS #

show :: Dog -> String #

showList :: [Dog] -> ShowS #

ToJSON Dog Source #

ToJSON Dog

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Dog -> Value

toEncoding :: Dog -> Encoding

toJSONList :: [Dog] -> Value

toEncodingList :: [Dog] -> Encoding

FromJSON Dog Source #

FromJSON Dog

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Dog

parseJSONList :: Value -> Parser [Dog]

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

Construct a value of type Dog (by applying it's required fields, if any)

DogAllOf

data DogAllOf Source #

DogAllOf

Constructors

DogAllOf 

Fields

Instances
Eq DogAllOf Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show DogAllOf Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON DogAllOf Source #

ToJSON DogAllOf

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: DogAllOf -> Value

toEncoding :: DogAllOf -> Encoding

toJSONList :: [DogAllOf] -> Value

toEncodingList :: [DogAllOf] -> Encoding

FromJSON DogAllOf Source #

FromJSON DogAllOf

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser DogAllOf

parseJSONList :: Value -> Parser [DogAllOf]

mkDogAllOf :: DogAllOf Source #

Construct a value of type DogAllOf (by applying it's required fields, if any)

EnumArrays

data EnumArrays Source #

EnumArrays

Constructors

EnumArrays 

Fields

Instances
Eq EnumArrays Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumArrays Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON EnumArrays Source #

ToJSON EnumArrays

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: EnumArrays -> Value

toEncoding :: EnumArrays -> Encoding

toJSONList :: [EnumArrays] -> Value

toEncodingList :: [EnumArrays] -> Encoding

FromJSON EnumArrays Source #

FromJSON EnumArrays

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser EnumArrays

parseJSONList :: Value -> Parser [EnumArrays]

mkEnumArrays :: EnumArrays Source #

Construct a value of type EnumArrays (by applying it's required fields, if any)

EnumTest

data EnumTest Source #

EnumTest

Constructors

EnumTest 

Fields

Instances
Eq EnumTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON EnumTest Source #

ToJSON EnumTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: EnumTest -> Value

toEncoding :: EnumTest -> Encoding

toJSONList :: [EnumTest] -> Value

toEncodingList :: [EnumTest] -> Encoding

FromJSON EnumTest Source #

FromJSON EnumTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser EnumTest

parseJSONList :: Value -> Parser [EnumTest]

mkEnumTest Source #

Construct a value of type EnumTest (by applying it's required fields, if any)

File

data File Source #

File + Must be named File for test.

Constructors

File 

Fields

Instances
Eq File Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

ToJSON File Source #

ToJSON File

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: File -> Value

toEncoding :: File -> Encoding

toJSONList :: [File] -> Value

toEncodingList :: [File] -> Encoding

FromJSON File Source #

FromJSON File

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser File

parseJSONList :: Value -> Parser [File]

mkFile :: File Source #

Construct a value of type File (by applying it's required fields, if any)

FileSchemaTestClass

data FileSchemaTestClass Source #

FileSchemaTestClass

mkFileSchemaTestClass :: FileSchemaTestClass Source #

Construct a value of type FileSchemaTestClass (by applying it's required fields, if any)

FormatTest

data FormatTest Source #

FormatTest

Constructors

FormatTest 

Fields

Instances
Eq FormatTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show FormatTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON FormatTest Source #

ToJSON FormatTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: FormatTest -> Value

toEncoding :: FormatTest -> Encoding

toJSONList :: [FormatTest] -> Value

toEncodingList :: [FormatTest] -> Encoding

FromJSON FormatTest Source #

FromJSON FormatTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser FormatTest

parseJSONList :: Value -> Parser [FormatTest]

mkFormatTest Source #

Construct a value of type FormatTest (by applying it's required fields, if any)

HasOnlyReadOnly

data HasOnlyReadOnly Source #

HasOnlyReadOnly

Constructors

HasOnlyReadOnly 
Instances
Eq HasOnlyReadOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show HasOnlyReadOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON HasOnlyReadOnly Source #

ToJSON HasOnlyReadOnly

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: HasOnlyReadOnly -> Value

toEncoding :: HasOnlyReadOnly -> Encoding

toJSONList :: [HasOnlyReadOnly] -> Value

toEncodingList :: [HasOnlyReadOnly] -> Encoding

FromJSON HasOnlyReadOnly Source #

FromJSON HasOnlyReadOnly

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser HasOnlyReadOnly

parseJSONList :: Value -> Parser [HasOnlyReadOnly]

mkHasOnlyReadOnly :: HasOnlyReadOnly Source #

Construct a value of type HasOnlyReadOnly (by applying it's required fields, if any)

MapTest

data MapTest Source #

MapTest

Constructors

MapTest 

Fields

Instances
Eq MapTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: MapTest -> MapTest -> Bool #

(/=) :: MapTest -> MapTest -> Bool #

Show MapTest Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON MapTest Source #

ToJSON MapTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: MapTest -> Value

toEncoding :: MapTest -> Encoding

toJSONList :: [MapTest] -> Value

toEncodingList :: [MapTest] -> Encoding

FromJSON MapTest Source #

FromJSON MapTest

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser MapTest

parseJSONList :: Value -> Parser [MapTest]

mkMapTest :: MapTest Source #

Construct a value of type MapTest (by applying it's required fields, if any)

MixedPropertiesAndAdditionalPropertiesClass

data MixedPropertiesAndAdditionalPropertiesClass Source #

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

data Model200Response Source #

Model200Response + Model for testing model name starting with number

Instances
Eq Model200Response Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show Model200Response Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON Model200Response Source #

ToJSON Model200Response

Instance details

Defined in OpenAPIPetstore.Model

FromJSON Model200Response Source #

FromJSON Model200Response

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Model200Response

parseJSONList :: Value -> Parser [Model200Response]

mkModel200Response :: Model200Response Source #

Construct a value of type Model200Response (by applying it's required fields, if any)

ModelList

data ModelList Source #

ModelList

Constructors

ModelList 

Fields

Instances
Eq ModelList Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ModelList Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ModelList Source #

ToJSON ModelList

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: ModelList -> Value

toEncoding :: ModelList -> Encoding

toJSONList :: [ModelList] -> Value

toEncodingList :: [ModelList] -> Encoding

FromJSON ModelList Source #

FromJSON ModelList

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ModelList

parseJSONList :: Value -> Parser [ModelList]

mkModelList :: ModelList Source #

Construct a value of type ModelList (by applying it's required fields, if any)

ModelReturn

data ModelReturn Source #

ModelReturn + Model for testing reserved words

Constructors

ModelReturn 

Fields

Instances
Eq ModelReturn Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ModelReturn Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ModelReturn Source #

ToJSON ModelReturn

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: ModelReturn -> Value

toEncoding :: ModelReturn -> Encoding

toJSONList :: [ModelReturn] -> Value

toEncodingList :: [ModelReturn] -> Encoding

FromJSON ModelReturn Source #

FromJSON ModelReturn

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ModelReturn

parseJSONList :: Value -> Parser [ModelReturn]

mkModelReturn :: ModelReturn Source #

Construct a value of type ModelReturn (by applying it's required fields, if any)

Name

data Name Source #

Name + Model for testing model name same as property name

Constructors

Name 

Fields

Instances
Eq Name Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Show Name Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

ToJSON Name Source #

ToJSON Name

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Name -> Value

toEncoding :: Name -> Encoding

toJSONList :: [Name] -> Value

toEncodingList :: [Name] -> Encoding

FromJSON Name Source #

FromJSON Name

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Name

parseJSONList :: Value -> Parser [Name]

mkName Source #

Arguments

:: Int

nameName

-> Name 

Construct a value of type Name (by applying it's required fields, if any)

NumberOnly

data NumberOnly Source #

NumberOnly

Instances
Eq NumberOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show NumberOnly Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON NumberOnly Source #

ToJSON NumberOnly

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: NumberOnly -> Value

toEncoding :: NumberOnly -> Encoding

toJSONList :: [NumberOnly] -> Value

toEncodingList :: [NumberOnly] -> Encoding

FromJSON NumberOnly Source #

FromJSON NumberOnly

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser NumberOnly

parseJSONList :: Value -> Parser [NumberOnly]

mkNumberOnly :: NumberOnly Source #

Construct a value of type NumberOnly (by applying it's required fields, if any)

Order

data Order Source #

Order

Constructors

Order 

Fields

Instances
Eq Order Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source #

ToJSON Order

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Order -> Value

toEncoding :: Order -> Encoding

toJSONList :: [Order] -> Value

toEncodingList :: [Order] -> Encoding

FromJSON Order Source #

FromJSON Order

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Order

parseJSONList :: Value -> Parser [Order]

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Instance details

Defined in OpenAPIPetstore.API.Store

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

OuterComposite

data OuterComposite Source #

OuterComposite

Constructors

OuterComposite 

Fields

Instances
Eq OuterComposite Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show OuterComposite Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON OuterComposite Source #

ToJSON OuterComposite

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: OuterComposite -> Value

toEncoding :: OuterComposite -> Encoding

toJSONList :: [OuterComposite] -> Value

toEncodingList :: [OuterComposite] -> Encoding

FromJSON OuterComposite Source #

FromJSON OuterComposite

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser OuterComposite

parseJSONList :: Value -> Parser [OuterComposite]

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param "body" - Input composite as post body

Instance details

Defined in OpenAPIPetstore.API.Fake

mkOuterComposite :: OuterComposite Source #

Construct a value of type OuterComposite (by applying it's required fields, if any)

Pet

data Pet Source #

Pet

Constructors

Pet 

Fields

Instances
Eq Pet Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source #

ToJSON Pet

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Pet -> Value

toEncoding :: Pet -> Encoding

toJSONList :: [Pet] -> Value

toEncodingList :: [Pet] -> Encoding

FromJSON Pet Source #

FromJSON Pet

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Pet

parseJSONList :: Value -> Parser [Pet]

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Instance details

Defined in OpenAPIPetstore.API.Pet

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

ReadOnlyFirst

data ReadOnlyFirst Source #

ReadOnlyFirst

Constructors

ReadOnlyFirst 
Instances
Eq ReadOnlyFirst Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show ReadOnlyFirst Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON ReadOnlyFirst Source #

ToJSON ReadOnlyFirst

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: ReadOnlyFirst -> Value

toEncoding :: ReadOnlyFirst -> Encoding

toJSONList :: [ReadOnlyFirst] -> Value

toEncodingList :: [ReadOnlyFirst] -> Encoding

FromJSON ReadOnlyFirst Source #

FromJSON ReadOnlyFirst

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser ReadOnlyFirst

parseJSONList :: Value -> Parser [ReadOnlyFirst]

mkReadOnlyFirst :: ReadOnlyFirst Source #

Construct a value of type ReadOnlyFirst (by applying it's required fields, if any)

SpecialModelName

data SpecialModelName Source #

SpecialModelName

Constructors

SpecialModelName 

Fields

Instances
Eq SpecialModelName Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show SpecialModelName Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON SpecialModelName Source #

ToJSON SpecialModelName

Instance details

Defined in OpenAPIPetstore.Model

FromJSON SpecialModelName Source #

FromJSON SpecialModelName

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser SpecialModelName

parseJSONList :: Value -> Parser [SpecialModelName]

mkSpecialModelName :: SpecialModelName Source #

Construct a value of type SpecialModelName (by applying it's required fields, if any)

Tag

data Tag Source #

Tag

Constructors

Tag 

Fields

Instances
Eq Tag Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Show Tag Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

ToJSON Tag Source #

ToJSON Tag

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: Tag -> Value

toEncoding :: Tag -> Encoding

toJSONList :: [Tag] -> Value

toEncodingList :: [Tag] -> Encoding

FromJSON Tag Source #

FromJSON Tag

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser Tag

parseJSONList :: Value -> Parser [Tag]

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

TypeHolderDefault

data TypeHolderDefault Source #

TypeHolderDefault

Constructors

TypeHolderDefault 

Fields

Instances
Eq TypeHolderDefault Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show TypeHolderDefault Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON TypeHolderDefault Source #

ToJSON TypeHolderDefault

Instance details

Defined in OpenAPIPetstore.Model

FromJSON TypeHolderDefault Source #

FromJSON TypeHolderDefault

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser TypeHolderDefault

parseJSONList :: Value -> Parser [TypeHolderDefault]

TypeHolderExample

data TypeHolderExample Source #

TypeHolderExample

Constructors

TypeHolderExample 

Fields

Instances
Eq TypeHolderExample Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show TypeHolderExample Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON TypeHolderExample Source #

ToJSON TypeHolderExample

Instance details

Defined in OpenAPIPetstore.Model

FromJSON TypeHolderExample Source #

FromJSON TypeHolderExample

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser TypeHolderExample

parseJSONList :: Value -> Parser [TypeHolderExample]

User

data User Source #

User

Constructors

User 

Fields

Instances
Eq User Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source #

ToJSON User

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: User -> Value

toEncoding :: User -> Encoding

toJSONList :: [User] -> Value

toEncodingList :: [User] -> Encoding

FromJSON User Source #

FromJSON User

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser User

parseJSONList :: Value -> Parser [User]

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Instance details

Defined in OpenAPIPetstore.API.User

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam TestBodyWithQueryParams User Source # 
Instance details

Defined in OpenAPIPetstore.API.Fake

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

XmlItem

data XmlItem Source #

XmlItem

Constructors

XmlItem 

Fields

Instances
Eq XmlItem Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: XmlItem -> XmlItem -> Bool #

(/=) :: XmlItem -> XmlItem -> Bool #

Show XmlItem Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON XmlItem Source #

ToJSON XmlItem

Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: XmlItem -> Value

toEncoding :: XmlItem -> Encoding

toJSONList :: [XmlItem] -> Value

toEncodingList :: [XmlItem] -> Encoding

FromJSON XmlItem Source #

FromJSON XmlItem

Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser XmlItem

parseJSONList :: Value -> Parser [XmlItem]

HasBodyParam CreateXmlItem XmlItem Source #

Body Param XmlItem - XmlItem Body

Instance details

Defined in OpenAPIPetstore.API.Fake

Methods

setBodyParam :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => OpenAPIPetstoreRequest CreateXmlItem contentType res accept -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType res accept Source #

mkXmlItem :: XmlItem Source #

Construct a value of type XmlItem (by applying it's required fields, if any)

Enums

E'ArrayEnum

data E'ArrayEnum Source #

Enum of Text

Constructors

E'ArrayEnum'Fish
"fish"
E'ArrayEnum'Crab
"crab"
Instances
Bounded E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'ArrayEnum -> Value

toEncoding :: E'ArrayEnum -> Encoding

toJSONList :: [E'ArrayEnum] -> Value

toEncodingList :: [E'ArrayEnum] -> Encoding

FromJSON E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'ArrayEnum

parseJSONList :: Value -> Parser [E'ArrayEnum]

FromHttpApiData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumFormString

data E'EnumFormString Source #

Enum of Text . + Form parameter enum test (string)

Instances
Bounded E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'EnumFormString

parseJSONList :: Value -> Parser [E'EnumFormString]

FromHttpApiData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormString Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumFormStringArray

data E'EnumFormStringArray Source #

Enum of Text

Instances
Bounded E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'EnumFormStringArray

parseJSONList :: Value -> Parser [E'EnumFormStringArray]

FromHttpApiData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumInteger

data E'EnumInteger Source #

Enum of Int

Instances
Bounded E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'EnumInteger -> Value

toEncoding :: E'EnumInteger -> Encoding

toJSONList :: [E'EnumInteger] -> Value

toEncodingList :: [E'EnumInteger] -> Encoding

FromJSON E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'EnumInteger

parseJSONList :: Value -> Parser [E'EnumInteger]

FromHttpApiData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumNumber

data E'EnumNumber Source #

Enum of Double

Instances
Bounded E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'EnumNumber -> Value

toEncoding :: E'EnumNumber -> Encoding

toJSONList :: [E'EnumNumber] -> Value

toEncodingList :: [E'EnumNumber] -> Encoding

FromJSON E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'EnumNumber

parseJSONList :: Value -> Parser [E'EnumNumber]

FromHttpApiData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumNumber Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumQueryInteger

data E'EnumQueryInteger Source #

Enum of Int

Instances
Bounded E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

FromJSON E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'EnumQueryInteger

parseJSONList :: Value -> Parser [E'EnumQueryInteger]

FromHttpApiData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'EnumString

data E'EnumString Source #

Enum of Text

Instances
Bounded E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'EnumString -> Value

toEncoding :: E'EnumString -> Encoding

toJSONList :: [E'EnumString] -> Value

toEncodingList :: [E'EnumString] -> Encoding

FromJSON E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'EnumString

parseJSONList :: Value -> Parser [E'EnumString]

FromHttpApiData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'EnumString Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'Inner

data E'Inner Source #

Enum of Text

Instances
Bounded E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

(==) :: E'Inner -> E'Inner -> Bool #

(/=) :: E'Inner -> E'Inner -> Bool #

Ord E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'Inner -> Value

toEncoding :: E'Inner -> Encoding

toJSONList :: [E'Inner] -> Value

toEncodingList :: [E'Inner] -> Encoding

FromJSON E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'Inner

parseJSONList :: Value -> Parser [E'Inner]

FromHttpApiData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Inner Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'JustSymbol

data E'JustSymbol Source #

Enum of Text

Instances
Bounded E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'JustSymbol -> Value

toEncoding :: E'JustSymbol -> Encoding

toJSONList :: [E'JustSymbol] -> Value

toEncodingList :: [E'JustSymbol] -> Encoding

FromJSON E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'JustSymbol

parseJSONList :: Value -> Parser [E'JustSymbol]

FromHttpApiData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'JustSymbol Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'Status

data E'Status Source #

Enum of Text . + Order Status

Constructors

E'Status'Placed
"placed"
E'Status'Approved
"approved"
E'Status'Delivered
"delivered"
Instances
Bounded E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'Status -> Value

toEncoding :: E'Status -> Encoding

toJSONList :: [E'Status] -> Value

toEncodingList :: [E'Status] -> Encoding

FromJSON E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'Status

parseJSONList :: Value -> Parser [E'Status]

FromHttpApiData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status Source # 
Instance details

Defined in OpenAPIPetstore.Model

E'Status2

data E'Status2 Source #

Enum of Text . + pet status in the store

Constructors

E'Status2'Available
"available"
E'Status2'Pending
"pending"
E'Status2'Sold
"sold"
Instances
Bounded E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: E'Status2 -> Value

toEncoding :: E'Status2 -> Encoding

toJSONList :: [E'Status2] -> Value

toEncodingList :: [E'Status2] -> Encoding

FromJSON E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser E'Status2

parseJSONList :: Value -> Parser [E'Status2]

FromHttpApiData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData E'Status2 Source # 
Instance details

Defined in OpenAPIPetstore.Model

EnumClass

data EnumClass Source #

Enum of Text

Constructors

EnumClass'_abc
"_abc"
EnumClass'_efg
"-efg"
EnumClass'_xyz
"(xyz)"
Instances
Bounded EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: EnumClass -> Value

toEncoding :: EnumClass -> Encoding

toJSONList :: [EnumClass] -> Value

toEncodingList :: [EnumClass] -> Encoding

FromJSON EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser EnumClass

parseJSONList :: Value -> Parser [EnumClass]

FromHttpApiData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData EnumClass Source # 
Instance details

Defined in OpenAPIPetstore.Model

OuterEnum

data OuterEnum Source #

Enum of Text

Constructors

OuterEnum'Placed
"placed"
OuterEnum'Approved
"approved"
OuterEnum'Delivered
"delivered"
Instances
Bounded OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Enum OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Eq OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Ord OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Show OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToJSON OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

toJSON :: OuterEnum -> Value

toEncoding :: OuterEnum -> Encoding

toJSONList :: [OuterEnum] -> Value

toEncodingList :: [OuterEnum] -> Encoding

FromJSON OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Methods

parseJSON :: Value -> Parser OuterEnum

parseJSONList :: Value -> Parser [OuterEnum]

FromHttpApiData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

ToHttpApiData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

MimeRender MimeMultipartFormData OuterEnum Source # 
Instance details

Defined in OpenAPIPetstore.Model

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-ModelLens.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-ModelLens.html index af27c2fcf6d9..76c85bc8a6c3 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-ModelLens.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-ModelLens.html @@ -1 +1 @@ -OpenAPIPetstore.ModelLens

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.ModelLens

Description

 
Synopsis

AdditionalPropertiesClass

Animal

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Cat

Category

ClassModel

Client

Dog

EnumArrays

EnumClass

EnumTest

File

FileSchemaTestClass

FormatTest

HasOnlyReadOnly

MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

NumberOnly

Order

OuterComposite

OuterEnum

Pet

ReadOnlyFirst

SpecialModelName

Tag

TypeHolderDefault

TypeHolderExample

User

XmlItem

\ No newline at end of file +OpenAPIPetstore.ModelLens

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.ModelLens

Description

 
Synopsis

AdditionalPropertiesAnyType

AdditionalPropertiesArray

AdditionalPropertiesBoolean

AdditionalPropertiesClass

AdditionalPropertiesInteger

AdditionalPropertiesNumber

AdditionalPropertiesObject

AdditionalPropertiesString

Animal

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Cat

CatAllOf

Category

ClassModel

Client

Dog

DogAllOf

EnumArrays

EnumClass

EnumTest

File

FileSchemaTestClass

FormatTest

HasOnlyReadOnly

MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

NumberOnly

Order

OuterComposite

OuterEnum

Pet

ReadOnlyFirst

SpecialModelName

Tag

TypeHolderDefault

TypeHolderExample

User

XmlItem

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-A.html b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html index ab573d0fe095..cb74bb967518 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-A.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - A)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - A

Accept 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
addAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
addFormOpenAPIPetstore.Core, OpenAPIPetstore
AdditionalMetadata 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapOfMapPropertyOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapOfMapPropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapPropertyOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapPropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AddPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
addPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
Animal 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameOpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
animalColorOpenAPIPetstore.Model, OpenAPIPetstore
animalColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AnyAuthMethod 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
ApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ApiResponse 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseMessageOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseMessageLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseTypeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseTypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
applyAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
applyOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayArrayOfModelOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfModelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayOfStringOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AuthApiKeyApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
AuthMethodException 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - A)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - A

Accept 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
addAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
addFormOpenAPIPetstore.Core, OpenAPIPetstore
AdditionalMetadata 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AdditionalPropertiesAnyType 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesAnyTypeNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesAnyTypeNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesArrayNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesArrayNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesBoolean 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesBooleanNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesBooleanNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype1OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype1LOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassAnytype2OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype2LOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassAnytype3OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype3LOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapArrayAnytypeOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapArrayAnytypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapArrayIntegerOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapArrayIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapBooleanOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapIntegerOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapMapAnytypeOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapMapAnytypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapMapStringOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapMapStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapNumberOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapStringOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesIntegerNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesIntegerNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesNumber 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesNumberNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesNumberNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesObject 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesObjectNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesObjectNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesStringNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesStringNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AddPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
addPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
Animal 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameOpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
animalColorOpenAPIPetstore.Model, OpenAPIPetstore
animalColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AnyAuthMethod 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
ApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ApiResponse 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseMessageOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseMessageLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseTypeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseTypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
applyAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
applyOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayArrayOfModelOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfModelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayOfStringOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AuthApiKeyApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
AuthMethodException 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-All.html b/samples/client/petstore/haskell-http-client/docs/doc-index-All.html index a8cc21c733c8..850bdfe1ef91 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-All.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-All.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index

-&-OpenAPIPetstore.Core, OpenAPIPetstore
Accept 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
addAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
addFormOpenAPIPetstore.Core, OpenAPIPetstore
AdditionalMetadata 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapOfMapPropertyOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapOfMapPropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapPropertyOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapPropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AddPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
addPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
Animal 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameOpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
animalColorOpenAPIPetstore.Model, OpenAPIPetstore
animalColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AnyAuthMethod 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
ApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ApiResponse 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseMessageOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseMessageLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseTypeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseTypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
applyAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
applyOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayArrayOfModelOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfModelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayOfStringOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AuthApiKeyApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
AuthMethodException 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Binary 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
Body 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BodyBool 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BodyDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BodyText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BooleanGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Byte 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ByteArray 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
Callback 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Capitalization 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationScaEthFlowPointsOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationScaEthFlowPointsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Cat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
catClassNameOpenAPIPetstore.Model, OpenAPIPetstore
catClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catColorOpenAPIPetstore.Model, OpenAPIPetstore
catColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catDeclawedOpenAPIPetstore.Model, OpenAPIPetstore
catDeclawedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Category 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
categoryIdOpenAPIPetstore.Model, OpenAPIPetstore
categoryIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
categoryNameOpenAPIPetstore.Model, OpenAPIPetstore
categoryNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ClassModel 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
classModelClassOpenAPIPetstore.Model, OpenAPIPetstore
classModelClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Client 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
clientClientOpenAPIPetstore.Model, OpenAPIPetstore
clientClientLOpenAPIPetstore.ModelLens, OpenAPIPetstore
CollectionFormatOpenAPIPetstore.Core, OpenAPIPetstore
CommaSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
configAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
configHostOpenAPIPetstore.Core, OpenAPIPetstore
configLogContextOpenAPIPetstore.Core, OpenAPIPetstore
configLogExecWithContextOpenAPIPetstore.Core, OpenAPIPetstore
configUserAgentOpenAPIPetstore.Core, OpenAPIPetstore
configValidateAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
ConsumesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
ContentType 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
CreateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
createXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
Date 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DateTime 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DeleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
deleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
DeletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
deletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
DeleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
deleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
dispatchInitUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMimeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMime'OpenAPIPetstore.Client, OpenAPIPetstore
Dog 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
dogBreedOpenAPIPetstore.Model, OpenAPIPetstore
dogBreedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogClassNameOpenAPIPetstore.Model, OpenAPIPetstore
dogClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogColorOpenAPIPetstore.Model, OpenAPIPetstore
dogColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
E'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
E'ArrayEnum'CrabOpenAPIPetstore.Model, OpenAPIPetstore
E'ArrayEnum'FishOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormString'_abcOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormString'_efgOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormString'_xyzOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringArray'DollarOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringArray'GreaterThanOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumInteger'Num1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumInteger'NumMinus_1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumNumber'Num1_Dot_1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumNumber'NumMinus_1_Dot_2OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumQueryInteger'Num1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumQueryInteger'NumMinus_2OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumString'EmptyOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumString'LowerOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumString'UPPEROpenAPIPetstore.Model, OpenAPIPetstore
E'InnerOpenAPIPetstore.Model, OpenAPIPetstore
E'Inner'LowerOpenAPIPetstore.Model, OpenAPIPetstore
E'Inner'UPPEROpenAPIPetstore.Model, OpenAPIPetstore
E'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
E'JustSymbol'DollarOpenAPIPetstore.Model, OpenAPIPetstore
E'JustSymbol'Greater_Than_Or_Equal_ToOpenAPIPetstore.Model, OpenAPIPetstore
E'StatusOpenAPIPetstore.Model, OpenAPIPetstore
E'Status'ApprovedOpenAPIPetstore.Model, OpenAPIPetstore
E'Status'DeliveredOpenAPIPetstore.Model, OpenAPIPetstore
E'Status'PlacedOpenAPIPetstore.Model, OpenAPIPetstore
E'Status2OpenAPIPetstore.Model, OpenAPIPetstore
E'Status2'AvailableOpenAPIPetstore.Model, OpenAPIPetstore
E'Status2'PendingOpenAPIPetstore.Model, OpenAPIPetstore
E'Status2'SoldOpenAPIPetstore.Model, OpenAPIPetstore
EnumArrays 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
enumArraysArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
enumArraysArrayEnumLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumArraysJustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
enumArraysJustSymbolLOpenAPIPetstore.ModelLens, OpenAPIPetstore
EnumClassOpenAPIPetstore.Model, OpenAPIPetstore
EnumClass'_abcOpenAPIPetstore.Model, OpenAPIPetstore
EnumClass'_efgOpenAPIPetstore.Model, OpenAPIPetstore
EnumClass'_xyzOpenAPIPetstore.Model, OpenAPIPetstore
EnumFormString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumFormStringArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumHeaderString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumHeaderStringArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryStringArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestEnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestEnumStringOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestEnumStringRequiredOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumStringRequiredLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
enumTestOuterEnumLOpenAPIPetstore.ModelLens, OpenAPIPetstore
FakeOuterBooleanSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterBooleanSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
FakeOuterCompositeSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterCompositeSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
FakeOuterNumberSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterNumberSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
FakeOuterStringSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterStringSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
File 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
File2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
FileSchemaTestClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
fileSchemaTestClassFileOpenAPIPetstore.Model, OpenAPIPetstore
fileSchemaTestClassFileLOpenAPIPetstore.ModelLens, OpenAPIPetstore
fileSchemaTestClassFilesOpenAPIPetstore.Model, OpenAPIPetstore
fileSchemaTestClassFilesLOpenAPIPetstore.ModelLens, OpenAPIPetstore
fileSourceUriOpenAPIPetstore.Model, OpenAPIPetstore
fileSourceUriLOpenAPIPetstore.ModelLens, OpenAPIPetstore
FindPetsByStatusOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
findPetsByStatusOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
FindPetsByTagsOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
findPetsByTagsOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
FormatTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
formatTestBinaryOpenAPIPetstore.Model, OpenAPIPetstore
formatTestBinaryLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestByteOpenAPIPetstore.Model, OpenAPIPetstore
formatTestByteLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestDateOpenAPIPetstore.Model, OpenAPIPetstore
formatTestDateLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
formatTestDateTimeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestDoubleOpenAPIPetstore.Model, OpenAPIPetstore
formatTestDoubleLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestFloatOpenAPIPetstore.Model, OpenAPIPetstore
formatTestFloatLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestInt32OpenAPIPetstore.Model, OpenAPIPetstore
formatTestInt32LOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestInt64OpenAPIPetstore.Model, OpenAPIPetstore
formatTestInt64LOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestIntegerOpenAPIPetstore.Model, OpenAPIPetstore
formatTestIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestNumberOpenAPIPetstore.Model, OpenAPIPetstore
formatTestNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestPasswordOpenAPIPetstore.Model, OpenAPIPetstore
formatTestPasswordLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestStringOpenAPIPetstore.Model, OpenAPIPetstore
formatTestStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestUuidOpenAPIPetstore.Model, OpenAPIPetstore
formatTestUuidLOpenAPIPetstore.ModelLens, OpenAPIPetstore
fromE'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
fromE'InnerOpenAPIPetstore.Model, OpenAPIPetstore
fromE'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
fromE'StatusOpenAPIPetstore.Model, OpenAPIPetstore
fromE'Status2OpenAPIPetstore.Model, OpenAPIPetstore
fromEnumClassOpenAPIPetstore.Model, OpenAPIPetstore
fromOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
GetInventoryOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
getInventoryOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
GetOrderByIdOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
getOrderByIdOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
GetPetByIdOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
getPetByIdOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
GetUserByNameOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
getUserByNameOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
HasBodyParamOpenAPIPetstore.Core, OpenAPIPetstore
HasOnlyReadOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarLOpenAPIPetstore.ModelLens, OpenAPIPetstore
hasOnlyReadOnlyFooOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyFooLOpenAPIPetstore.ModelLens, OpenAPIPetstore
HasOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
infoLevelFilterOpenAPIPetstore.Logging, OpenAPIPetstore
initLogContextOpenAPIPetstore.Logging, OpenAPIPetstore
InitRequest 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
Int32 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64Group 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Lens_OpenAPIPetstore.Core, OpenAPIPetstore
Lens_'OpenAPIPetstore.Core, OpenAPIPetstore
levelDebugOpenAPIPetstore.Logging, OpenAPIPetstore
levelErrorOpenAPIPetstore.Logging, OpenAPIPetstore
levelInfoOpenAPIPetstore.Logging, OpenAPIPetstore
LogContextOpenAPIPetstore.Logging, OpenAPIPetstore
logExceptionsOpenAPIPetstore.Logging, OpenAPIPetstore
LogExecOpenAPIPetstore.Logging, OpenAPIPetstore
LogExecWithContextOpenAPIPetstore.Logging, OpenAPIPetstore
LoginUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
loginUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
LogLevelOpenAPIPetstore.Logging, OpenAPIPetstore
LogoutUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
logoutUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
MapTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestIndirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestIndirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapMapOfStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapMapOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapOfEnumStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapOfEnumStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
MimeAny 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeError 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorOpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeFormUrlEncoded 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeJSON 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeMultipartFormData 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeNoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeOctetStream 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimePlainText 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderDefaultMultipartFormDataOpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeResult 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeResultOpenAPIPetstore.Client, OpenAPIPetstore
mimeResultResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeTextxml 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextxmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextxmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeType'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypes'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXML 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
minLevelFilterOpenAPIPetstore.Logging, OpenAPIPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mkAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkAnimalOpenAPIPetstore.Model, OpenAPIPetstore
mkApiResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayTestOpenAPIPetstore.Model, OpenAPIPetstore
mkCapitalizationOpenAPIPetstore.Model, OpenAPIPetstore
mkCatOpenAPIPetstore.Model, OpenAPIPetstore
mkCategoryOpenAPIPetstore.Model, OpenAPIPetstore
mkClassModelOpenAPIPetstore.Model, OpenAPIPetstore
mkClientOpenAPIPetstore.Model, OpenAPIPetstore
mkDogOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumArraysOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumTestOpenAPIPetstore.Model, OpenAPIPetstore
mkFileOpenAPIPetstore.Model, OpenAPIPetstore
mkFileSchemaTestClassOpenAPIPetstore.Model, OpenAPIPetstore
mkFormatTestOpenAPIPetstore.Model, OpenAPIPetstore
mkHasOnlyReadOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkMapTestOpenAPIPetstore.Model, OpenAPIPetstore
mkMixedPropertiesAndAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkModel200ResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkModelListOpenAPIPetstore.Model, OpenAPIPetstore
mkModelReturnOpenAPIPetstore.Model, OpenAPIPetstore
mkNameOpenAPIPetstore.Model, OpenAPIPetstore
mkNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkOrderOpenAPIPetstore.Model, OpenAPIPetstore
mkOuterCompositeOpenAPIPetstore.Model, OpenAPIPetstore
mkPetOpenAPIPetstore.Model, OpenAPIPetstore
mkReadOnlyFirstOpenAPIPetstore.Model, OpenAPIPetstore
mkSpecialModelNameOpenAPIPetstore.Model, OpenAPIPetstore
mkTagOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderDefaultOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderExampleOpenAPIPetstore.Model, OpenAPIPetstore
mkUserOpenAPIPetstore.Model, OpenAPIPetstore
mkXmlItemOpenAPIPetstore.Model, OpenAPIPetstore
Model200Response 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
model200ResponseNameOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelList 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelList123listOpenAPIPetstore.Model, OpenAPIPetstore
modelList123listLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelReturn 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnOpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnLOpenAPIPetstore.ModelLens, OpenAPIPetstore
modifyInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
modifyInitRequestMOpenAPIPetstore.Client, OpenAPIPetstore
MultiParamArrayOpenAPIPetstore.Core, OpenAPIPetstore
Name 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
name123numberOpenAPIPetstore.Model, OpenAPIPetstore
name123numberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Name2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
nameNameOpenAPIPetstore.Model, OpenAPIPetstore
nameNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
namePropertyOpenAPIPetstore.Model, OpenAPIPetstore
namePropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
nameSnakeCaseOpenAPIPetstore.Model, OpenAPIPetstore
nameSnakeCaseLOpenAPIPetstore.ModelLens, OpenAPIPetstore
newConfigOpenAPIPetstore.Core, OpenAPIPetstore
NoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
nullLoggerOpenAPIPetstore.Logging, OpenAPIPetstore
Number 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
NumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberOpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Op123testSpecialTagsOpenAPIPetstore.API.AnotherFake, OpenAPIPetstore.API, OpenAPIPetstore
op123testSpecialTagsOpenAPIPetstore.API.AnotherFake, OpenAPIPetstore.API, OpenAPIPetstore
OpenAPIPetstoreConfig 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
OpenAPIPetstoreRequest 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
Order 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
orderCompleteOpenAPIPetstore.Model, OpenAPIPetstore
orderCompleteLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OrderId 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
orderIdOpenAPIPetstore.Model, OpenAPIPetstore
orderIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OrderIdText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
orderPetIdOpenAPIPetstore.Model, OpenAPIPetstore
orderPetIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
orderQuantityOpenAPIPetstore.Model, OpenAPIPetstore
orderQuantityLOpenAPIPetstore.ModelLens, OpenAPIPetstore
orderShipDateOpenAPIPetstore.Model, OpenAPIPetstore
orderShipDateLOpenAPIPetstore.ModelLens, OpenAPIPetstore
orderStatusOpenAPIPetstore.Model, OpenAPIPetstore
orderStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OuterComposite 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyBooleanOpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
outerCompositeMyNumberOpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
outerCompositeMyStringOpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
OuterEnum'ApprovedOpenAPIPetstore.Model, OpenAPIPetstore
OuterEnum'DeliveredOpenAPIPetstore.Model, OpenAPIPetstore
OuterEnum'PlacedOpenAPIPetstore.Model, OpenAPIPetstore
Param 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Param2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBinary 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBodyOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBLOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyFormUrlEncodedOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyMultipartFormDataOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyNoneOpenAPIPetstore.Core, OpenAPIPetstore
ParamDate 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDateTime 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamFloat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamMapMapStringText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Params 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyOpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyLOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersLOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryLOpenAPIPetstore.Core, OpenAPIPetstore
ParamString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Password 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
PatternWithoutDelimiter 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Pet 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petCategoryOpenAPIPetstore.Model, OpenAPIPetstore
petCategoryLOpenAPIPetstore.ModelLens, OpenAPIPetstore
PetId 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petIdOpenAPIPetstore.Model, OpenAPIPetstore
petIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petNameOpenAPIPetstore.Model, OpenAPIPetstore
petNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petPhotoUrlsOpenAPIPetstore.Model, OpenAPIPetstore
petPhotoUrlsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petStatusOpenAPIPetstore.Model, OpenAPIPetstore
petStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petTagsOpenAPIPetstore.Model, OpenAPIPetstore
petTagsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
PipeSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
PlaceOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
placeOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
ProducesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
Query 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
rAuthTypesOpenAPIPetstore.Core, OpenAPIPetstore
rAuthTypesLOpenAPIPetstore.Core, OpenAPIPetstore
ReadOnlyFirst 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
readOnlyFirstBarOpenAPIPetstore.Model, OpenAPIPetstore
readOnlyFirstBarLOpenAPIPetstore.ModelLens, OpenAPIPetstore
readOnlyFirstBazOpenAPIPetstore.Model, OpenAPIPetstore
readOnlyFirstBazLOpenAPIPetstore.ModelLens, OpenAPIPetstore
removeHeaderOpenAPIPetstore.Core, OpenAPIPetstore
RequiredBooleanGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
RequiredFile 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
RequiredInt64Group 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
RequiredStringGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
rMethodOpenAPIPetstore.Core, OpenAPIPetstore
rMethodLOpenAPIPetstore.Core, OpenAPIPetstore
rParamsOpenAPIPetstore.Core, OpenAPIPetstore
rParamsLOpenAPIPetstore.Core, OpenAPIPetstore
runConfigLogOpenAPIPetstore.Client, OpenAPIPetstore
runConfigLogWithExceptionsOpenAPIPetstore.Client, OpenAPIPetstore
runDefaultLogExecWithContextOpenAPIPetstore.Logging, OpenAPIPetstore
runNullLogExecOpenAPIPetstore.Logging, OpenAPIPetstore
rUrlPathOpenAPIPetstore.Core, OpenAPIPetstore
rUrlPathLOpenAPIPetstore.Core, OpenAPIPetstore
setBodyParamOpenAPIPetstore.Core, OpenAPIPetstore
setHeaderOpenAPIPetstore.Core, OpenAPIPetstore
setQueryOpenAPIPetstore.Core, OpenAPIPetstore
SpaceSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
SpecialModelName 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
specialModelNameSpecialPropertyNameOpenAPIPetstore.Model, OpenAPIPetstore
specialModelNameSpecialPropertyNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Status 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
StatusText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
stderrLoggingContextOpenAPIPetstore.Logging, OpenAPIPetstore
stderrLoggingExecOpenAPIPetstore.Logging, OpenAPIPetstore
stdoutLoggingContextOpenAPIPetstore.Logging, OpenAPIPetstore
stdoutLoggingExecOpenAPIPetstore.Logging, OpenAPIPetstore
StringGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
TabSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
Tag 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
tagIdOpenAPIPetstore.Model, OpenAPIPetstore
tagIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
tagNameOpenAPIPetstore.Model, OpenAPIPetstore
tagNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Tags 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
TestBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
testClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
TestClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
toE'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'InnerOpenAPIPetstore.Model, OpenAPIPetstore
toE'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
toE'StatusOpenAPIPetstore.Model, OpenAPIPetstore
toE'Status2OpenAPIPetstore.Model, OpenAPIPetstore
toEnumClassOpenAPIPetstore.Model, OpenAPIPetstore
toFormOpenAPIPetstore.Core, OpenAPIPetstore
toFormCollOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderCollOpenAPIPetstore.Core, OpenAPIPetstore
toOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
toPathOpenAPIPetstore.Core, OpenAPIPetstore
toQueryOpenAPIPetstore.Core, OpenAPIPetstore
toQueryCollOpenAPIPetstore.Core, OpenAPIPetstore
TypeHolderDefault 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
TypeHolderExample 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
unAcceptOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unAdditionalMetadataOpenAPIPetstore.Model, OpenAPIPetstore
unApiKeyOpenAPIPetstore.Model, OpenAPIPetstore
unBinaryOpenAPIPetstore.Core, OpenAPIPetstore
unBodyOpenAPIPetstore.Model, OpenAPIPetstore
unBodyBoolOpenAPIPetstore.Model, OpenAPIPetstore
unBodyDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unBodyTextOpenAPIPetstore.Model, OpenAPIPetstore
unBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unByteOpenAPIPetstore.Model, OpenAPIPetstore
unByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
unCallbackOpenAPIPetstore.Model, OpenAPIPetstore
unContentTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unDateOpenAPIPetstore.Core, OpenAPIPetstore
unDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
unEnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unFile2OpenAPIPetstore.Model, OpenAPIPetstore
unInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
unInt32OpenAPIPetstore.Model, OpenAPIPetstore
unInt64OpenAPIPetstore.Model, OpenAPIPetstore
unInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unName2OpenAPIPetstore.Model, OpenAPIPetstore
unNumberOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamOpenAPIPetstore.Model, OpenAPIPetstore
unParam2OpenAPIPetstore.Model, OpenAPIPetstore
unParamBinaryOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
unParamDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unParamFloatOpenAPIPetstore.Model, OpenAPIPetstore
unParamIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unParamMapMapStringTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamStringOpenAPIPetstore.Model, OpenAPIPetstore
unPasswordOpenAPIPetstore.Model, OpenAPIPetstore
unPatternWithoutDelimiterOpenAPIPetstore.Model, OpenAPIPetstore
unPetIdOpenAPIPetstore.Model, OpenAPIPetstore
unQueryOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredFileOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unStatusOpenAPIPetstore.Model, OpenAPIPetstore
unStatusTextOpenAPIPetstore.Model, OpenAPIPetstore
unStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unTagsOpenAPIPetstore.Model, OpenAPIPetstore
unUsernameOpenAPIPetstore.Model, OpenAPIPetstore
UpdatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
updateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
User 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userEmailOpenAPIPetstore.Model, OpenAPIPetstore
userEmailLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userFirstNameOpenAPIPetstore.Model, OpenAPIPetstore
userFirstNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userIdOpenAPIPetstore.Model, OpenAPIPetstore
userIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userLastNameOpenAPIPetstore.Model, OpenAPIPetstore
userLastNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Username 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userPasswordOpenAPIPetstore.Model, OpenAPIPetstore
userPasswordLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userPhoneOpenAPIPetstore.Model, OpenAPIPetstore
userPhoneLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUsernameOpenAPIPetstore.Model, OpenAPIPetstore
userUsernameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUserStatusOpenAPIPetstore.Model, OpenAPIPetstore
userUserStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
withNoLoggingOpenAPIPetstore.Core, OpenAPIPetstore
withStderrLoggingOpenAPIPetstore.Core, OpenAPIPetstore
withStdoutLoggingOpenAPIPetstore.Core, OpenAPIPetstore
XmlItem 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemAttributeIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemAttributeNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemAttributeStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
_addMultiFormPartOpenAPIPetstore.Core, OpenAPIPetstore
_applyAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
_emptyToNothingOpenAPIPetstore.Core, OpenAPIPetstore
_hasAuthTypeOpenAPIPetstore.Core, OpenAPIPetstore
_logOpenAPIPetstore.Logging, OpenAPIPetstore
_memptyToNothingOpenAPIPetstore.Core, OpenAPIPetstore
_mkParamsOpenAPIPetstore.Core, OpenAPIPetstore
_mkRequestOpenAPIPetstore.Core, OpenAPIPetstore
_omitNullsOpenAPIPetstore.Core, OpenAPIPetstore
_parseISO8601OpenAPIPetstore.Core, OpenAPIPetstore
_readBinaryBase64OpenAPIPetstore.Core, OpenAPIPetstore
_readByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
_readDateOpenAPIPetstore.Core, OpenAPIPetstore
_readDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
_setAcceptHeaderOpenAPIPetstore.Core, OpenAPIPetstore
_setBodyBSOpenAPIPetstore.Core, OpenAPIPetstore
_setBodyLBSOpenAPIPetstore.Core, OpenAPIPetstore
_setContentTypeHeaderOpenAPIPetstore.Core, OpenAPIPetstore
_showBinaryBase64OpenAPIPetstore.Core, OpenAPIPetstore
_showByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
_showDateOpenAPIPetstore.Core, OpenAPIPetstore
_showDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
_toCollOpenAPIPetstore.Core, OpenAPIPetstore
_toCollAOpenAPIPetstore.Core, OpenAPIPetstore
_toCollA'OpenAPIPetstore.Core, OpenAPIPetstore
_toFormItemOpenAPIPetstore.Core, OpenAPIPetstore
_toInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index

-&-OpenAPIPetstore.Core, OpenAPIPetstore
Accept 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
addAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
addFormOpenAPIPetstore.Core, OpenAPIPetstore
AdditionalMetadata 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AdditionalPropertiesAnyType 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesAnyTypeNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesAnyTypeNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesArrayNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesArrayNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesBoolean 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesBooleanNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesBooleanNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype1OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype1LOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassAnytype2OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype2LOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassAnytype3OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassAnytype3LOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapArrayAnytypeOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapArrayAnytypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapArrayIntegerOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapArrayIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapBooleanOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapIntegerOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapMapAnytypeOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapMapAnytypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapMapStringOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapMapStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapNumberOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
additionalPropertiesClassMapStringOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesClassMapStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesIntegerNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesIntegerNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesNumber 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesNumberNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesNumberNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesObject 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesObjectNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesObjectNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AdditionalPropertiesString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesStringNameOpenAPIPetstore.Model, OpenAPIPetstore
additionalPropertiesStringNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AddPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
addPetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
Animal 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameOpenAPIPetstore.Model, OpenAPIPetstore
animalClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
animalColorOpenAPIPetstore.Model, OpenAPIPetstore
animalColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AnyAuthMethod 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
ApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ApiResponse 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseCodeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseMessageOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseMessageLOpenAPIPetstore.ModelLens, OpenAPIPetstore
apiResponseTypeOpenAPIPetstore.Model, OpenAPIPetstore
apiResponseTypeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
applyAuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
applyOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayOfNumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberOpenAPIPetstore.Model, OpenAPIPetstore
arrayOfNumberOnlyArrayNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ArrayTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayArrayOfModelOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayArrayOfModelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
arrayTestArrayOfStringOpenAPIPetstore.Model, OpenAPIPetstore
arrayTestArrayOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
AuthApiKeyApiKey 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
AuthMethodOpenAPIPetstore.Core, OpenAPIPetstore
AuthMethodException 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Binary 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
Body 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BodyBool 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BodyDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BodyText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
BooleanGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Byte 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ByteArray 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
Callback 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Capitalization 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationScaEthFlowPointsOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationScaEthFlowPointsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Cat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
CatAllOf 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
catAllOfDeclawedOpenAPIPetstore.Model, OpenAPIPetstore
catAllOfDeclawedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catClassNameOpenAPIPetstore.Model, OpenAPIPetstore
catClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catColorOpenAPIPetstore.Model, OpenAPIPetstore
catColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catDeclawedOpenAPIPetstore.Model, OpenAPIPetstore
catDeclawedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Category 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
categoryIdOpenAPIPetstore.Model, OpenAPIPetstore
categoryIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
categoryNameOpenAPIPetstore.Model, OpenAPIPetstore
categoryNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ClassModel 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
classModelClassOpenAPIPetstore.Model, OpenAPIPetstore
classModelClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Client 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
clientClientOpenAPIPetstore.Model, OpenAPIPetstore
clientClientLOpenAPIPetstore.ModelLens, OpenAPIPetstore
CollectionFormatOpenAPIPetstore.Core, OpenAPIPetstore
CommaSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
configAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
configHostOpenAPIPetstore.Core, OpenAPIPetstore
configLogContextOpenAPIPetstore.Core, OpenAPIPetstore
configLogExecWithContextOpenAPIPetstore.Core, OpenAPIPetstore
configUserAgentOpenAPIPetstore.Core, OpenAPIPetstore
configValidateAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
ConsumesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
ContentType 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
Context 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
CreateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
createXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
Date 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DateTime 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DeleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
deleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
DeletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
deletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
DeleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
deleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
dispatchInitUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMimeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMime'OpenAPIPetstore.Client, OpenAPIPetstore
Dog 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
DogAllOf 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
dogAllOfBreedOpenAPIPetstore.Model, OpenAPIPetstore
dogAllOfBreedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogBreedOpenAPIPetstore.Model, OpenAPIPetstore
dogBreedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogClassNameOpenAPIPetstore.Model, OpenAPIPetstore
dogClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogColorOpenAPIPetstore.Model, OpenAPIPetstore
dogColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
E'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
E'ArrayEnum'CrabOpenAPIPetstore.Model, OpenAPIPetstore
E'ArrayEnum'FishOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormString'_abcOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormString'_efgOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormString'_xyzOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringArray'DollarOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumFormStringArray'GreaterThanOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumInteger'Num1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumInteger'NumMinus_1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumNumber'Num1_Dot_1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumNumber'NumMinus_1_Dot_2OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumQueryInteger'Num1OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumQueryInteger'NumMinus_2OpenAPIPetstore.Model, OpenAPIPetstore
E'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumString'EmptyOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumString'LowerOpenAPIPetstore.Model, OpenAPIPetstore
E'EnumString'UPPEROpenAPIPetstore.Model, OpenAPIPetstore
E'InnerOpenAPIPetstore.Model, OpenAPIPetstore
E'Inner'LowerOpenAPIPetstore.Model, OpenAPIPetstore
E'Inner'UPPEROpenAPIPetstore.Model, OpenAPIPetstore
E'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
E'JustSymbol'DollarOpenAPIPetstore.Model, OpenAPIPetstore
E'JustSymbol'Greater_Than_Or_Equal_ToOpenAPIPetstore.Model, OpenAPIPetstore
E'StatusOpenAPIPetstore.Model, OpenAPIPetstore
E'Status'ApprovedOpenAPIPetstore.Model, OpenAPIPetstore
E'Status'DeliveredOpenAPIPetstore.Model, OpenAPIPetstore
E'Status'PlacedOpenAPIPetstore.Model, OpenAPIPetstore
E'Status2OpenAPIPetstore.Model, OpenAPIPetstore
E'Status2'AvailableOpenAPIPetstore.Model, OpenAPIPetstore
E'Status2'PendingOpenAPIPetstore.Model, OpenAPIPetstore
E'Status2'SoldOpenAPIPetstore.Model, OpenAPIPetstore
EnumArrays 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
enumArraysArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
enumArraysArrayEnumLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumArraysJustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
enumArraysJustSymbolLOpenAPIPetstore.ModelLens, OpenAPIPetstore
EnumClassOpenAPIPetstore.Model, OpenAPIPetstore
EnumClass'_abcOpenAPIPetstore.Model, OpenAPIPetstore
EnumClass'_efgOpenAPIPetstore.Model, OpenAPIPetstore
EnumClass'_xyzOpenAPIPetstore.Model, OpenAPIPetstore
EnumFormString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumFormStringArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumHeaderString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumHeaderStringArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumQueryStringArray 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
EnumTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestEnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestEnumStringOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestEnumStringRequiredOpenAPIPetstore.Model, OpenAPIPetstore
enumTestEnumStringRequiredLOpenAPIPetstore.ModelLens, OpenAPIPetstore
enumTestOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
enumTestOuterEnumLOpenAPIPetstore.ModelLens, OpenAPIPetstore
FakeOuterBooleanSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterBooleanSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
FakeOuterCompositeSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterCompositeSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
FakeOuterNumberSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterNumberSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
FakeOuterStringSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
fakeOuterStringSerializeOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
File 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
File2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
FileSchemaTestClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
fileSchemaTestClassFileOpenAPIPetstore.Model, OpenAPIPetstore
fileSchemaTestClassFileLOpenAPIPetstore.ModelLens, OpenAPIPetstore
fileSchemaTestClassFilesOpenAPIPetstore.Model, OpenAPIPetstore
fileSchemaTestClassFilesLOpenAPIPetstore.ModelLens, OpenAPIPetstore
fileSourceUriOpenAPIPetstore.Model, OpenAPIPetstore
fileSourceUriLOpenAPIPetstore.ModelLens, OpenAPIPetstore
FindPetsByStatusOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
findPetsByStatusOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
FindPetsByTagsOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
findPetsByTagsOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
FormatTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
formatTestBinaryOpenAPIPetstore.Model, OpenAPIPetstore
formatTestBinaryLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestByteOpenAPIPetstore.Model, OpenAPIPetstore
formatTestByteLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestDateOpenAPIPetstore.Model, OpenAPIPetstore
formatTestDateLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
formatTestDateTimeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestDoubleOpenAPIPetstore.Model, OpenAPIPetstore
formatTestDoubleLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestFloatOpenAPIPetstore.Model, OpenAPIPetstore
formatTestFloatLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestInt32OpenAPIPetstore.Model, OpenAPIPetstore
formatTestInt32LOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestInt64OpenAPIPetstore.Model, OpenAPIPetstore
formatTestInt64LOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestIntegerOpenAPIPetstore.Model, OpenAPIPetstore
formatTestIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestNumberOpenAPIPetstore.Model, OpenAPIPetstore
formatTestNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestPasswordOpenAPIPetstore.Model, OpenAPIPetstore
formatTestPasswordLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestStringOpenAPIPetstore.Model, OpenAPIPetstore
formatTestStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
formatTestUuidOpenAPIPetstore.Model, OpenAPIPetstore
formatTestUuidLOpenAPIPetstore.ModelLens, OpenAPIPetstore
fromE'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
fromE'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
fromE'InnerOpenAPIPetstore.Model, OpenAPIPetstore
fromE'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
fromE'StatusOpenAPIPetstore.Model, OpenAPIPetstore
fromE'Status2OpenAPIPetstore.Model, OpenAPIPetstore
fromEnumClassOpenAPIPetstore.Model, OpenAPIPetstore
fromOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
GetInventoryOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
getInventoryOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
GetOrderByIdOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
getOrderByIdOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
GetPetByIdOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
getPetByIdOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
GetUserByNameOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
getUserByNameOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
HasBodyParamOpenAPIPetstore.Core, OpenAPIPetstore
HasOnlyReadOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarLOpenAPIPetstore.ModelLens, OpenAPIPetstore
hasOnlyReadOnlyFooOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyFooLOpenAPIPetstore.ModelLens, OpenAPIPetstore
HasOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
Http 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
initLogContextOpenAPIPetstore.Logging, OpenAPIPetstore
InitRequest 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
Int32 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64Group 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Ioutil 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Lens_OpenAPIPetstore.Core, OpenAPIPetstore
Lens_'OpenAPIPetstore.Core, OpenAPIPetstore
levelDebugOpenAPIPetstore.Logging, OpenAPIPetstore
levelErrorOpenAPIPetstore.Logging, OpenAPIPetstore
levelInfoOpenAPIPetstore.Logging, OpenAPIPetstore
LogContextOpenAPIPetstore.Logging, OpenAPIPetstore
logExceptionsOpenAPIPetstore.Logging, OpenAPIPetstore
LogExecOpenAPIPetstore.Logging, OpenAPIPetstore
LogExecWithContextOpenAPIPetstore.Logging, OpenAPIPetstore
LoginUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
loginUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
LogLevelOpenAPIPetstore.Logging, OpenAPIPetstore
LogoutUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
logoutUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
MapTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestIndirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestIndirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapMapOfStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapMapOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapOfEnumStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapOfEnumStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
MimeAny 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeError 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorOpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeFormUrlEncoded 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeJSON 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeMultipartFormData 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeNoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeOctetStream 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimePlainText 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderDefaultMultipartFormDataOpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeResult 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeResultOpenAPIPetstore.Client, OpenAPIPetstore
mimeResultResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeTextXml 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextXmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextXmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeType'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypes'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXML 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mkAdditionalPropertiesAnyTypeOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesArrayOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesBooleanOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesIntegerOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesNumberOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesObjectOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesStringOpenAPIPetstore.Model, OpenAPIPetstore
mkAnimalOpenAPIPetstore.Model, OpenAPIPetstore
mkApiResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayTestOpenAPIPetstore.Model, OpenAPIPetstore
mkCapitalizationOpenAPIPetstore.Model, OpenAPIPetstore
mkCatOpenAPIPetstore.Model, OpenAPIPetstore
mkCatAllOfOpenAPIPetstore.Model, OpenAPIPetstore
mkCategoryOpenAPIPetstore.Model, OpenAPIPetstore
mkClassModelOpenAPIPetstore.Model, OpenAPIPetstore
mkClientOpenAPIPetstore.Model, OpenAPIPetstore
mkDogOpenAPIPetstore.Model, OpenAPIPetstore
mkDogAllOfOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumArraysOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumTestOpenAPIPetstore.Model, OpenAPIPetstore
mkFileOpenAPIPetstore.Model, OpenAPIPetstore
mkFileSchemaTestClassOpenAPIPetstore.Model, OpenAPIPetstore
mkFormatTestOpenAPIPetstore.Model, OpenAPIPetstore
mkHasOnlyReadOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkMapTestOpenAPIPetstore.Model, OpenAPIPetstore
mkMixedPropertiesAndAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkModel200ResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkModelListOpenAPIPetstore.Model, OpenAPIPetstore
mkModelReturnOpenAPIPetstore.Model, OpenAPIPetstore
mkNameOpenAPIPetstore.Model, OpenAPIPetstore
mkNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkOrderOpenAPIPetstore.Model, OpenAPIPetstore
mkOuterCompositeOpenAPIPetstore.Model, OpenAPIPetstore
mkPetOpenAPIPetstore.Model, OpenAPIPetstore
mkReadOnlyFirstOpenAPIPetstore.Model, OpenAPIPetstore
mkSpecialModelNameOpenAPIPetstore.Model, OpenAPIPetstore
mkTagOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderDefaultOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderExampleOpenAPIPetstore.Model, OpenAPIPetstore
mkUserOpenAPIPetstore.Model, OpenAPIPetstore
mkXmlItemOpenAPIPetstore.Model, OpenAPIPetstore
Model200Response 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
model200ResponseNameOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelList 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelList123listOpenAPIPetstore.Model, OpenAPIPetstore
modelList123listLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelReturn 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnOpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnLOpenAPIPetstore.ModelLens, OpenAPIPetstore
modifyInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
modifyInitRequestMOpenAPIPetstore.Client, OpenAPIPetstore
MultiParamArrayOpenAPIPetstore.Core, OpenAPIPetstore
Name 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
name123numberOpenAPIPetstore.Model, OpenAPIPetstore
name123numberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Name2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
nameNameOpenAPIPetstore.Model, OpenAPIPetstore
nameNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
namePropertyOpenAPIPetstore.Model, OpenAPIPetstore
namePropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
nameSnakeCaseOpenAPIPetstore.Model, OpenAPIPetstore
nameSnakeCaseLOpenAPIPetstore.ModelLens, OpenAPIPetstore
newConfigOpenAPIPetstore.Core, OpenAPIPetstore
NoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
Number 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
NumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberOpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Op123testSpecialTagsOpenAPIPetstore.API.AnotherFake, OpenAPIPetstore.API, OpenAPIPetstore
op123testSpecialTagsOpenAPIPetstore.API.AnotherFake, OpenAPIPetstore.API, OpenAPIPetstore
OpenAPIPetstoreConfig 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
OpenAPIPetstoreRequest 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
Order 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
orderCompleteOpenAPIPetstore.Model, OpenAPIPetstore
orderCompleteLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OrderId 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
orderIdOpenAPIPetstore.Model, OpenAPIPetstore
orderIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OrderIdText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
orderPetIdOpenAPIPetstore.Model, OpenAPIPetstore
orderPetIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
orderQuantityOpenAPIPetstore.Model, OpenAPIPetstore
orderQuantityLOpenAPIPetstore.ModelLens, OpenAPIPetstore
orderShipDateOpenAPIPetstore.Model, OpenAPIPetstore
orderShipDateLOpenAPIPetstore.ModelLens, OpenAPIPetstore
orderStatusOpenAPIPetstore.Model, OpenAPIPetstore
orderStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OuterComposite 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyBooleanOpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
outerCompositeMyNumberOpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
outerCompositeMyStringOpenAPIPetstore.Model, OpenAPIPetstore
outerCompositeMyStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
OuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
OuterEnum'ApprovedOpenAPIPetstore.Model, OpenAPIPetstore
OuterEnum'DeliveredOpenAPIPetstore.Model, OpenAPIPetstore
OuterEnum'PlacedOpenAPIPetstore.Model, OpenAPIPetstore
Param 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Param2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBinary 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBodyOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBLOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyFormUrlEncodedOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyMultipartFormDataOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyNoneOpenAPIPetstore.Core, OpenAPIPetstore
ParamDate 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDateTime 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamFloat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamMapMapStringText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Params 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyOpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyLOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersLOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryLOpenAPIPetstore.Core, OpenAPIPetstore
ParamString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Password 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
PatternWithoutDelimiter 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Pet 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petCategoryOpenAPIPetstore.Model, OpenAPIPetstore
petCategoryLOpenAPIPetstore.ModelLens, OpenAPIPetstore
PetId 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petIdOpenAPIPetstore.Model, OpenAPIPetstore
petIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petNameOpenAPIPetstore.Model, OpenAPIPetstore
petNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petPhotoUrlsOpenAPIPetstore.Model, OpenAPIPetstore
petPhotoUrlsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petStatusOpenAPIPetstore.Model, OpenAPIPetstore
petStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petTagsOpenAPIPetstore.Model, OpenAPIPetstore
petTagsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Pipe 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
PipeSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
PlaceOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
placeOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
ProducesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
Query 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
rAuthTypesOpenAPIPetstore.Core, OpenAPIPetstore
rAuthTypesLOpenAPIPetstore.Core, OpenAPIPetstore
ReadOnlyFirst 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
readOnlyFirstBarOpenAPIPetstore.Model, OpenAPIPetstore
readOnlyFirstBarLOpenAPIPetstore.ModelLens, OpenAPIPetstore
readOnlyFirstBazOpenAPIPetstore.Model, OpenAPIPetstore
readOnlyFirstBazLOpenAPIPetstore.ModelLens, OpenAPIPetstore
removeHeaderOpenAPIPetstore.Core, OpenAPIPetstore
RequiredBooleanGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
RequiredFile 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
RequiredInt64Group 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
RequiredStringGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
rMethodOpenAPIPetstore.Core, OpenAPIPetstore
rMethodLOpenAPIPetstore.Core, OpenAPIPetstore
rParamsOpenAPIPetstore.Core, OpenAPIPetstore
rParamsLOpenAPIPetstore.Core, OpenAPIPetstore
runConfigLogOpenAPIPetstore.Client, OpenAPIPetstore
runConfigLogWithExceptionsOpenAPIPetstore.Client, OpenAPIPetstore
runDefaultLogExecWithContextOpenAPIPetstore.Logging, OpenAPIPetstore
runNullLogExecOpenAPIPetstore.Logging, OpenAPIPetstore
rUrlPathOpenAPIPetstore.Core, OpenAPIPetstore
rUrlPathLOpenAPIPetstore.Core, OpenAPIPetstore
setBodyParamOpenAPIPetstore.Core, OpenAPIPetstore
setHeaderOpenAPIPetstore.Core, OpenAPIPetstore
setQueryOpenAPIPetstore.Core, OpenAPIPetstore
SpaceSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
SpecialModelName 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
specialModelNameSpecialPropertyNameOpenAPIPetstore.Model, OpenAPIPetstore
specialModelNameSpecialPropertyNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Status 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
StatusText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
stderrLoggingContextOpenAPIPetstore.Logging, OpenAPIPetstore
stderrLoggingExecOpenAPIPetstore.Logging, OpenAPIPetstore
stdoutLoggingContextOpenAPIPetstore.Logging, OpenAPIPetstore
stdoutLoggingExecOpenAPIPetstore.Logging, OpenAPIPetstore
StringGroup 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
TabSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
Tag 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
tagIdOpenAPIPetstore.Model, OpenAPIPetstore
tagIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
tagNameOpenAPIPetstore.Model, OpenAPIPetstore
tagNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Tags 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
TestBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
testClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
TestClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestQueryParameterCollectionFormatOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testQueryParameterCollectionFormatOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
toE'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'InnerOpenAPIPetstore.Model, OpenAPIPetstore
toE'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
toE'StatusOpenAPIPetstore.Model, OpenAPIPetstore
toE'Status2OpenAPIPetstore.Model, OpenAPIPetstore
toEnumClassOpenAPIPetstore.Model, OpenAPIPetstore
toFormOpenAPIPetstore.Core, OpenAPIPetstore
toFormCollOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderCollOpenAPIPetstore.Core, OpenAPIPetstore
toOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
toPathOpenAPIPetstore.Core, OpenAPIPetstore
toQueryOpenAPIPetstore.Core, OpenAPIPetstore
toQueryCollOpenAPIPetstore.Core, OpenAPIPetstore
TypeHolderDefault 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
TypeHolderExample 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
unAcceptOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unAdditionalMetadataOpenAPIPetstore.Model, OpenAPIPetstore
unApiKeyOpenAPIPetstore.Model, OpenAPIPetstore
unBinaryOpenAPIPetstore.Core, OpenAPIPetstore
unBodyOpenAPIPetstore.Model, OpenAPIPetstore
unBodyBoolOpenAPIPetstore.Model, OpenAPIPetstore
unBodyDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unBodyTextOpenAPIPetstore.Model, OpenAPIPetstore
unBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unByteOpenAPIPetstore.Model, OpenAPIPetstore
unByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
unCallbackOpenAPIPetstore.Model, OpenAPIPetstore
unContentTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unContextOpenAPIPetstore.Model, OpenAPIPetstore
unDateOpenAPIPetstore.Core, OpenAPIPetstore
unDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
unEnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unFile2OpenAPIPetstore.Model, OpenAPIPetstore
unHttpOpenAPIPetstore.Model, OpenAPIPetstore
unInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
unInt32OpenAPIPetstore.Model, OpenAPIPetstore
unInt64OpenAPIPetstore.Model, OpenAPIPetstore
unInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unIoutilOpenAPIPetstore.Model, OpenAPIPetstore
unName2OpenAPIPetstore.Model, OpenAPIPetstore
unNumberOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamOpenAPIPetstore.Model, OpenAPIPetstore
unParam2OpenAPIPetstore.Model, OpenAPIPetstore
unParamBinaryOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
unParamDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unParamFloatOpenAPIPetstore.Model, OpenAPIPetstore
unParamIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unParamMapMapStringTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamStringOpenAPIPetstore.Model, OpenAPIPetstore
unPasswordOpenAPIPetstore.Model, OpenAPIPetstore
unPatternWithoutDelimiterOpenAPIPetstore.Model, OpenAPIPetstore
unPetIdOpenAPIPetstore.Model, OpenAPIPetstore
unPipeOpenAPIPetstore.Model, OpenAPIPetstore
unQueryOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredFileOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unStatusOpenAPIPetstore.Model, OpenAPIPetstore
unStatusTextOpenAPIPetstore.Model, OpenAPIPetstore
unStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unTagsOpenAPIPetstore.Model, OpenAPIPetstore
unUrlOpenAPIPetstore.Model, OpenAPIPetstore
unUsernameOpenAPIPetstore.Model, OpenAPIPetstore
UpdatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
updateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
Url 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
User 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userEmailOpenAPIPetstore.Model, OpenAPIPetstore
userEmailLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userFirstNameOpenAPIPetstore.Model, OpenAPIPetstore
userFirstNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userIdOpenAPIPetstore.Model, OpenAPIPetstore
userIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userLastNameOpenAPIPetstore.Model, OpenAPIPetstore
userLastNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Username 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userPasswordOpenAPIPetstore.Model, OpenAPIPetstore
userPasswordLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userPhoneOpenAPIPetstore.Model, OpenAPIPetstore
userPhoneLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUsernameOpenAPIPetstore.Model, OpenAPIPetstore
userUsernameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUserStatusOpenAPIPetstore.Model, OpenAPIPetstore
userUserStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
withNoLoggingOpenAPIPetstore.Core, OpenAPIPetstore
withStderrLoggingOpenAPIPetstore.Core, OpenAPIPetstore
withStdoutLoggingOpenAPIPetstore.Core, OpenAPIPetstore
XmlItem 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemAttributeIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemAttributeNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemAttributeStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemAttributeStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNamespaceWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNamespaceWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemNameWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemNameWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsBooleanOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsBooleanLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsIntegerOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsIntegerLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNsWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNsWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixNumberOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixStringOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemPrefixWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemPrefixWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
xmlItemWrappedArrayOpenAPIPetstore.Model, OpenAPIPetstore
xmlItemWrappedArrayLOpenAPIPetstore.ModelLens, OpenAPIPetstore
_addMultiFormPartOpenAPIPetstore.Core, OpenAPIPetstore
_applyAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
_emptyToNothingOpenAPIPetstore.Core, OpenAPIPetstore
_hasAuthTypeOpenAPIPetstore.Core, OpenAPIPetstore
_logOpenAPIPetstore.Logging, OpenAPIPetstore
_memptyToNothingOpenAPIPetstore.Core, OpenAPIPetstore
_mkParamsOpenAPIPetstore.Core, OpenAPIPetstore
_mkRequestOpenAPIPetstore.Core, OpenAPIPetstore
_omitNullsOpenAPIPetstore.Core, OpenAPIPetstore
_parseISO8601OpenAPIPetstore.Core, OpenAPIPetstore
_readBinaryBase64OpenAPIPetstore.Core, OpenAPIPetstore
_readByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
_readDateOpenAPIPetstore.Core, OpenAPIPetstore
_readDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
_setAcceptHeaderOpenAPIPetstore.Core, OpenAPIPetstore
_setBodyBSOpenAPIPetstore.Core, OpenAPIPetstore
_setBodyLBSOpenAPIPetstore.Core, OpenAPIPetstore
_setContentTypeHeaderOpenAPIPetstore.Core, OpenAPIPetstore
_showBinaryBase64OpenAPIPetstore.Core, OpenAPIPetstore
_showByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
_showDateOpenAPIPetstore.Core, OpenAPIPetstore
_showDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
_toCollOpenAPIPetstore.Core, OpenAPIPetstore
_toCollAOpenAPIPetstore.Core, OpenAPIPetstore
_toCollA'OpenAPIPetstore.Core, OpenAPIPetstore
_toFormItemOpenAPIPetstore.Core, OpenAPIPetstore
_toInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-C.html b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html index 95eebad49e86..3d5b2d2c1cde 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-C.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - C)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - C

Callback 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Capitalization 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationScaEthFlowPointsOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationScaEthFlowPointsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Cat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
catClassNameOpenAPIPetstore.Model, OpenAPIPetstore
catClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catColorOpenAPIPetstore.Model, OpenAPIPetstore
catColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catDeclawedOpenAPIPetstore.Model, OpenAPIPetstore
catDeclawedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Category 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
categoryIdOpenAPIPetstore.Model, OpenAPIPetstore
categoryIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
categoryNameOpenAPIPetstore.Model, OpenAPIPetstore
categoryNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ClassModel 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
classModelClassOpenAPIPetstore.Model, OpenAPIPetstore
classModelClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Client 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
clientClientOpenAPIPetstore.Model, OpenAPIPetstore
clientClientLOpenAPIPetstore.ModelLens, OpenAPIPetstore
CollectionFormatOpenAPIPetstore.Core, OpenAPIPetstore
CommaSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
configAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
configHostOpenAPIPetstore.Core, OpenAPIPetstore
configLogContextOpenAPIPetstore.Core, OpenAPIPetstore
configLogExecWithContextOpenAPIPetstore.Core, OpenAPIPetstore
configUserAgentOpenAPIPetstore.Core, OpenAPIPetstore
configValidateAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
ConsumesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
ContentType 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
CreateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
createXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - C)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - C

Callback 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Capitalization 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationAttNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationCapitalSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationCapitalSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationScaEthFlowPointsOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationScaEthFlowPointsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallCamelOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallCamelLOpenAPIPetstore.ModelLens, OpenAPIPetstore
capitalizationSmallSnakeOpenAPIPetstore.Model, OpenAPIPetstore
capitalizationSmallSnakeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Cat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
CatAllOf 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
catAllOfDeclawedOpenAPIPetstore.Model, OpenAPIPetstore
catAllOfDeclawedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catClassNameOpenAPIPetstore.Model, OpenAPIPetstore
catClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catColorOpenAPIPetstore.Model, OpenAPIPetstore
catColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
catDeclawedOpenAPIPetstore.Model, OpenAPIPetstore
catDeclawedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Category 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
categoryIdOpenAPIPetstore.Model, OpenAPIPetstore
categoryIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
categoryNameOpenAPIPetstore.Model, OpenAPIPetstore
categoryNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ClassModel 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
classModelClassOpenAPIPetstore.Model, OpenAPIPetstore
classModelClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Client 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
clientClientOpenAPIPetstore.Model, OpenAPIPetstore
clientClientLOpenAPIPetstore.ModelLens, OpenAPIPetstore
CollectionFormatOpenAPIPetstore.Core, OpenAPIPetstore
CommaSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
configAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
configHostOpenAPIPetstore.Core, OpenAPIPetstore
configLogContextOpenAPIPetstore.Core, OpenAPIPetstore
configLogExecWithContextOpenAPIPetstore.Core, OpenAPIPetstore
configUserAgentOpenAPIPetstore.Core, OpenAPIPetstore
configValidateAuthMethodsOpenAPIPetstore.Core, OpenAPIPetstore
ConsumesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
ContentType 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
Context 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
CreateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithArrayInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
createUsersWithListInputOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
CreateXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
createXmlItemOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-D.html b/samples/client/petstore/haskell-http-client/docs/doc-index-D.html index d184c69aa16e..1d287ef335f9 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-D.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-D.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - D)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - D

Date 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DateTime 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DeleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
deleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
DeletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
deletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
DeleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
deleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
dispatchInitUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMimeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMime'OpenAPIPetstore.Client, OpenAPIPetstore
Dog 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
dogBreedOpenAPIPetstore.Model, OpenAPIPetstore
dogBreedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogClassNameOpenAPIPetstore.Model, OpenAPIPetstore
dogClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogColorOpenAPIPetstore.Model, OpenAPIPetstore
dogColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - D)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - D

Date 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DateTime 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
DeleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
deleteOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
DeletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
deletePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
DeleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
deleteUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
dispatchInitUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsOpenAPIPetstore.Client, OpenAPIPetstore
dispatchLbsUnsafeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMimeOpenAPIPetstore.Client, OpenAPIPetstore
dispatchMime'OpenAPIPetstore.Client, OpenAPIPetstore
Dog 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
DogAllOf 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
dogAllOfBreedOpenAPIPetstore.Model, OpenAPIPetstore
dogAllOfBreedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogBreedOpenAPIPetstore.Model, OpenAPIPetstore
dogBreedLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogClassNameOpenAPIPetstore.Model, OpenAPIPetstore
dogClassNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
dogColorOpenAPIPetstore.Model, OpenAPIPetstore
dogColorLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html index 12ce39fbdc20..6fa0d15171fc 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - H)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - H

HasBodyParamOpenAPIPetstore.Core, OpenAPIPetstore
HasOnlyReadOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarLOpenAPIPetstore.ModelLens, OpenAPIPetstore
hasOnlyReadOnlyFooOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyFooLOpenAPIPetstore.ModelLens, OpenAPIPetstore
HasOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - H)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - H

HasBodyParamOpenAPIPetstore.Core, OpenAPIPetstore
HasOnlyReadOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyBarLOpenAPIPetstore.ModelLens, OpenAPIPetstore
hasOnlyReadOnlyFooOpenAPIPetstore.Model, OpenAPIPetstore
hasOnlyReadOnlyFooLOpenAPIPetstore.ModelLens, OpenAPIPetstore
HasOptionalParamOpenAPIPetstore.Core, OpenAPIPetstore
Http 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-I.html b/samples/client/petstore/haskell-http-client/docs/doc-index-I.html index 0c88a8283dbe..e1195aab5991 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-I.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-I.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - I)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - I

infoLevelFilterOpenAPIPetstore.Logging, OpenAPIPetstore
initLogContextOpenAPIPetstore.Logging, OpenAPIPetstore
InitRequest 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
Int32 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64Group 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - I)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - I

initLogContextOpenAPIPetstore.Logging, OpenAPIPetstore
InitRequest 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
Int32 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Int64Group 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Ioutil 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-M.html b/samples/client/petstore/haskell-http-client/docs/doc-index-M.html index 6a994fe1a5e1..11c1cb91662c 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-M.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-M.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - M)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - M

MapTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestIndirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestIndirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapMapOfStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapMapOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapOfEnumStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapOfEnumStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
MimeAny 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeError 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorOpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeFormUrlEncoded 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeJSON 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeMultipartFormData 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeNoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeOctetStream 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimePlainText 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderDefaultMultipartFormDataOpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeResult 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeResultOpenAPIPetstore.Client, OpenAPIPetstore
mimeResultResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeTextxml 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextxmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextxmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeType'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypes'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXML 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
minLevelFilterOpenAPIPetstore.Logging, OpenAPIPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mkAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkAnimalOpenAPIPetstore.Model, OpenAPIPetstore
mkApiResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayTestOpenAPIPetstore.Model, OpenAPIPetstore
mkCapitalizationOpenAPIPetstore.Model, OpenAPIPetstore
mkCatOpenAPIPetstore.Model, OpenAPIPetstore
mkCategoryOpenAPIPetstore.Model, OpenAPIPetstore
mkClassModelOpenAPIPetstore.Model, OpenAPIPetstore
mkClientOpenAPIPetstore.Model, OpenAPIPetstore
mkDogOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumArraysOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumTestOpenAPIPetstore.Model, OpenAPIPetstore
mkFileOpenAPIPetstore.Model, OpenAPIPetstore
mkFileSchemaTestClassOpenAPIPetstore.Model, OpenAPIPetstore
mkFormatTestOpenAPIPetstore.Model, OpenAPIPetstore
mkHasOnlyReadOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkMapTestOpenAPIPetstore.Model, OpenAPIPetstore
mkMixedPropertiesAndAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkModel200ResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkModelListOpenAPIPetstore.Model, OpenAPIPetstore
mkModelReturnOpenAPIPetstore.Model, OpenAPIPetstore
mkNameOpenAPIPetstore.Model, OpenAPIPetstore
mkNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkOrderOpenAPIPetstore.Model, OpenAPIPetstore
mkOuterCompositeOpenAPIPetstore.Model, OpenAPIPetstore
mkPetOpenAPIPetstore.Model, OpenAPIPetstore
mkReadOnlyFirstOpenAPIPetstore.Model, OpenAPIPetstore
mkSpecialModelNameOpenAPIPetstore.Model, OpenAPIPetstore
mkTagOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderDefaultOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderExampleOpenAPIPetstore.Model, OpenAPIPetstore
mkUserOpenAPIPetstore.Model, OpenAPIPetstore
mkXmlItemOpenAPIPetstore.Model, OpenAPIPetstore
Model200Response 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
model200ResponseNameOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelList 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelList123listOpenAPIPetstore.Model, OpenAPIPetstore
modelList123listLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelReturn 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnOpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnLOpenAPIPetstore.ModelLens, OpenAPIPetstore
modifyInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
modifyInitRequestMOpenAPIPetstore.Client, OpenAPIPetstore
MultiParamArrayOpenAPIPetstore.Core, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - M)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - M

MapTest 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestDirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestIndirectMapOpenAPIPetstore.Model, OpenAPIPetstore
mapTestIndirectMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapMapOfStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapMapOfStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mapTestMapOfEnumStringOpenAPIPetstore.Model, OpenAPIPetstore
mapTestMapOfEnumStringLOpenAPIPetstore.ModelLens, OpenAPIPetstore
MimeAny 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeError 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorOpenAPIPetstore.Client, OpenAPIPetstore
mimeErrorResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeFormUrlEncoded 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeJSON 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeMultipartFormData 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeNoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeOctetStream 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimePlainText 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeRenderDefaultMultipartFormDataOpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeResult 
1 (Type/Class)OpenAPIPetstore.Client, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Client, OpenAPIPetstore
mimeResultOpenAPIPetstore.Client, OpenAPIPetstore
mimeResultResponseOpenAPIPetstore.Client, OpenAPIPetstore
MimeTextXml 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextXmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTextXmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeType'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeTypes'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrenderOpenAPIPetstore.MimeTypes, OpenAPIPetstore
mimeUnrender'OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXML 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf16 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MimeXmlCharsetutf8 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidOpenAPIPetstore.Model, OpenAPIPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLOpenAPIPetstore.ModelLens, OpenAPIPetstore
mkAdditionalPropertiesAnyTypeOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesArrayOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesBooleanOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesIntegerOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesNumberOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesObjectOpenAPIPetstore.Model, OpenAPIPetstore
mkAdditionalPropertiesStringOpenAPIPetstore.Model, OpenAPIPetstore
mkAnimalOpenAPIPetstore.Model, OpenAPIPetstore
mkApiResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayOfNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkArrayTestOpenAPIPetstore.Model, OpenAPIPetstore
mkCapitalizationOpenAPIPetstore.Model, OpenAPIPetstore
mkCatOpenAPIPetstore.Model, OpenAPIPetstore
mkCatAllOfOpenAPIPetstore.Model, OpenAPIPetstore
mkCategoryOpenAPIPetstore.Model, OpenAPIPetstore
mkClassModelOpenAPIPetstore.Model, OpenAPIPetstore
mkClientOpenAPIPetstore.Model, OpenAPIPetstore
mkDogOpenAPIPetstore.Model, OpenAPIPetstore
mkDogAllOfOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumArraysOpenAPIPetstore.Model, OpenAPIPetstore
mkEnumTestOpenAPIPetstore.Model, OpenAPIPetstore
mkFileOpenAPIPetstore.Model, OpenAPIPetstore
mkFileSchemaTestClassOpenAPIPetstore.Model, OpenAPIPetstore
mkFormatTestOpenAPIPetstore.Model, OpenAPIPetstore
mkHasOnlyReadOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkMapTestOpenAPIPetstore.Model, OpenAPIPetstore
mkMixedPropertiesAndAdditionalPropertiesClassOpenAPIPetstore.Model, OpenAPIPetstore
mkModel200ResponseOpenAPIPetstore.Model, OpenAPIPetstore
mkModelListOpenAPIPetstore.Model, OpenAPIPetstore
mkModelReturnOpenAPIPetstore.Model, OpenAPIPetstore
mkNameOpenAPIPetstore.Model, OpenAPIPetstore
mkNumberOnlyOpenAPIPetstore.Model, OpenAPIPetstore
mkOrderOpenAPIPetstore.Model, OpenAPIPetstore
mkOuterCompositeOpenAPIPetstore.Model, OpenAPIPetstore
mkPetOpenAPIPetstore.Model, OpenAPIPetstore
mkReadOnlyFirstOpenAPIPetstore.Model, OpenAPIPetstore
mkSpecialModelNameOpenAPIPetstore.Model, OpenAPIPetstore
mkTagOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderDefaultOpenAPIPetstore.Model, OpenAPIPetstore
mkTypeHolderExampleOpenAPIPetstore.Model, OpenAPIPetstore
mkUserOpenAPIPetstore.Model, OpenAPIPetstore
mkXmlItemOpenAPIPetstore.Model, OpenAPIPetstore
Model200Response 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseClassLOpenAPIPetstore.ModelLens, OpenAPIPetstore
model200ResponseNameOpenAPIPetstore.Model, OpenAPIPetstore
model200ResponseNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelList 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelList123listOpenAPIPetstore.Model, OpenAPIPetstore
modelList123listLOpenAPIPetstore.ModelLens, OpenAPIPetstore
ModelReturn 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnOpenAPIPetstore.Model, OpenAPIPetstore
modelReturnReturnLOpenAPIPetstore.ModelLens, OpenAPIPetstore
modifyInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
modifyInitRequestMOpenAPIPetstore.Client, OpenAPIPetstore
MultiParamArrayOpenAPIPetstore.Core, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-N.html b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html index 4f99dea4d2b0..4b1ecfcede34 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-N.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - N)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - N

Name 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
name123numberOpenAPIPetstore.Model, OpenAPIPetstore
name123numberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Name2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
nameNameOpenAPIPetstore.Model, OpenAPIPetstore
nameNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
namePropertyOpenAPIPetstore.Model, OpenAPIPetstore
namePropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
nameSnakeCaseOpenAPIPetstore.Model, OpenAPIPetstore
nameSnakeCaseLOpenAPIPetstore.ModelLens, OpenAPIPetstore
newConfigOpenAPIPetstore.Core, OpenAPIPetstore
NoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
nullLoggerOpenAPIPetstore.Logging, OpenAPIPetstore
Number 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
NumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberOpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - N)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - N

Name 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
name123numberOpenAPIPetstore.Model, OpenAPIPetstore
name123numberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Name2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
nameNameOpenAPIPetstore.Model, OpenAPIPetstore
nameNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
namePropertyOpenAPIPetstore.Model, OpenAPIPetstore
namePropertyLOpenAPIPetstore.ModelLens, OpenAPIPetstore
nameSnakeCaseOpenAPIPetstore.Model, OpenAPIPetstore
nameSnakeCaseLOpenAPIPetstore.ModelLens, OpenAPIPetstore
newConfigOpenAPIPetstore.Core, OpenAPIPetstore
NoContent 
1 (Type/Class)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.MimeTypes, OpenAPIPetstore
Number 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
NumberOnly 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberOpenAPIPetstore.Model, OpenAPIPetstore
numberOnlyJustNumberLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-P.html b/samples/client/petstore/haskell-http-client/docs/doc-index-P.html index 8bc8ac6896df..6c4999fd6c19 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-P.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-P.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - P)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - P

Param 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Param2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBinary 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBodyOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBLOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyFormUrlEncodedOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyMultipartFormDataOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyNoneOpenAPIPetstore.Core, OpenAPIPetstore
ParamDate 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDateTime 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamFloat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamMapMapStringText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Params 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyOpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyLOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersLOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryLOpenAPIPetstore.Core, OpenAPIPetstore
ParamString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Password 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
PatternWithoutDelimiter 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Pet 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petCategoryOpenAPIPetstore.Model, OpenAPIPetstore
petCategoryLOpenAPIPetstore.ModelLens, OpenAPIPetstore
PetId 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petIdOpenAPIPetstore.Model, OpenAPIPetstore
petIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petNameOpenAPIPetstore.Model, OpenAPIPetstore
petNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petPhotoUrlsOpenAPIPetstore.Model, OpenAPIPetstore
petPhotoUrlsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petStatusOpenAPIPetstore.Model, OpenAPIPetstore
petStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petTagsOpenAPIPetstore.Model, OpenAPIPetstore
petTagsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
PipeSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
PlaceOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
placeOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
ProducesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - P)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - P

Param 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Param2 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBinary 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamBodyOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyBLOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyFormUrlEncodedOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyMultipartFormDataOpenAPIPetstore.Core, OpenAPIPetstore
ParamBodyNoneOpenAPIPetstore.Core, OpenAPIPetstore
ParamDate 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDateTime 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamDouble 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamFloat 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamInteger 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
ParamMapMapStringText 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Params 
1 (Type/Class)OpenAPIPetstore.Core, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyOpenAPIPetstore.Core, OpenAPIPetstore
paramsBodyLOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersOpenAPIPetstore.Core, OpenAPIPetstore
paramsHeadersLOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryOpenAPIPetstore.Core, OpenAPIPetstore
paramsQueryLOpenAPIPetstore.Core, OpenAPIPetstore
ParamString 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Password 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
PatternWithoutDelimiter 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
Pet 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petCategoryOpenAPIPetstore.Model, OpenAPIPetstore
petCategoryLOpenAPIPetstore.ModelLens, OpenAPIPetstore
PetId 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
petIdOpenAPIPetstore.Model, OpenAPIPetstore
petIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petNameOpenAPIPetstore.Model, OpenAPIPetstore
petNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petPhotoUrlsOpenAPIPetstore.Model, OpenAPIPetstore
petPhotoUrlsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petStatusOpenAPIPetstore.Model, OpenAPIPetstore
petStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
petTagsOpenAPIPetstore.Model, OpenAPIPetstore
petTagsLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Pipe 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
PipeSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
PlaceOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
placeOrderOpenAPIPetstore.API.Store, OpenAPIPetstore.API, OpenAPIPetstore
ProducesOpenAPIPetstore.MimeTypes, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-T.html b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html index 30f2af0f117a..c7f75eb8c8e3 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-T.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - T)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - T

TabSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
Tag 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
tagIdOpenAPIPetstore.Model, OpenAPIPetstore
tagIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
tagNameOpenAPIPetstore.Model, OpenAPIPetstore
tagNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Tags 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
TestBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
testClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
TestClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
toE'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'InnerOpenAPIPetstore.Model, OpenAPIPetstore
toE'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
toE'StatusOpenAPIPetstore.Model, OpenAPIPetstore
toE'Status2OpenAPIPetstore.Model, OpenAPIPetstore
toEnumClassOpenAPIPetstore.Model, OpenAPIPetstore
toFormOpenAPIPetstore.Core, OpenAPIPetstore
toFormCollOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderCollOpenAPIPetstore.Core, OpenAPIPetstore
toOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
toPathOpenAPIPetstore.Core, OpenAPIPetstore
toQueryOpenAPIPetstore.Core, OpenAPIPetstore
toQueryCollOpenAPIPetstore.Core, OpenAPIPetstore
TypeHolderDefault 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
TypeHolderExample 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - T)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - T

TabSeparatedOpenAPIPetstore.Core, OpenAPIPetstore
Tag 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
tagIdOpenAPIPetstore.Model, OpenAPIPetstore
tagIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
tagNameOpenAPIPetstore.Model, OpenAPIPetstore
tagNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Tags 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
TestBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithFileSchemaOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testBodyWithQueryParamsOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
testClassnameOpenAPIPetstore.API.FakeClassnameTags123, OpenAPIPetstore.API, OpenAPIPetstore
TestClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testClientModelOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEndpointParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testEnumParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testGroupParametersOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testInlineAdditionalPropertiesOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testJsonFormDataOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
TestQueryParameterCollectionFormatOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
testQueryParameterCollectionFormatOpenAPIPetstore.API.Fake, OpenAPIPetstore.API, OpenAPIPetstore
toE'ArrayEnumOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumNumberOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
toE'EnumStringOpenAPIPetstore.Model, OpenAPIPetstore
toE'InnerOpenAPIPetstore.Model, OpenAPIPetstore
toE'JustSymbolOpenAPIPetstore.Model, OpenAPIPetstore
toE'StatusOpenAPIPetstore.Model, OpenAPIPetstore
toE'Status2OpenAPIPetstore.Model, OpenAPIPetstore
toEnumClassOpenAPIPetstore.Model, OpenAPIPetstore
toFormOpenAPIPetstore.Core, OpenAPIPetstore
toFormCollOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderOpenAPIPetstore.Core, OpenAPIPetstore
toHeaderCollOpenAPIPetstore.Core, OpenAPIPetstore
toOuterEnumOpenAPIPetstore.Model, OpenAPIPetstore
toPathOpenAPIPetstore.Core, OpenAPIPetstore
toQueryOpenAPIPetstore.Core, OpenAPIPetstore
toQueryCollOpenAPIPetstore.Core, OpenAPIPetstore
TypeHolderDefault 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderDefaultStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderDefaultStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
TypeHolderExample 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleArrayItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleBoolItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleBoolItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleIntegerItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleIntegerItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleNumberItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleNumberItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
typeHolderExampleStringItemOpenAPIPetstore.Model, OpenAPIPetstore
typeHolderExampleStringItemLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-U.html b/samples/client/petstore/haskell-http-client/docs/doc-index-U.html index 44668b2795ec..32f6bd773912 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-U.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-U.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - U)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - U

unAcceptOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unAdditionalMetadataOpenAPIPetstore.Model, OpenAPIPetstore
unApiKeyOpenAPIPetstore.Model, OpenAPIPetstore
unBinaryOpenAPIPetstore.Core, OpenAPIPetstore
unBodyOpenAPIPetstore.Model, OpenAPIPetstore
unBodyBoolOpenAPIPetstore.Model, OpenAPIPetstore
unBodyDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unBodyTextOpenAPIPetstore.Model, OpenAPIPetstore
unBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unByteOpenAPIPetstore.Model, OpenAPIPetstore
unByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
unCallbackOpenAPIPetstore.Model, OpenAPIPetstore
unContentTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unDateOpenAPIPetstore.Core, OpenAPIPetstore
unDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
unEnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unFile2OpenAPIPetstore.Model, OpenAPIPetstore
unInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
unInt32OpenAPIPetstore.Model, OpenAPIPetstore
unInt64OpenAPIPetstore.Model, OpenAPIPetstore
unInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unName2OpenAPIPetstore.Model, OpenAPIPetstore
unNumberOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamOpenAPIPetstore.Model, OpenAPIPetstore
unParam2OpenAPIPetstore.Model, OpenAPIPetstore
unParamBinaryOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
unParamDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unParamFloatOpenAPIPetstore.Model, OpenAPIPetstore
unParamIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unParamMapMapStringTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamStringOpenAPIPetstore.Model, OpenAPIPetstore
unPasswordOpenAPIPetstore.Model, OpenAPIPetstore
unPatternWithoutDelimiterOpenAPIPetstore.Model, OpenAPIPetstore
unPetIdOpenAPIPetstore.Model, OpenAPIPetstore
unQueryOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredFileOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unStatusOpenAPIPetstore.Model, OpenAPIPetstore
unStatusTextOpenAPIPetstore.Model, OpenAPIPetstore
unStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unTagsOpenAPIPetstore.Model, OpenAPIPetstore
unUsernameOpenAPIPetstore.Model, OpenAPIPetstore
UpdatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
updateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
User 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userEmailOpenAPIPetstore.Model, OpenAPIPetstore
userEmailLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userFirstNameOpenAPIPetstore.Model, OpenAPIPetstore
userFirstNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userIdOpenAPIPetstore.Model, OpenAPIPetstore
userIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userLastNameOpenAPIPetstore.Model, OpenAPIPetstore
userLastNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Username 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userPasswordOpenAPIPetstore.Model, OpenAPIPetstore
userPasswordLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userPhoneOpenAPIPetstore.Model, OpenAPIPetstore
userPhoneLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUsernameOpenAPIPetstore.Model, OpenAPIPetstore
userUsernameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUserStatusOpenAPIPetstore.Model, OpenAPIPetstore
userUserStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client (Index - U)

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Index - U

unAcceptOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unAdditionalMetadataOpenAPIPetstore.Model, OpenAPIPetstore
unApiKeyOpenAPIPetstore.Model, OpenAPIPetstore
unBinaryOpenAPIPetstore.Core, OpenAPIPetstore
unBodyOpenAPIPetstore.Model, OpenAPIPetstore
unBodyBoolOpenAPIPetstore.Model, OpenAPIPetstore
unBodyDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unBodyTextOpenAPIPetstore.Model, OpenAPIPetstore
unBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unByteOpenAPIPetstore.Model, OpenAPIPetstore
unByteArrayOpenAPIPetstore.Core, OpenAPIPetstore
unCallbackOpenAPIPetstore.Model, OpenAPIPetstore
unContentTypeOpenAPIPetstore.MimeTypes, OpenAPIPetstore
unContextOpenAPIPetstore.Model, OpenAPIPetstore
unDateOpenAPIPetstore.Core, OpenAPIPetstore
unDateTimeOpenAPIPetstore.Core, OpenAPIPetstore
unEnumFormStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumFormStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumHeaderStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringOpenAPIPetstore.Model, OpenAPIPetstore
unEnumQueryStringArrayOpenAPIPetstore.Model, OpenAPIPetstore
unFile2OpenAPIPetstore.Model, OpenAPIPetstore
unHttpOpenAPIPetstore.Model, OpenAPIPetstore
unInitRequestOpenAPIPetstore.Client, OpenAPIPetstore
unInt32OpenAPIPetstore.Model, OpenAPIPetstore
unInt64OpenAPIPetstore.Model, OpenAPIPetstore
unInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unIoutilOpenAPIPetstore.Model, OpenAPIPetstore
unName2OpenAPIPetstore.Model, OpenAPIPetstore
unNumberOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdOpenAPIPetstore.Model, OpenAPIPetstore
unOrderIdTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamOpenAPIPetstore.Model, OpenAPIPetstore
unParam2OpenAPIPetstore.Model, OpenAPIPetstore
unParamBinaryOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateOpenAPIPetstore.Model, OpenAPIPetstore
unParamDateTimeOpenAPIPetstore.Model, OpenAPIPetstore
unParamDoubleOpenAPIPetstore.Model, OpenAPIPetstore
unParamFloatOpenAPIPetstore.Model, OpenAPIPetstore
unParamIntegerOpenAPIPetstore.Model, OpenAPIPetstore
unParamMapMapStringTextOpenAPIPetstore.Model, OpenAPIPetstore
unParamStringOpenAPIPetstore.Model, OpenAPIPetstore
unPasswordOpenAPIPetstore.Model, OpenAPIPetstore
unPatternWithoutDelimiterOpenAPIPetstore.Model, OpenAPIPetstore
unPetIdOpenAPIPetstore.Model, OpenAPIPetstore
unPipeOpenAPIPetstore.Model, OpenAPIPetstore
unQueryOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredBooleanGroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredFileOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredInt64GroupOpenAPIPetstore.Model, OpenAPIPetstore
unRequiredStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unStatusOpenAPIPetstore.Model, OpenAPIPetstore
unStatusTextOpenAPIPetstore.Model, OpenAPIPetstore
unStringGroupOpenAPIPetstore.Model, OpenAPIPetstore
unTagsOpenAPIPetstore.Model, OpenAPIPetstore
unUrlOpenAPIPetstore.Model, OpenAPIPetstore
unUsernameOpenAPIPetstore.Model, OpenAPIPetstore
UpdatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
updatePetWithFormOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UpdateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
updateUserOpenAPIPetstore.API.User, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
UploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
uploadFileWithRequiredFileOpenAPIPetstore.API.Pet, OpenAPIPetstore.API, OpenAPIPetstore
Url 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
User 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userEmailOpenAPIPetstore.Model, OpenAPIPetstore
userEmailLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userFirstNameOpenAPIPetstore.Model, OpenAPIPetstore
userFirstNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userIdOpenAPIPetstore.Model, OpenAPIPetstore
userIdLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userLastNameOpenAPIPetstore.Model, OpenAPIPetstore
userLastNameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
Username 
1 (Type/Class)OpenAPIPetstore.Model, OpenAPIPetstore
2 (Data Constructor)OpenAPIPetstore.Model, OpenAPIPetstore
userPasswordOpenAPIPetstore.Model, OpenAPIPetstore
userPasswordLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userPhoneOpenAPIPetstore.Model, OpenAPIPetstore
userPhoneLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUsernameOpenAPIPetstore.Model, OpenAPIPetstore
userUsernameLOpenAPIPetstore.ModelLens, OpenAPIPetstore
userUserStatusOpenAPIPetstore.Model, OpenAPIPetstore
userUserStatusLOpenAPIPetstore.ModelLens, OpenAPIPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index.json b/samples/client/petstore/haskell-http-client/docs/doc-index.json new file mode 100644 index 000000000000..5c9d017a510f --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/doc-index.json @@ -0,0 +1 @@ +[{"display_html":"type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m","name":"LogExecWithContext","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#t:LogExecWithContext"},{"display_html":"type LogExec m = forall a. KatipT m a -> m a","name":"LogExec","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#t:LogExec"},{"display_html":"type LogContext = LogEnv","name":"LogContext","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#t:LogContext"},{"display_html":"type LogLevel = Severity","name":"LogLevel","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#t:LogLevel"},{"display_html":"initLogContext :: IO LogContext","name":"initLogContext","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:initLogContext"},{"display_html":"runDefaultLogExecWithContext :: LogExecWithContext","name":"runDefaultLogExecWithContext","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:runDefaultLogExecWithContext"},{"display_html":"stdoutLoggingExec :: LogExecWithContext","name":"stdoutLoggingExec","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:stdoutLoggingExec"},{"display_html":"stdoutLoggingContext :: LogContext -> IO LogContext","name":"stdoutLoggingContext","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:stdoutLoggingContext"},{"display_html":"stderrLoggingExec :: LogExecWithContext","name":"stderrLoggingExec","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:stderrLoggingExec"},{"display_html":"stderrLoggingContext :: LogContext -> IO LogContext","name":"stderrLoggingContext","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:stderrLoggingContext"},{"display_html":"runNullLogExec :: LogExecWithContext","name":"runNullLogExec","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:runNullLogExec"},{"display_html":"_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m ()","name":"_log","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:_log"},{"display_html":"logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a","name":"logExceptions","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:logExceptions"},{"display_html":"levelInfo :: LogLevel","name":"levelInfo","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:levelInfo"},{"display_html":"levelError :: LogLevel","name":"levelError","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:levelError"},{"display_html":"levelDebug :: LogLevel","name":"levelDebug","module":"OpenAPIPetstore.Logging","link":"OpenAPIPetstore-Logging.html#v:levelDebug"},{"display_html":"data ContentType a = MimeType a => ContentType {}","name":"ContentType ContentType unContentType","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:ContentType"},{"display_html":"data Accept a = MimeType a => Accept {}","name":"Accept Accept unAccept","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:Accept"},{"display_html":"class MimeType mtype => Consumes req mtype","name":"Consumes","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:Consumes"},{"display_html":"class MimeType mtype => Produces req mtype","name":"Produces","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:Produces"},{"display_html":"data MimeJSON = MimeJSON","name":"MimeJSON MimeJSON","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeJSON"},{"display_html":"data MimeXML = MimeXML","name":"MimeXML MimeXML","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeXML"},{"display_html":"data MimePlainText = MimePlainText","name":"MimePlainText MimePlainText","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimePlainText"},{"display_html":"data MimeFormUrlEncoded = MimeFormUrlEncoded","name":"MimeFormUrlEncoded MimeFormUrlEncoded","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeFormUrlEncoded"},{"display_html":"data MimeMultipartFormData = MimeMultipartFormData","name":"MimeMultipartFormData MimeMultipartFormData","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeMultipartFormData"},{"display_html":"data MimeOctetStream = MimeOctetStream","name":"MimeOctetStream MimeOctetStream","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeOctetStream"},{"display_html":"data MimeNoContent = MimeNoContent","name":"MimeNoContent MimeNoContent","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeNoContent"},{"display_html":"data MimeAny = MimeAny","name":"MimeAny MimeAny","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeAny"},{"display_html":"data NoContent = NoContent","name":"NoContent NoContent","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:NoContent"},{"display_html":"class Typeable mtype => MimeType mtype where","name":"MimeType mimeTypes' mimeType' mimeTypes mimeType","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeType"},{"display_html":"class MimeType mtype => MimeRender mtype x where","name":"MimeRender mimeRender' mimeRender","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeRender"},{"display_html":"mimeRenderDefaultMultipartFormData :: ToHttpApiData a => a -> ByteString","name":"mimeRenderDefaultMultipartFormData","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#v:mimeRenderDefaultMultipartFormData"},{"display_html":"class MimeType mtype => MimeUnrender mtype o where","name":"MimeUnrender mimeUnrender' mimeUnrender","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeUnrender"},{"display_html":"data MimeXmlCharsetutf16 = MimeXmlCharsetutf16","name":"MimeXmlCharsetutf16 MimeXmlCharsetutf16","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeXmlCharsetutf16"},{"display_html":"data MimeXmlCharsetutf8 = MimeXmlCharsetutf8","name":"MimeXmlCharsetutf8 MimeXmlCharsetutf8","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeXmlCharsetutf8"},{"display_html":"data MimeTextXml = MimeTextXml","name":"MimeTextXml MimeTextXml","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeTextXml"},{"display_html":"data MimeTextXmlCharsetutf16 = MimeTextXmlCharsetutf16","name":"MimeTextXmlCharsetutf16 MimeTextXmlCharsetutf16","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeTextXmlCharsetutf16"},{"display_html":"data MimeTextXmlCharsetutf8 = MimeTextXmlCharsetutf8","name":"MimeTextXmlCharsetutf8 MimeTextXmlCharsetutf8","module":"OpenAPIPetstore.MimeTypes","link":"OpenAPIPetstore-MimeTypes.html#t:MimeTextXmlCharsetutf8"},{"display_html":"data OpenAPIPetstoreConfig = OpenAPIPetstoreConfig {}","name":"OpenAPIPetstoreConfig OpenAPIPetstoreConfig configValidateAuthMethods configAuthMethods configLogContext configLogExecWithContext configUserAgent configHost","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:OpenAPIPetstoreConfig"},{"display_html":"newConfig :: IO OpenAPIPetstoreConfig","name":"newConfig","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:newConfig"},{"display_html":"addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig","name":"addAuthMethod","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:addAuthMethod"},{"display_html":"withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig","name":"withStdoutLogging","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:withStdoutLogging"},{"display_html":"withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig","name":"withStderrLogging","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:withStderrLogging"},{"display_html":"withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig","name":"withNoLogging","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:withNoLogging"},{"display_html":"data OpenAPIPetstoreRequest req contentType res accept = OpenAPIPetstoreRequest {}","name":"OpenAPIPetstoreRequest OpenAPIPetstoreRequest rAuthTypes rParams rUrlPath rMethod","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:OpenAPIPetstoreRequest"},{"display_html":"rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Method","name":"rMethodL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:rMethodL"},{"display_html":"rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [ByteString]","name":"rUrlPathL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:rUrlPathL"},{"display_html":"rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params","name":"rParamsL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:rParamsL"},{"display_html":"rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [TypeRep]","name":"rAuthTypesL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:rAuthTypesL"},{"display_html":"class HasBodyParam req param where","name":"HasBodyParam setBodyParam","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:HasBodyParam"},{"display_html":"class HasOptionalParam req param where","name":"HasOptionalParam -&- applyOptionalParam","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:HasOptionalParam"},{"display_html":"data Params = Params {}","name":"Params Params paramsBody paramsHeaders paramsQuery","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:Params"},{"display_html":"paramsQueryL :: Lens_' Params Query","name":"paramsQueryL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:paramsQueryL"},{"display_html":"paramsHeadersL :: Lens_' Params RequestHeaders","name":"paramsHeadersL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:paramsHeadersL"},{"display_html":"paramsBodyL :: Lens_' Params ParamBody","name":"paramsBodyL","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:paramsBodyL"},{"display_html":"data ParamBody","name":"ParamBody ParamBodyMultipartFormData ParamBodyFormUrlEncoded ParamBodyBL ParamBodyB ParamBodyNone","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:ParamBody"},{"display_html":"_mkRequest :: Method -> [ByteString] -> OpenAPIPetstoreRequest req contentType res accept","name":"_mkRequest","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_mkRequest"},{"display_html":"_mkParams :: Params","name":"_mkParams","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_mkParams"},{"display_html":"setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [Header] -> OpenAPIPetstoreRequest req contentType res accept","name":"setHeader","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:setHeader"},{"display_html":"removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [HeaderName] -> OpenAPIPetstoreRequest req contentType res accept","name":"removeHeader","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:removeHeader"},{"display_html":"_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept","name":"_setContentTypeHeader","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_setContentTypeHeader"},{"display_html":"_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept","name":"_setAcceptHeader","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_setAcceptHeader"},{"display_html":"setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept","name":"setQuery","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:setQuery"},{"display_html":"addForm :: OpenAPIPetstoreRequest req contentType res accept -> Form -> OpenAPIPetstoreRequest req contentType res accept","name":"addForm","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:addForm"},{"display_html":"_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> Part -> OpenAPIPetstoreRequest req contentType res accept","name":"_addMultiFormPart","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_addMultiFormPart"},{"display_html":"_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept","name":"_setBodyBS","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_setBodyBS"},{"display_html":"_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept","name":"_setBodyLBS","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_setBodyLBS"},{"display_html":"_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept","name":"_hasAuthType","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_hasAuthType"},{"display_html":"toPath :: ToHttpApiData a => a -> ByteString","name":"toPath","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toPath"},{"display_html":"toHeader :: ToHttpApiData a => (HeaderName, a) -> [Header]","name":"toHeader","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toHeader"},{"display_html":"toForm :: ToHttpApiData v => (ByteString, v) -> Form","name":"toForm","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toForm"},{"display_html":"toQuery :: ToHttpApiData a => (ByteString, Maybe a) -> [QueryItem]","name":"toQuery","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toQuery"},{"display_html":"data CollectionFormat","name":"CollectionFormat MultiParamArray PipeSeparated TabSeparated SpaceSeparated CommaSeparated","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:CollectionFormat"},{"display_html":"toHeaderColl :: ToHttpApiData a => CollectionFormat -> (HeaderName, [a]) -> [Header]","name":"toHeaderColl","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toHeaderColl"},{"display_html":"toFormColl :: ToHttpApiData v => CollectionFormat -> (ByteString, [v]) -> Form","name":"toFormColl","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toFormColl"},{"display_html":"toQueryColl :: ToHttpApiData a => CollectionFormat -> (ByteString, Maybe [a]) -> Query","name":"toQueryColl","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:toQueryColl"},{"display_html":"_toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)]","name":"_toColl","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_toColl"},{"display_html":"_toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)]","name":"_toCollA","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_toCollA"},{"display_html":"_toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)]","name":"_toCollA'","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_toCollA-39-"},{"display_html":"class Typeable a => AuthMethod a where","name":"AuthMethod applyAuthMethod","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:AuthMethod"},{"display_html":"data AnyAuthMethod = AuthMethod a => AnyAuthMethod a","name":"AnyAuthMethod AnyAuthMethod","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:AnyAuthMethod"},{"display_html":"data AuthMethodException = AuthMethodException String","name":"AuthMethodException AuthMethodException","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:AuthMethodException"},{"display_html":"_applyAuthMethods :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig -> IO (OpenAPIPetstoreRequest req contentType res accept)","name":"_applyAuthMethods","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_applyAuthMethods"},{"display_html":"_omitNulls :: [(Text, Value)] -> Value","name":"_omitNulls","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_omitNulls"},{"display_html":"_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])","name":"_toFormItem","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_toFormItem"},{"display_html":"_emptyToNothing :: Maybe String -> Maybe String","name":"_emptyToNothing","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_emptyToNothing"},{"display_html":"_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a","name":"_memptyToNothing","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_memptyToNothing"},{"display_html":"newtype DateTime = DateTime {}","name":"DateTime DateTime unDateTime","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:DateTime"},{"display_html":"_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t","name":"_readDateTime","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_readDateTime"},{"display_html":"_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String","name":"_showDateTime","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_showDateTime"},{"display_html":"_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t","name":"_parseISO8601","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_parseISO8601"},{"display_html":"newtype Date = Date {}","name":"Date Date unDate","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:Date"},{"display_html":"_readDate :: (ParseTime t, Monad m) => String -> m t","name":"_readDate","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_readDate"},{"display_html":"_showDate :: FormatTime t => t -> String","name":"_showDate","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_showDate"},{"display_html":"newtype ByteArray = ByteArray {}","name":"ByteArray ByteArray unByteArray","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:ByteArray"},{"display_html":"_readByteArray :: Monad m => Text -> m ByteArray","name":"_readByteArray","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_readByteArray"},{"display_html":"_showByteArray :: ByteArray -> Text","name":"_showByteArray","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_showByteArray"},{"display_html":"newtype Binary = Binary {}","name":"Binary Binary unBinary","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:Binary"},{"display_html":"_readBinaryBase64 :: Monad m => Text -> m Binary","name":"_readBinaryBase64","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_readBinaryBase64"},{"display_html":"_showBinaryBase64 :: Binary -> Text","name":"_showBinaryBase64","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#v:_showBinaryBase64"},{"display_html":"type Lens_' s a = Lens_ s s a a","name":"Lens_'","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:Lens_-39-"},{"display_html":"type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t","name":"Lens_","module":"OpenAPIPetstore.Core","link":"OpenAPIPetstore-Core.html#t:Lens_"},{"display_html":"dispatchLbs :: (Produces req accept, MimeType contentType) => Manager -> OpenAPIPetstoreConfig -> OpenAPIPetstoreRequest req contentType res accept -> IO (Response ByteString)","name":"dispatchLbs","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:dispatchLbs"},{"display_html":"data MimeResult res = MimeResult {}","name":"MimeResult MimeResult mimeResultResponse mimeResult","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#t:MimeResult"},{"display_html":"data MimeError = MimeError {}","name":"MimeError MimeError mimeErrorResponse mimeError","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#t:MimeError"},{"display_html":"dispatchMime :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) => Manager -> OpenAPIPetstoreConfig -> OpenAPIPetstoreRequest req contentType res accept -> IO (MimeResult res)","name":"dispatchMime","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:dispatchMime"},{"display_html":"dispatchMime' :: (Produces req accept, MimeUnrender accept res, MimeType contentType) => Manager -> OpenAPIPetstoreConfig -> OpenAPIPetstoreRequest req contentType res accept -> IO (Either MimeError res)","name":"dispatchMime'","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:dispatchMime-39-"},{"display_html":"dispatchLbsUnsafe :: (MimeType accept, MimeType contentType) => Manager -> OpenAPIPetstoreConfig -> OpenAPIPetstoreRequest req contentType res accept -> IO (Response ByteString)","name":"dispatchLbsUnsafe","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:dispatchLbsUnsafe"},{"display_html":"dispatchInitUnsafe :: Manager -> OpenAPIPetstoreConfig -> InitRequest req contentType res accept -> IO (Response ByteString)","name":"dispatchInitUnsafe","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:dispatchInitUnsafe"},{"display_html":"newtype InitRequest req contentType res accept = InitRequest {}","name":"InitRequest InitRequest unInitRequest","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#t:InitRequest"},{"display_html":"_toInitRequest :: (MimeType accept, MimeType contentType) => OpenAPIPetstoreConfig -> OpenAPIPetstoreRequest req contentType res accept -> IO (InitRequest req contentType res accept)","name":"_toInitRequest","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:_toInitRequest"},{"display_html":"modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept","name":"modifyInitRequest","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:modifyInitRequest"},{"display_html":"modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept)","name":"modifyInitRequestM","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:modifyInitRequestM"},{"display_html":"runConfigLog :: MonadIO m => OpenAPIPetstoreConfig -> LogExec m","name":"runConfigLog","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:runConfigLog"},{"display_html":"runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> OpenAPIPetstoreConfig -> LogExec m","name":"runConfigLogWithExceptions","module":"OpenAPIPetstore.Client","link":"OpenAPIPetstore-Client.html#v:runConfigLogWithExceptions"},{"display_html":"newtype AdditionalMetadata = AdditionalMetadata {}","name":"AdditionalMetadata AdditionalMetadata unAdditionalMetadata","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalMetadata"},{"display_html":"newtype ApiKey = ApiKey {}","name":"ApiKey ApiKey unApiKey","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ApiKey"},{"display_html":"newtype Body = Body {}","name":"Body Body unBody","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Body"},{"display_html":"newtype BodyBool = BodyBool {}","name":"BodyBool BodyBool unBodyBool","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:BodyBool"},{"display_html":"newtype BodyDouble = BodyDouble {}","name":"BodyDouble BodyDouble unBodyDouble","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:BodyDouble"},{"display_html":"newtype BodyText = BodyText {}","name":"BodyText BodyText unBodyText","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:BodyText"},{"display_html":"newtype BooleanGroup = BooleanGroup {}","name":"BooleanGroup BooleanGroup unBooleanGroup","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:BooleanGroup"},{"display_html":"newtype Byte = Byte {}","name":"Byte Byte unByte","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Byte"},{"display_html":"newtype Callback = Callback {}","name":"Callback Callback unCallback","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Callback"},{"display_html":"newtype Context = Context {}","name":"Context Context unContext","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Context"},{"display_html":"newtype EnumFormString = EnumFormString {}","name":"EnumFormString EnumFormString unEnumFormString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumFormString"},{"display_html":"newtype EnumFormStringArray = EnumFormStringArray {}","name":"EnumFormStringArray EnumFormStringArray unEnumFormStringArray","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumFormStringArray"},{"display_html":"newtype EnumHeaderString = EnumHeaderString {}","name":"EnumHeaderString EnumHeaderString unEnumHeaderString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumHeaderString"},{"display_html":"newtype EnumHeaderStringArray = EnumHeaderStringArray {}","name":"EnumHeaderStringArray EnumHeaderStringArray unEnumHeaderStringArray","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumHeaderStringArray"},{"display_html":"newtype EnumQueryDouble = EnumQueryDouble {}","name":"EnumQueryDouble EnumQueryDouble unEnumQueryDouble","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumQueryDouble"},{"display_html":"newtype EnumQueryInteger = EnumQueryInteger {}","name":"EnumQueryInteger EnumQueryInteger unEnumQueryInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumQueryInteger"},{"display_html":"newtype EnumQueryString = EnumQueryString {}","name":"EnumQueryString EnumQueryString unEnumQueryString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumQueryString"},{"display_html":"newtype EnumQueryStringArray = EnumQueryStringArray {}","name":"EnumQueryStringArray EnumQueryStringArray unEnumQueryStringArray","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumQueryStringArray"},{"display_html":"newtype File2 = File2 {}","name":"File2 File2 unFile2","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:File2"},{"display_html":"newtype Http = Http {}","name":"Http Http unHttp","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Http"},{"display_html":"newtype Int32 = Int32 {}","name":"Int32 Int32 unInt32","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Int32"},{"display_html":"newtype Int64 = Int64 {}","name":"Int64 Int64 unInt64","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Int64"},{"display_html":"newtype Int64Group = Int64Group {}","name":"Int64Group Int64Group unInt64Group","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Int64Group"},{"display_html":"newtype Ioutil = Ioutil {}","name":"Ioutil Ioutil unIoutil","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Ioutil"},{"display_html":"newtype Name2 = Name2 {}","name":"Name2 Name2 unName2","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Name2"},{"display_html":"newtype Number = Number {}","name":"Number Number unNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Number"},{"display_html":"newtype OrderId = OrderId {}","name":"OrderId OrderId unOrderId","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:OrderId"},{"display_html":"newtype OrderIdText = OrderIdText {}","name":"OrderIdText OrderIdText unOrderIdText","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:OrderIdText"},{"display_html":"newtype Param = Param {}","name":"Param Param unParam","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Param"},{"display_html":"newtype Param2 = Param2 {}","name":"Param2 Param2 unParam2","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Param2"},{"display_html":"newtype ParamBinary = ParamBinary {}","name":"ParamBinary ParamBinary unParamBinary","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamBinary"},{"display_html":"newtype ParamDate = ParamDate {}","name":"ParamDate ParamDate unParamDate","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamDate"},{"display_html":"newtype ParamDateTime = ParamDateTime {}","name":"ParamDateTime ParamDateTime unParamDateTime","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamDateTime"},{"display_html":"newtype ParamDouble = ParamDouble {}","name":"ParamDouble ParamDouble unParamDouble","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamDouble"},{"display_html":"newtype ParamFloat = ParamFloat {}","name":"ParamFloat ParamFloat unParamFloat","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamFloat"},{"display_html":"newtype ParamInteger = ParamInteger {}","name":"ParamInteger ParamInteger unParamInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamInteger"},{"display_html":"newtype ParamMapMapStringText = ParamMapMapStringText {}","name":"ParamMapMapStringText ParamMapMapStringText unParamMapMapStringText","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamMapMapStringText"},{"display_html":"newtype ParamString = ParamString {}","name":"ParamString ParamString unParamString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ParamString"},{"display_html":"newtype Password = Password {}","name":"Password Password unPassword","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Password"},{"display_html":"newtype PatternWithoutDelimiter = PatternWithoutDelimiter {}","name":"PatternWithoutDelimiter PatternWithoutDelimiter unPatternWithoutDelimiter","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:PatternWithoutDelimiter"},{"display_html":"newtype PetId = PetId {}","name":"PetId PetId unPetId","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:PetId"},{"display_html":"newtype Pipe = Pipe {}","name":"Pipe Pipe unPipe","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Pipe"},{"display_html":"newtype Query = Query {}","name":"Query Query unQuery","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Query"},{"display_html":"newtype RequiredBooleanGroup = RequiredBooleanGroup {}","name":"RequiredBooleanGroup RequiredBooleanGroup unRequiredBooleanGroup","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:RequiredBooleanGroup"},{"display_html":"newtype RequiredFile = RequiredFile {}","name":"RequiredFile RequiredFile unRequiredFile","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:RequiredFile"},{"display_html":"newtype RequiredInt64Group = RequiredInt64Group {}","name":"RequiredInt64Group RequiredInt64Group unRequiredInt64Group","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:RequiredInt64Group"},{"display_html":"newtype RequiredStringGroup = RequiredStringGroup {}","name":"RequiredStringGroup RequiredStringGroup unRequiredStringGroup","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:RequiredStringGroup"},{"display_html":"newtype Status = Status {}","name":"Status Status unStatus","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Status"},{"display_html":"newtype StatusText = StatusText {}","name":"StatusText StatusText unStatusText","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:StatusText"},{"display_html":"newtype StringGroup = StringGroup {}","name":"StringGroup StringGroup unStringGroup","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:StringGroup"},{"display_html":"newtype Tags = Tags {}","name":"Tags Tags unTags","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Tags"},{"display_html":"newtype Url = Url {}","name":"Url Url unUrl","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Url"},{"display_html":"newtype Username = Username {}","name":"Username Username unUsername","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Username"},{"display_html":"data AdditionalPropertiesAnyType = AdditionalPropertiesAnyType {}","name":"AdditionalPropertiesAnyType AdditionalPropertiesAnyType additionalPropertiesAnyTypeName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesAnyType"},{"display_html":"mkAdditionalPropertiesAnyType :: AdditionalPropertiesAnyType","name":"mkAdditionalPropertiesAnyType","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesAnyType"},{"display_html":"data AdditionalPropertiesArray = AdditionalPropertiesArray {}","name":"AdditionalPropertiesArray AdditionalPropertiesArray additionalPropertiesArrayName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesArray"},{"display_html":"mkAdditionalPropertiesArray :: AdditionalPropertiesArray","name":"mkAdditionalPropertiesArray","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesArray"},{"display_html":"data AdditionalPropertiesBoolean = AdditionalPropertiesBoolean {}","name":"AdditionalPropertiesBoolean AdditionalPropertiesBoolean additionalPropertiesBooleanName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesBoolean"},{"display_html":"mkAdditionalPropertiesBoolean :: AdditionalPropertiesBoolean","name":"mkAdditionalPropertiesBoolean","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesBoolean"},{"display_html":"data AdditionalPropertiesClass = AdditionalPropertiesClass {}","name":"AdditionalPropertiesClass AdditionalPropertiesClass additionalPropertiesClassAnytype3 additionalPropertiesClassAnytype2 additionalPropertiesClassAnytype1 additionalPropertiesClassMapMapAnytype additionalPropertiesClassMapMapString additionalPropertiesClassMapArrayAnytype additionalPropertiesClassMapArrayInteger additionalPropertiesClassMapBoolean additionalPropertiesClassMapInteger additionalPropertiesClassMapNumber additionalPropertiesClassMapString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesClass"},{"display_html":"mkAdditionalPropertiesClass :: AdditionalPropertiesClass","name":"mkAdditionalPropertiesClass","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesClass"},{"display_html":"data AdditionalPropertiesInteger = AdditionalPropertiesInteger {}","name":"AdditionalPropertiesInteger AdditionalPropertiesInteger additionalPropertiesIntegerName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesInteger"},{"display_html":"mkAdditionalPropertiesInteger :: AdditionalPropertiesInteger","name":"mkAdditionalPropertiesInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesInteger"},{"display_html":"data AdditionalPropertiesNumber = AdditionalPropertiesNumber {}","name":"AdditionalPropertiesNumber AdditionalPropertiesNumber additionalPropertiesNumberName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesNumber"},{"display_html":"mkAdditionalPropertiesNumber :: AdditionalPropertiesNumber","name":"mkAdditionalPropertiesNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesNumber"},{"display_html":"data AdditionalPropertiesObject = AdditionalPropertiesObject {}","name":"AdditionalPropertiesObject AdditionalPropertiesObject additionalPropertiesObjectName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesObject"},{"display_html":"mkAdditionalPropertiesObject :: AdditionalPropertiesObject","name":"mkAdditionalPropertiesObject","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesObject"},{"display_html":"data AdditionalPropertiesString = AdditionalPropertiesString {}","name":"AdditionalPropertiesString AdditionalPropertiesString additionalPropertiesStringName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AdditionalPropertiesString"},{"display_html":"mkAdditionalPropertiesString :: AdditionalPropertiesString","name":"mkAdditionalPropertiesString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAdditionalPropertiesString"},{"display_html":"data Animal = Animal {}","name":"Animal Animal animalColor animalClassName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Animal"},{"display_html":"mkAnimal :: Text -> Animal","name":"mkAnimal","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkAnimal"},{"display_html":"data ApiResponse = ApiResponse {}","name":"ApiResponse ApiResponse apiResponseMessage apiResponseType apiResponseCode","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ApiResponse"},{"display_html":"mkApiResponse :: ApiResponse","name":"mkApiResponse","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkApiResponse"},{"display_html":"data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly {}","name":"ArrayOfArrayOfNumberOnly ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnlyArrayArrayNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ArrayOfArrayOfNumberOnly"},{"display_html":"mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly","name":"mkArrayOfArrayOfNumberOnly","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkArrayOfArrayOfNumberOnly"},{"display_html":"data ArrayOfNumberOnly = ArrayOfNumberOnly {}","name":"ArrayOfNumberOnly ArrayOfNumberOnly arrayOfNumberOnlyArrayNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ArrayOfNumberOnly"},{"display_html":"mkArrayOfNumberOnly :: ArrayOfNumberOnly","name":"mkArrayOfNumberOnly","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkArrayOfNumberOnly"},{"display_html":"data ArrayTest = ArrayTest {}","name":"ArrayTest ArrayTest arrayTestArrayArrayOfModel arrayTestArrayArrayOfInteger arrayTestArrayOfString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ArrayTest"},{"display_html":"mkArrayTest :: ArrayTest","name":"mkArrayTest","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkArrayTest"},{"display_html":"data Capitalization = Capitalization {}","name":"Capitalization Capitalization capitalizationAttName capitalizationScaEthFlowPoints capitalizationCapitalSnake capitalizationSmallSnake capitalizationCapitalCamel capitalizationSmallCamel","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Capitalization"},{"display_html":"mkCapitalization :: Capitalization","name":"mkCapitalization","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkCapitalization"},{"display_html":"data Cat = Cat {}","name":"Cat Cat catDeclawed catColor catClassName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Cat"},{"display_html":"mkCat :: Text -> Cat","name":"mkCat","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkCat"},{"display_html":"data CatAllOf = CatAllOf {}","name":"CatAllOf CatAllOf catAllOfDeclawed","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:CatAllOf"},{"display_html":"mkCatAllOf :: CatAllOf","name":"mkCatAllOf","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkCatAllOf"},{"display_html":"data Category = Category {}","name":"Category Category categoryName categoryId","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Category"},{"display_html":"mkCategory :: Text -> Category","name":"mkCategory","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkCategory"},{"display_html":"data ClassModel = ClassModel {}","name":"ClassModel ClassModel classModelClass","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ClassModel"},{"display_html":"mkClassModel :: ClassModel","name":"mkClassModel","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkClassModel"},{"display_html":"data Client = Client {}","name":"Client Client clientClient","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Client"},{"display_html":"mkClient :: Client","name":"mkClient","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkClient"},{"display_html":"data Dog = Dog {}","name":"Dog Dog dogBreed dogColor dogClassName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Dog"},{"display_html":"mkDog :: Text -> Dog","name":"mkDog","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkDog"},{"display_html":"data DogAllOf = DogAllOf {}","name":"DogAllOf DogAllOf dogAllOfBreed","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:DogAllOf"},{"display_html":"mkDogAllOf :: DogAllOf","name":"mkDogAllOf","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkDogAllOf"},{"display_html":"data EnumArrays = EnumArrays {}","name":"EnumArrays EnumArrays enumArraysArrayEnum enumArraysJustSymbol","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumArrays"},{"display_html":"mkEnumArrays :: EnumArrays","name":"mkEnumArrays","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkEnumArrays"},{"display_html":"data EnumTest = EnumTest {}","name":"EnumTest EnumTest enumTestOuterEnum enumTestEnumNumber enumTestEnumInteger enumTestEnumStringRequired enumTestEnumString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumTest"},{"display_html":"mkEnumTest :: E'EnumString -> EnumTest","name":"mkEnumTest","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkEnumTest"},{"display_html":"data File = File {}","name":"File File fileSourceUri","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:File"},{"display_html":"mkFile :: File","name":"mkFile","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkFile"},{"display_html":"data FileSchemaTestClass = FileSchemaTestClass {}","name":"FileSchemaTestClass FileSchemaTestClass fileSchemaTestClassFiles fileSchemaTestClassFile","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:FileSchemaTestClass"},{"display_html":"mkFileSchemaTestClass :: FileSchemaTestClass","name":"mkFileSchemaTestClass","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkFileSchemaTestClass"},{"display_html":"data FormatTest = FormatTest {}","name":"FormatTest FormatTest formatTestPassword formatTestUuid formatTestDateTime formatTestDate formatTestBinary formatTestByte formatTestString formatTestDouble formatTestFloat formatTestNumber formatTestInt64 formatTestInt32 formatTestInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:FormatTest"},{"display_html":"mkFormatTest :: Double -> ByteArray -> Date -> Text -> FormatTest","name":"mkFormatTest","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkFormatTest"},{"display_html":"data HasOnlyReadOnly = HasOnlyReadOnly {}","name":"HasOnlyReadOnly HasOnlyReadOnly hasOnlyReadOnlyFoo hasOnlyReadOnlyBar","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:HasOnlyReadOnly"},{"display_html":"mkHasOnlyReadOnly :: HasOnlyReadOnly","name":"mkHasOnlyReadOnly","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkHasOnlyReadOnly"},{"display_html":"data MapTest = MapTest {}","name":"MapTest MapTest mapTestIndirectMap mapTestDirectMap mapTestMapOfEnumString mapTestMapMapOfString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:MapTest"},{"display_html":"mkMapTest :: MapTest","name":"mkMapTest","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkMapTest"},{"display_html":"data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass {}","name":"MixedPropertiesAndAdditionalPropertiesClass MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClassMap mixedPropertiesAndAdditionalPropertiesClassDateTime mixedPropertiesAndAdditionalPropertiesClassUuid","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:MixedPropertiesAndAdditionalPropertiesClass"},{"display_html":"mkMixedPropertiesAndAdditionalPropertiesClass :: MixedPropertiesAndAdditionalPropertiesClass","name":"mkMixedPropertiesAndAdditionalPropertiesClass","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkMixedPropertiesAndAdditionalPropertiesClass"},{"display_html":"data Model200Response = Model200Response {}","name":"Model200Response Model200Response model200ResponseClass model200ResponseName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Model200Response"},{"display_html":"mkModel200Response :: Model200Response","name":"mkModel200Response","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkModel200Response"},{"display_html":"data ModelList = ModelList {}","name":"ModelList ModelList modelList123list","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ModelList"},{"display_html":"mkModelList :: ModelList","name":"mkModelList","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkModelList"},{"display_html":"data ModelReturn = ModelReturn {}","name":"ModelReturn ModelReturn modelReturnReturn","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ModelReturn"},{"display_html":"mkModelReturn :: ModelReturn","name":"mkModelReturn","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkModelReturn"},{"display_html":"data Name = Name {}","name":"Name Name name123number nameProperty nameSnakeCase nameName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Name"},{"display_html":"mkName :: Int -> Name","name":"mkName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkName"},{"display_html":"data NumberOnly = NumberOnly {}","name":"NumberOnly NumberOnly numberOnlyJustNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:NumberOnly"},{"display_html":"mkNumberOnly :: NumberOnly","name":"mkNumberOnly","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkNumberOnly"},{"display_html":"data Order = Order {}","name":"Order Order orderComplete orderStatus orderShipDate orderQuantity orderPetId orderId","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Order"},{"display_html":"mkOrder :: Order","name":"mkOrder","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkOrder"},{"display_html":"data OuterComposite = OuterComposite {}","name":"OuterComposite OuterComposite outerCompositeMyBoolean outerCompositeMyString outerCompositeMyNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:OuterComposite"},{"display_html":"mkOuterComposite :: OuterComposite","name":"mkOuterComposite","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkOuterComposite"},{"display_html":"data Pet = Pet {}","name":"Pet Pet petStatus petTags petPhotoUrls petName petCategory petId","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Pet"},{"display_html":"mkPet :: Text -> [Text] -> Pet","name":"mkPet","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkPet"},{"display_html":"data ReadOnlyFirst = ReadOnlyFirst {}","name":"ReadOnlyFirst ReadOnlyFirst readOnlyFirstBaz readOnlyFirstBar","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:ReadOnlyFirst"},{"display_html":"mkReadOnlyFirst :: ReadOnlyFirst","name":"mkReadOnlyFirst","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkReadOnlyFirst"},{"display_html":"data SpecialModelName = SpecialModelName {}","name":"SpecialModelName SpecialModelName specialModelNameSpecialPropertyName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:SpecialModelName"},{"display_html":"mkSpecialModelName :: SpecialModelName","name":"mkSpecialModelName","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkSpecialModelName"},{"display_html":"data Tag = Tag {}","name":"Tag Tag tagName tagId","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:Tag"},{"display_html":"mkTag :: Tag","name":"mkTag","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkTag"},{"display_html":"data TypeHolderDefault = TypeHolderDefault {}","name":"TypeHolderDefault TypeHolderDefault typeHolderDefaultArrayItem typeHolderDefaultBoolItem typeHolderDefaultIntegerItem typeHolderDefaultNumberItem typeHolderDefaultStringItem","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:TypeHolderDefault"},{"display_html":"mkTypeHolderDefault :: Text -> Double -> Int -> Bool -> [Int] -> TypeHolderDefault","name":"mkTypeHolderDefault","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkTypeHolderDefault"},{"display_html":"data TypeHolderExample = TypeHolderExample {}","name":"TypeHolderExample TypeHolderExample typeHolderExampleArrayItem typeHolderExampleBoolItem typeHolderExampleIntegerItem typeHolderExampleNumberItem typeHolderExampleStringItem","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:TypeHolderExample"},{"display_html":"mkTypeHolderExample :: Text -> Double -> Int -> Bool -> [Int] -> TypeHolderExample","name":"mkTypeHolderExample","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkTypeHolderExample"},{"display_html":"data User = User {}","name":"User User userUserStatus userPhone userEmail userLastName userFirstName userUsername userId userPassword","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:User"},{"display_html":"mkUser :: User","name":"mkUser","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkUser"},{"display_html":"data XmlItem = XmlItem {}","name":"XmlItem XmlItem xmlItemPrefixNsWrappedArray xmlItemPrefixNsArray xmlItemPrefixNsBoolean xmlItemPrefixNsInteger xmlItemPrefixNsNumber xmlItemPrefixNsString xmlItemNamespaceWrappedArray xmlItemNamespaceArray xmlItemNamespaceBoolean xmlItemNamespaceInteger xmlItemNamespaceNumber xmlItemNamespaceString xmlItemPrefixWrappedArray xmlItemPrefixArray xmlItemPrefixBoolean xmlItemPrefixInteger xmlItemPrefixNumber xmlItemPrefixString xmlItemNameWrappedArray xmlItemNameArray xmlItemNameBoolean xmlItemNameInteger xmlItemNameNumber xmlItemNameString xmlItemWrappedArray xmlItemAttributeBoolean xmlItemAttributeInteger xmlItemAttributeNumber xmlItemAttributeString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:XmlItem"},{"display_html":"mkXmlItem :: XmlItem","name":"mkXmlItem","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:mkXmlItem"},{"display_html":"data E'ArrayEnum","name":"E'ArrayEnum E'ArrayEnum'Crab E'ArrayEnum'Fish","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-ArrayEnum"},{"display_html":"fromE'ArrayEnum :: E'ArrayEnum -> Text","name":"fromE'ArrayEnum","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-ArrayEnum"},{"display_html":"toE'ArrayEnum :: Text -> Either String E'ArrayEnum","name":"toE'ArrayEnum","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-ArrayEnum"},{"display_html":"data E'EnumFormString","name":"E'EnumFormString E'EnumFormString'_xyz E'EnumFormString'_efg E'EnumFormString'_abc","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-EnumFormString"},{"display_html":"fromE'EnumFormString :: E'EnumFormString -> Text","name":"fromE'EnumFormString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-EnumFormString"},{"display_html":"toE'EnumFormString :: Text -> Either String E'EnumFormString","name":"toE'EnumFormString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-EnumFormString"},{"display_html":"data E'EnumFormStringArray","name":"E'EnumFormStringArray E'EnumFormStringArray'Dollar E'EnumFormStringArray'GreaterThan","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-EnumFormStringArray"},{"display_html":"fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text","name":"fromE'EnumFormStringArray","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-EnumFormStringArray"},{"display_html":"toE'EnumFormStringArray :: Text -> Either String E'EnumFormStringArray","name":"toE'EnumFormStringArray","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-EnumFormStringArray"},{"display_html":"data E'EnumInteger","name":"E'EnumInteger E'EnumInteger'NumMinus_1 E'EnumInteger'Num1","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-EnumInteger"},{"display_html":"fromE'EnumInteger :: E'EnumInteger -> Int","name":"fromE'EnumInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-EnumInteger"},{"display_html":"toE'EnumInteger :: Int -> Either String E'EnumInteger","name":"toE'EnumInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-EnumInteger"},{"display_html":"data E'EnumNumber","name":"E'EnumNumber E'EnumNumber'NumMinus_1_Dot_2 E'EnumNumber'Num1_Dot_1","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-EnumNumber"},{"display_html":"fromE'EnumNumber :: E'EnumNumber -> Double","name":"fromE'EnumNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-EnumNumber"},{"display_html":"toE'EnumNumber :: Double -> Either String E'EnumNumber","name":"toE'EnumNumber","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-EnumNumber"},{"display_html":"data E'EnumQueryInteger","name":"E'EnumQueryInteger E'EnumQueryInteger'NumMinus_2 E'EnumQueryInteger'Num1","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-EnumQueryInteger"},{"display_html":"fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int","name":"fromE'EnumQueryInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-EnumQueryInteger"},{"display_html":"toE'EnumQueryInteger :: Int -> Either String E'EnumQueryInteger","name":"toE'EnumQueryInteger","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-EnumQueryInteger"},{"display_html":"data E'EnumString","name":"E'EnumString E'EnumString'Empty E'EnumString'Lower E'EnumString'UPPER","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-EnumString"},{"display_html":"fromE'EnumString :: E'EnumString -> Text","name":"fromE'EnumString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-EnumString"},{"display_html":"toE'EnumString :: Text -> Either String E'EnumString","name":"toE'EnumString","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-EnumString"},{"display_html":"data E'Inner","name":"E'Inner E'Inner'Lower E'Inner'UPPER","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-Inner"},{"display_html":"fromE'Inner :: E'Inner -> Text","name":"fromE'Inner","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-Inner"},{"display_html":"toE'Inner :: Text -> Either String E'Inner","name":"toE'Inner","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-Inner"},{"display_html":"data E'JustSymbol","name":"E'JustSymbol E'JustSymbol'Dollar E'JustSymbol'Greater_Than_Or_Equal_To","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-JustSymbol"},{"display_html":"fromE'JustSymbol :: E'JustSymbol -> Text","name":"fromE'JustSymbol","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-JustSymbol"},{"display_html":"toE'JustSymbol :: Text -> Either String E'JustSymbol","name":"toE'JustSymbol","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-JustSymbol"},{"display_html":"data E'Status","name":"E'Status E'Status'Delivered E'Status'Approved E'Status'Placed","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-Status"},{"display_html":"fromE'Status :: E'Status -> Text","name":"fromE'Status","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-Status"},{"display_html":"toE'Status :: Text -> Either String E'Status","name":"toE'Status","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-Status"},{"display_html":"data E'Status2","name":"E'Status2 E'Status2'Sold E'Status2'Pending E'Status2'Available","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:E-39-Status2"},{"display_html":"fromE'Status2 :: E'Status2 -> Text","name":"fromE'Status2","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromE-39-Status2"},{"display_html":"toE'Status2 :: Text -> Either String E'Status2","name":"toE'Status2","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toE-39-Status2"},{"display_html":"data EnumClass","name":"EnumClass EnumClass'_xyz EnumClass'_efg EnumClass'_abc","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:EnumClass"},{"display_html":"fromEnumClass :: EnumClass -> Text","name":"fromEnumClass","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromEnumClass"},{"display_html":"toEnumClass :: Text -> Either String EnumClass","name":"toEnumClass","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toEnumClass"},{"display_html":"data OuterEnum","name":"OuterEnum OuterEnum'Delivered OuterEnum'Approved OuterEnum'Placed","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:OuterEnum"},{"display_html":"fromOuterEnum :: OuterEnum -> Text","name":"fromOuterEnum","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:fromOuterEnum"},{"display_html":"toOuterEnum :: Text -> Either String OuterEnum","name":"toOuterEnum","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#v:toOuterEnum"},{"display_html":"data AuthApiKeyApiKey = AuthApiKeyApiKey Text","name":"AuthApiKeyApiKey AuthApiKeyApiKey","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AuthApiKeyApiKey"},{"display_html":"data AuthApiKeyApiKeyQuery = AuthApiKeyApiKeyQuery Text","name":"AuthApiKeyApiKeyQuery AuthApiKeyApiKeyQuery","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AuthApiKeyApiKeyQuery"},{"display_html":"data AuthBasicHttpBasicTest = AuthBasicHttpBasicTest ByteString ByteString","name":"AuthBasicHttpBasicTest AuthBasicHttpBasicTest","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AuthBasicHttpBasicTest"},{"display_html":"data AuthOAuthPetstoreAuth = AuthOAuthPetstoreAuth Text","name":"AuthOAuthPetstoreAuth AuthOAuthPetstoreAuth","module":"OpenAPIPetstore.Model","link":"OpenAPIPetstore-Model.html#t:AuthOAuthPetstoreAuth"},{"display_html":"createUser :: (Consumes CreateUser contentType, MimeRender contentType User) => ContentType contentType -> User -> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent","name":"createUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:createUser"},{"display_html":"data CreateUser","name":"CreateUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:CreateUser"},{"display_html":"createUsersWithArrayInput :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) => ContentType contentType -> Body -> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent","name":"createUsersWithArrayInput","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:createUsersWithArrayInput"},{"display_html":"data CreateUsersWithArrayInput","name":"CreateUsersWithArrayInput","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:CreateUsersWithArrayInput"},{"display_html":"createUsersWithListInput :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) => ContentType contentType -> Body -> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent","name":"createUsersWithListInput","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:createUsersWithListInput"},{"display_html":"data CreateUsersWithListInput","name":"CreateUsersWithListInput","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:CreateUsersWithListInput"},{"display_html":"deleteUser :: Username -> OpenAPIPetstoreRequest DeleteUser MimeNoContent NoContent MimeNoContent","name":"deleteUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:deleteUser"},{"display_html":"data DeleteUser","name":"DeleteUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:DeleteUser"},{"display_html":"getUserByName :: Accept accept -> Username -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept","name":"getUserByName","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:getUserByName"},{"display_html":"data GetUserByName","name":"GetUserByName","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:GetUserByName"},{"display_html":"loginUser :: Accept accept -> Username -> Password -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept","name":"loginUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:loginUser"},{"display_html":"data LoginUser","name":"LoginUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:LoginUser"},{"display_html":"logoutUser :: OpenAPIPetstoreRequest LogoutUser MimeNoContent NoContent MimeNoContent","name":"logoutUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:logoutUser"},{"display_html":"data LogoutUser","name":"LogoutUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:LogoutUser"},{"display_html":"updateUser :: (Consumes UpdateUser contentType, MimeRender contentType User) => ContentType contentType -> User -> Username -> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent","name":"updateUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#v:updateUser"},{"display_html":"data UpdateUser","name":"UpdateUser","module":"OpenAPIPetstore.API.User","link":"OpenAPIPetstore-API-User.html#t:UpdateUser"},{"display_html":"deleteOrder :: OrderIdText -> OpenAPIPetstoreRequest DeleteOrder MimeNoContent NoContent MimeNoContent","name":"deleteOrder","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#v:deleteOrder"},{"display_html":"data DeleteOrder","name":"DeleteOrder","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#t:DeleteOrder"},{"display_html":"getInventory :: OpenAPIPetstoreRequest GetInventory MimeNoContent (Map String Int) MimeJSON","name":"getInventory","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#v:getInventory"},{"display_html":"data GetInventory","name":"GetInventory","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#t:GetInventory"},{"display_html":"getOrderById :: Accept accept -> OrderId -> OpenAPIPetstoreRequest GetOrderById MimeNoContent Order accept","name":"getOrderById","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#v:getOrderById"},{"display_html":"data GetOrderById","name":"GetOrderById","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#t:GetOrderById"},{"display_html":"placeOrder :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => ContentType contentType -> Accept accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType Order accept","name":"placeOrder","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#v:placeOrder"},{"display_html":"data PlaceOrder","name":"PlaceOrder","module":"OpenAPIPetstore.API.Store","link":"OpenAPIPetstore-API-Store.html#t:PlaceOrder"},{"display_html":"addPet :: (Consumes AddPet contentType, MimeRender contentType Pet) => ContentType contentType -> Pet -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent","name":"addPet","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:addPet"},{"display_html":"data AddPet","name":"AddPet","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:AddPet"},{"display_html":"deletePet :: PetId -> OpenAPIPetstoreRequest DeletePet MimeNoContent NoContent MimeNoContent","name":"deletePet","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:deletePet"},{"display_html":"data DeletePet","name":"DeletePet","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:DeletePet"},{"display_html":"findPetsByStatus :: Accept accept -> Status -> OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept","name":"findPetsByStatus","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:findPetsByStatus"},{"display_html":"data FindPetsByStatus","name":"FindPetsByStatus","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:FindPetsByStatus"},{"display_html":"findPetsByTags :: Accept accept -> Tags -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept","name":"findPetsByTags","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:findPetsByTags"},{"display_html":"data FindPetsByTags","name":"FindPetsByTags","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:FindPetsByTags"},{"display_html":"getPetById :: Accept accept -> PetId -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept","name":"getPetById","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:getPetById"},{"display_html":"data GetPetById","name":"GetPetById","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:GetPetById"},{"display_html":"updatePet :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => ContentType contentType -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent","name":"updatePet","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:updatePet"},{"display_html":"data UpdatePet","name":"UpdatePet","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:UpdatePet"},{"display_html":"updatePetWithForm :: Consumes UpdatePetWithForm MimeFormUrlEncoded => PetId -> OpenAPIPetstoreRequest UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent","name":"updatePetWithForm","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:updatePetWithForm"},{"display_html":"data UpdatePetWithForm","name":"UpdatePetWithForm","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:UpdatePetWithForm"},{"display_html":"uploadFile :: Consumes UploadFile MimeMultipartFormData => PetId -> OpenAPIPetstoreRequest UploadFile MimeMultipartFormData ApiResponse MimeJSON","name":"uploadFile","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:uploadFile"},{"display_html":"data UploadFile","name":"UploadFile","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:UploadFile"},{"display_html":"uploadFileWithRequiredFile :: Consumes UploadFileWithRequiredFile MimeMultipartFormData => RequiredFile -> PetId -> OpenAPIPetstoreRequest UploadFileWithRequiredFile MimeMultipartFormData ApiResponse MimeJSON","name":"uploadFileWithRequiredFile","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#v:uploadFileWithRequiredFile"},{"display_html":"data UploadFileWithRequiredFile","name":"UploadFileWithRequiredFile","module":"OpenAPIPetstore.API.Pet","link":"OpenAPIPetstore-API-Pet.html#t:UploadFileWithRequiredFile"},{"display_html":"testClassname :: (Consumes TestClassname MimeJSON, MimeRender MimeJSON Client) => Client -> OpenAPIPetstoreRequest TestClassname MimeJSON Client MimeJSON","name":"testClassname","module":"OpenAPIPetstore.API.FakeClassnameTags123","link":"OpenAPIPetstore-API-FakeClassnameTags123.html#v:testClassname"},{"display_html":"data TestClassname","name":"TestClassname","module":"OpenAPIPetstore.API.FakeClassnameTags123","link":"OpenAPIPetstore-API-FakeClassnameTags123.html#t:TestClassname"},{"display_html":"createXmlItem :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) => ContentType contentType -> XmlItem -> OpenAPIPetstoreRequest CreateXmlItem contentType NoContent MimeNoContent","name":"createXmlItem","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:createXmlItem"},{"display_html":"data CreateXmlItem","name":"CreateXmlItem","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:CreateXmlItem"},{"display_html":"fakeOuterBooleanSerialize :: Consumes FakeOuterBooleanSerialize contentType => ContentType contentType -> Accept accept -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept","name":"fakeOuterBooleanSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:fakeOuterBooleanSerialize"},{"display_html":"data FakeOuterBooleanSerialize","name":"FakeOuterBooleanSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:FakeOuterBooleanSerialize"},{"display_html":"fakeOuterCompositeSerialize :: Consumes FakeOuterCompositeSerialize contentType => ContentType contentType -> Accept accept -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept","name":"fakeOuterCompositeSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:fakeOuterCompositeSerialize"},{"display_html":"data FakeOuterCompositeSerialize","name":"FakeOuterCompositeSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:FakeOuterCompositeSerialize"},{"display_html":"fakeOuterNumberSerialize :: Consumes FakeOuterNumberSerialize contentType => ContentType contentType -> Accept accept -> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept","name":"fakeOuterNumberSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:fakeOuterNumberSerialize"},{"display_html":"data FakeOuterNumberSerialize","name":"FakeOuterNumberSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:FakeOuterNumberSerialize"},{"display_html":"fakeOuterStringSerialize :: Consumes FakeOuterStringSerialize contentType => ContentType contentType -> Accept accept -> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept","name":"fakeOuterStringSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:fakeOuterStringSerialize"},{"display_html":"data FakeOuterStringSerialize","name":"FakeOuterStringSerialize","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:FakeOuterStringSerialize"},{"display_html":"testBodyWithFileSchema :: (Consumes TestBodyWithFileSchema MimeJSON, MimeRender MimeJSON FileSchemaTestClass) => FileSchemaTestClass -> OpenAPIPetstoreRequest TestBodyWithFileSchema MimeJSON NoContent MimeNoContent","name":"testBodyWithFileSchema","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testBodyWithFileSchema"},{"display_html":"data TestBodyWithFileSchema","name":"TestBodyWithFileSchema","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestBodyWithFileSchema"},{"display_html":"testBodyWithQueryParams :: (Consumes TestBodyWithQueryParams MimeJSON, MimeRender MimeJSON User) => User -> Query -> OpenAPIPetstoreRequest TestBodyWithQueryParams MimeJSON NoContent MimeNoContent","name":"testBodyWithQueryParams","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testBodyWithQueryParams"},{"display_html":"data TestBodyWithQueryParams","name":"TestBodyWithQueryParams","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestBodyWithQueryParams"},{"display_html":"testClientModel :: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client) => Client -> OpenAPIPetstoreRequest TestClientModel MimeJSON Client MimeJSON","name":"testClientModel","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testClientModel"},{"display_html":"data TestClientModel","name":"TestClientModel","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestClientModel"},{"display_html":"testEndpointParameters :: Consumes TestEndpointParameters MimeFormUrlEncoded => Number -> ParamDouble -> PatternWithoutDelimiter -> Byte -> OpenAPIPetstoreRequest TestEndpointParameters MimeFormUrlEncoded NoContent MimeNoContent","name":"testEndpointParameters","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testEndpointParameters"},{"display_html":"data TestEndpointParameters","name":"TestEndpointParameters","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestEndpointParameters"},{"display_html":"testEnumParameters :: Consumes TestEnumParameters MimeFormUrlEncoded => OpenAPIPetstoreRequest TestEnumParameters MimeFormUrlEncoded NoContent MimeNoContent","name":"testEnumParameters","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testEnumParameters"},{"display_html":"data TestEnumParameters","name":"TestEnumParameters","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestEnumParameters"},{"display_html":"testGroupParameters :: RequiredStringGroup -> RequiredBooleanGroup -> RequiredInt64Group -> OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent","name":"testGroupParameters","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testGroupParameters"},{"display_html":"data TestGroupParameters","name":"TestGroupParameters","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestGroupParameters"},{"display_html":"testInlineAdditionalProperties :: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON ParamMapMapStringText) => ParamMapMapStringText -> OpenAPIPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent","name":"testInlineAdditionalProperties","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testInlineAdditionalProperties"},{"display_html":"data TestInlineAdditionalProperties","name":"TestInlineAdditionalProperties","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestInlineAdditionalProperties"},{"display_html":"testJsonFormData :: Consumes TestJsonFormData MimeFormUrlEncoded => Param -> Param2 -> OpenAPIPetstoreRequest TestJsonFormData MimeFormUrlEncoded NoContent MimeNoContent","name":"testJsonFormData","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testJsonFormData"},{"display_html":"data TestJsonFormData","name":"TestJsonFormData","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestJsonFormData"},{"display_html":"testQueryParameterCollectionFormat :: Pipe -> Ioutil -> Http -> Url -> Context -> OpenAPIPetstoreRequest TestQueryParameterCollectionFormat MimeNoContent NoContent MimeNoContent","name":"testQueryParameterCollectionFormat","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#v:testQueryParameterCollectionFormat"},{"display_html":"data TestQueryParameterCollectionFormat","name":"TestQueryParameterCollectionFormat","module":"OpenAPIPetstore.API.Fake","link":"OpenAPIPetstore-API-Fake.html#t:TestQueryParameterCollectionFormat"},{"display_html":"op123testSpecialTags :: (Consumes Op123testSpecialTags MimeJSON, MimeRender MimeJSON Client) => Client -> OpenAPIPetstoreRequest Op123testSpecialTags MimeJSON Client MimeJSON","name":"op123testSpecialTags","module":"OpenAPIPetstore.API.AnotherFake","link":"OpenAPIPetstore-API-AnotherFake.html#v:op123testSpecialTags"},{"display_html":"data Op123testSpecialTags","name":"Op123testSpecialTags","module":"OpenAPIPetstore.API.AnotherFake","link":"OpenAPIPetstore-API-AnotherFake.html#t:Op123testSpecialTags"},{"display_html":"module OpenAPIPetstore.API.AnotherFake","name":"","module":"OpenAPIPetstore.API","link":""},{"display_html":"module OpenAPIPetstore.API.Fake","name":"","module":"OpenAPIPetstore.API","link":""},{"display_html":"module OpenAPIPetstore.API.FakeClassnameTags123","name":"","module":"OpenAPIPetstore.API","link":""},{"display_html":"module OpenAPIPetstore.API.Pet","name":"","module":"OpenAPIPetstore.API","link":""},{"display_html":"module OpenAPIPetstore.API.Store","name":"","module":"OpenAPIPetstore.API","link":""},{"display_html":"module OpenAPIPetstore.API.User","name":"","module":"OpenAPIPetstore.API","link":""},{"display_html":"additionalPropertiesAnyTypeNameL :: Lens_' AdditionalPropertiesAnyType (Maybe Text)","name":"additionalPropertiesAnyTypeNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesAnyTypeNameL"},{"display_html":"additionalPropertiesArrayNameL :: Lens_' AdditionalPropertiesArray (Maybe Text)","name":"additionalPropertiesArrayNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesArrayNameL"},{"display_html":"additionalPropertiesBooleanNameL :: Lens_' AdditionalPropertiesBoolean (Maybe Text)","name":"additionalPropertiesBooleanNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesBooleanNameL"},{"display_html":"additionalPropertiesClassMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Text))","name":"additionalPropertiesClassMapStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapStringL"},{"display_html":"additionalPropertiesClassMapNumberL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Double))","name":"additionalPropertiesClassMapNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapNumberL"},{"display_html":"additionalPropertiesClassMapIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Int))","name":"additionalPropertiesClassMapIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapIntegerL"},{"display_html":"additionalPropertiesClassMapBooleanL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Bool))","name":"additionalPropertiesClassMapBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapBooleanL"},{"display_html":"additionalPropertiesClassMapArrayIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map String [Int]))","name":"additionalPropertiesClassMapArrayIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapArrayIntegerL"},{"display_html":"additionalPropertiesClassMapArrayAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map String [Value]))","name":"additionalPropertiesClassMapArrayAnytypeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapArrayAnytypeL"},{"display_html":"additionalPropertiesClassMapMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map String (Map String Text)))","name":"additionalPropertiesClassMapMapStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapMapStringL"},{"display_html":"additionalPropertiesClassMapMapAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map String (Map String Value)))","name":"additionalPropertiesClassMapMapAnytypeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassMapMapAnytypeL"},{"display_html":"additionalPropertiesClassAnytype1L :: Lens_' AdditionalPropertiesClass (Maybe Value)","name":"additionalPropertiesClassAnytype1L","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassAnytype1L"},{"display_html":"additionalPropertiesClassAnytype2L :: Lens_' AdditionalPropertiesClass (Maybe Value)","name":"additionalPropertiesClassAnytype2L","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassAnytype2L"},{"display_html":"additionalPropertiesClassAnytype3L :: Lens_' AdditionalPropertiesClass (Maybe Value)","name":"additionalPropertiesClassAnytype3L","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesClassAnytype3L"},{"display_html":"additionalPropertiesIntegerNameL :: Lens_' AdditionalPropertiesInteger (Maybe Text)","name":"additionalPropertiesIntegerNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesIntegerNameL"},{"display_html":"additionalPropertiesNumberNameL :: Lens_' AdditionalPropertiesNumber (Maybe Text)","name":"additionalPropertiesNumberNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesNumberNameL"},{"display_html":"additionalPropertiesObjectNameL :: Lens_' AdditionalPropertiesObject (Maybe Text)","name":"additionalPropertiesObjectNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesObjectNameL"},{"display_html":"additionalPropertiesStringNameL :: Lens_' AdditionalPropertiesString (Maybe Text)","name":"additionalPropertiesStringNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:additionalPropertiesStringNameL"},{"display_html":"animalClassNameL :: Lens_' Animal Text","name":"animalClassNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:animalClassNameL"},{"display_html":"animalColorL :: Lens_' Animal (Maybe Text)","name":"animalColorL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:animalColorL"},{"display_html":"apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)","name":"apiResponseCodeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:apiResponseCodeL"},{"display_html":"apiResponseTypeL :: Lens_' ApiResponse (Maybe Text)","name":"apiResponseTypeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:apiResponseTypeL"},{"display_html":"apiResponseMessageL :: Lens_' ApiResponse (Maybe Text)","name":"apiResponseMessageL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:apiResponseMessageL"},{"display_html":"arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])","name":"arrayOfArrayOfNumberOnlyArrayArrayNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:arrayOfArrayOfNumberOnlyArrayArrayNumberL"},{"display_html":"arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])","name":"arrayOfNumberOnlyArrayNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:arrayOfNumberOnlyArrayNumberL"},{"display_html":"arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])","name":"arrayTestArrayOfStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:arrayTestArrayOfStringL"},{"display_html":"arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]])","name":"arrayTestArrayArrayOfIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:arrayTestArrayArrayOfIntegerL"},{"display_html":"arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]])","name":"arrayTestArrayArrayOfModelL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:arrayTestArrayArrayOfModelL"},{"display_html":"capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)","name":"capitalizationSmallCamelL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:capitalizationSmallCamelL"},{"display_html":"capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text)","name":"capitalizationCapitalCamelL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:capitalizationCapitalCamelL"},{"display_html":"capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)","name":"capitalizationSmallSnakeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:capitalizationSmallSnakeL"},{"display_html":"capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text)","name":"capitalizationCapitalSnakeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:capitalizationCapitalSnakeL"},{"display_html":"capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)","name":"capitalizationScaEthFlowPointsL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:capitalizationScaEthFlowPointsL"},{"display_html":"capitalizationAttNameL :: Lens_' Capitalization (Maybe Text)","name":"capitalizationAttNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:capitalizationAttNameL"},{"display_html":"catClassNameL :: Lens_' Cat Text","name":"catClassNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:catClassNameL"},{"display_html":"catColorL :: Lens_' Cat (Maybe Text)","name":"catColorL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:catColorL"},{"display_html":"catDeclawedL :: Lens_' Cat (Maybe Bool)","name":"catDeclawedL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:catDeclawedL"},{"display_html":"catAllOfDeclawedL :: Lens_' CatAllOf (Maybe Bool)","name":"catAllOfDeclawedL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:catAllOfDeclawedL"},{"display_html":"categoryIdL :: Lens_' Category (Maybe Integer)","name":"categoryIdL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:categoryIdL"},{"display_html":"categoryNameL :: Lens_' Category Text","name":"categoryNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:categoryNameL"},{"display_html":"classModelClassL :: Lens_' ClassModel (Maybe Text)","name":"classModelClassL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:classModelClassL"},{"display_html":"clientClientL :: Lens_' Client (Maybe Text)","name":"clientClientL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:clientClientL"},{"display_html":"dogClassNameL :: Lens_' Dog Text","name":"dogClassNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:dogClassNameL"},{"display_html":"dogColorL :: Lens_' Dog (Maybe Text)","name":"dogColorL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:dogColorL"},{"display_html":"dogBreedL :: Lens_' Dog (Maybe Text)","name":"dogBreedL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:dogBreedL"},{"display_html":"dogAllOfBreedL :: Lens_' DogAllOf (Maybe Text)","name":"dogAllOfBreedL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:dogAllOfBreedL"},{"display_html":"enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol)","name":"enumArraysJustSymbolL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumArraysJustSymbolL"},{"display_html":"enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum])","name":"enumArraysArrayEnumL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumArraysArrayEnumL"},{"display_html":"enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString)","name":"enumTestEnumStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumTestEnumStringL"},{"display_html":"enumTestEnumStringRequiredL :: Lens_' EnumTest E'EnumString","name":"enumTestEnumStringRequiredL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumTestEnumStringRequiredL"},{"display_html":"enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger)","name":"enumTestEnumIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumTestEnumIntegerL"},{"display_html":"enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber)","name":"enumTestEnumNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumTestEnumNumberL"},{"display_html":"enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum)","name":"enumTestOuterEnumL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:enumTestOuterEnumL"},{"display_html":"fileSourceUriL :: Lens_' File (Maybe Text)","name":"fileSourceUriL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:fileSourceUriL"},{"display_html":"fileSchemaTestClassFileL :: Lens_' FileSchemaTestClass (Maybe File)","name":"fileSchemaTestClassFileL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:fileSchemaTestClassFileL"},{"display_html":"fileSchemaTestClassFilesL :: Lens_' FileSchemaTestClass (Maybe [File])","name":"fileSchemaTestClassFilesL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:fileSchemaTestClassFilesL"},{"display_html":"formatTestIntegerL :: Lens_' FormatTest (Maybe Int)","name":"formatTestIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestIntegerL"},{"display_html":"formatTestInt32L :: Lens_' FormatTest (Maybe Int)","name":"formatTestInt32L","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestInt32L"},{"display_html":"formatTestInt64L :: Lens_' FormatTest (Maybe Integer)","name":"formatTestInt64L","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestInt64L"},{"display_html":"formatTestNumberL :: Lens_' FormatTest Double","name":"formatTestNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestNumberL"},{"display_html":"formatTestFloatL :: Lens_' FormatTest (Maybe Float)","name":"formatTestFloatL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestFloatL"},{"display_html":"formatTestDoubleL :: Lens_' FormatTest (Maybe Double)","name":"formatTestDoubleL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestDoubleL"},{"display_html":"formatTestStringL :: Lens_' FormatTest (Maybe Text)","name":"formatTestStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestStringL"},{"display_html":"formatTestByteL :: Lens_' FormatTest ByteArray","name":"formatTestByteL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestByteL"},{"display_html":"formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath)","name":"formatTestBinaryL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestBinaryL"},{"display_html":"formatTestDateL :: Lens_' FormatTest Date","name":"formatTestDateL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestDateL"},{"display_html":"formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime)","name":"formatTestDateTimeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestDateTimeL"},{"display_html":"formatTestUuidL :: Lens_' FormatTest (Maybe Text)","name":"formatTestUuidL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestUuidL"},{"display_html":"formatTestPasswordL :: Lens_' FormatTest Text","name":"formatTestPasswordL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:formatTestPasswordL"},{"display_html":"hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)","name":"hasOnlyReadOnlyBarL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:hasOnlyReadOnlyBarL"},{"display_html":"hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text)","name":"hasOnlyReadOnlyFooL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:hasOnlyReadOnlyFooL"},{"display_html":"mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map String (Map String Text)))","name":"mapTestMapMapOfStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mapTestMapMapOfStringL"},{"display_html":"mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map String E'Inner))","name":"mapTestMapOfEnumStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mapTestMapOfEnumStringL"},{"display_html":"mapTestDirectMapL :: Lens_' MapTest (Maybe (Map String Bool))","name":"mapTestDirectMapL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mapTestDirectMapL"},{"display_html":"mapTestIndirectMapL :: Lens_' MapTest (Maybe (Map String Bool))","name":"mapTestIndirectMapL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mapTestIndirectMapL"},{"display_html":"mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)","name":"mixedPropertiesAndAdditionalPropertiesClassUuidL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mixedPropertiesAndAdditionalPropertiesClassUuidL"},{"display_html":"mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime)","name":"mixedPropertiesAndAdditionalPropertiesClassDateTimeL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mixedPropertiesAndAdditionalPropertiesClassDateTimeL"},{"display_html":"mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map String Animal))","name":"mixedPropertiesAndAdditionalPropertiesClassMapL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:mixedPropertiesAndAdditionalPropertiesClassMapL"},{"display_html":"model200ResponseNameL :: Lens_' Model200Response (Maybe Int)","name":"model200ResponseNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:model200ResponseNameL"},{"display_html":"model200ResponseClassL :: Lens_' Model200Response (Maybe Text)","name":"model200ResponseClassL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:model200ResponseClassL"},{"display_html":"modelList123listL :: Lens_' ModelList (Maybe Text)","name":"modelList123listL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:modelList123listL"},{"display_html":"modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)","name":"modelReturnReturnL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:modelReturnReturnL"},{"display_html":"nameNameL :: Lens_' Name Int","name":"nameNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:nameNameL"},{"display_html":"nameSnakeCaseL :: Lens_' Name (Maybe Int)","name":"nameSnakeCaseL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:nameSnakeCaseL"},{"display_html":"namePropertyL :: Lens_' Name (Maybe Text)","name":"namePropertyL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:namePropertyL"},{"display_html":"name123numberL :: Lens_' Name (Maybe Int)","name":"name123numberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:name123numberL"},{"display_html":"numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)","name":"numberOnlyJustNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:numberOnlyJustNumberL"},{"display_html":"orderIdL :: Lens_' Order (Maybe Integer)","name":"orderIdL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:orderIdL"},{"display_html":"orderPetIdL :: Lens_' Order (Maybe Integer)","name":"orderPetIdL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:orderPetIdL"},{"display_html":"orderQuantityL :: Lens_' Order (Maybe Int)","name":"orderQuantityL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:orderQuantityL"},{"display_html":"orderShipDateL :: Lens_' Order (Maybe DateTime)","name":"orderShipDateL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:orderShipDateL"},{"display_html":"orderStatusL :: Lens_' Order (Maybe E'Status)","name":"orderStatusL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:orderStatusL"},{"display_html":"orderCompleteL :: Lens_' Order (Maybe Bool)","name":"orderCompleteL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:orderCompleteL"},{"display_html":"outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe Double)","name":"outerCompositeMyNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:outerCompositeMyNumberL"},{"display_html":"outerCompositeMyStringL :: Lens_' OuterComposite (Maybe Text)","name":"outerCompositeMyStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:outerCompositeMyStringL"},{"display_html":"outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe Bool)","name":"outerCompositeMyBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:outerCompositeMyBooleanL"},{"display_html":"petIdL :: Lens_' Pet (Maybe Integer)","name":"petIdL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:petIdL"},{"display_html":"petCategoryL :: Lens_' Pet (Maybe Category)","name":"petCategoryL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:petCategoryL"},{"display_html":"petNameL :: Lens_' Pet Text","name":"petNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:petNameL"},{"display_html":"petPhotoUrlsL :: Lens_' Pet [Text]","name":"petPhotoUrlsL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:petPhotoUrlsL"},{"display_html":"petTagsL :: Lens_' Pet (Maybe [Tag])","name":"petTagsL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:petTagsL"},{"display_html":"petStatusL :: Lens_' Pet (Maybe E'Status2)","name":"petStatusL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:petStatusL"},{"display_html":"readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)","name":"readOnlyFirstBarL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:readOnlyFirstBarL"},{"display_html":"readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text)","name":"readOnlyFirstBazL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:readOnlyFirstBazL"},{"display_html":"specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)","name":"specialModelNameSpecialPropertyNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:specialModelNameSpecialPropertyNameL"},{"display_html":"tagIdL :: Lens_' Tag (Maybe Integer)","name":"tagIdL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:tagIdL"},{"display_html":"tagNameL :: Lens_' Tag (Maybe Text)","name":"tagNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:tagNameL"},{"display_html":"typeHolderDefaultStringItemL :: Lens_' TypeHolderDefault Text","name":"typeHolderDefaultStringItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderDefaultStringItemL"},{"display_html":"typeHolderDefaultNumberItemL :: Lens_' TypeHolderDefault Double","name":"typeHolderDefaultNumberItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderDefaultNumberItemL"},{"display_html":"typeHolderDefaultIntegerItemL :: Lens_' TypeHolderDefault Int","name":"typeHolderDefaultIntegerItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderDefaultIntegerItemL"},{"display_html":"typeHolderDefaultBoolItemL :: Lens_' TypeHolderDefault Bool","name":"typeHolderDefaultBoolItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderDefaultBoolItemL"},{"display_html":"typeHolderDefaultArrayItemL :: Lens_' TypeHolderDefault [Int]","name":"typeHolderDefaultArrayItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderDefaultArrayItemL"},{"display_html":"typeHolderExampleStringItemL :: Lens_' TypeHolderExample Text","name":"typeHolderExampleStringItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderExampleStringItemL"},{"display_html":"typeHolderExampleNumberItemL :: Lens_' TypeHolderExample Double","name":"typeHolderExampleNumberItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderExampleNumberItemL"},{"display_html":"typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample Int","name":"typeHolderExampleIntegerItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderExampleIntegerItemL"},{"display_html":"typeHolderExampleBoolItemL :: Lens_' TypeHolderExample Bool","name":"typeHolderExampleBoolItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderExampleBoolItemL"},{"display_html":"typeHolderExampleArrayItemL :: Lens_' TypeHolderExample [Int]","name":"typeHolderExampleArrayItemL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:typeHolderExampleArrayItemL"},{"display_html":"userIdL :: Lens_' User (Maybe Integer)","name":"userIdL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userIdL"},{"display_html":"userUsernameL :: Lens_' User (Maybe Text)","name":"userUsernameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userUsernameL"},{"display_html":"userFirstNameL :: Lens_' User (Maybe Text)","name":"userFirstNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userFirstNameL"},{"display_html":"userLastNameL :: Lens_' User (Maybe Text)","name":"userLastNameL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userLastNameL"},{"display_html":"userEmailL :: Lens_' User (Maybe Text)","name":"userEmailL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userEmailL"},{"display_html":"userPasswordL :: Lens_' User (Maybe Text)","name":"userPasswordL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userPasswordL"},{"display_html":"userPhoneL :: Lens_' User (Maybe Text)","name":"userPhoneL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userPhoneL"},{"display_html":"userUserStatusL :: Lens_' User (Maybe Int)","name":"userUserStatusL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:userUserStatusL"},{"display_html":"xmlItemAttributeStringL :: Lens_' XmlItem (Maybe Text)","name":"xmlItemAttributeStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemAttributeStringL"},{"display_html":"xmlItemAttributeNumberL :: Lens_' XmlItem (Maybe Double)","name":"xmlItemAttributeNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemAttributeNumberL"},{"display_html":"xmlItemAttributeIntegerL :: Lens_' XmlItem (Maybe Int)","name":"xmlItemAttributeIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemAttributeIntegerL"},{"display_html":"xmlItemAttributeBooleanL :: Lens_' XmlItem (Maybe Bool)","name":"xmlItemAttributeBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemAttributeBooleanL"},{"display_html":"xmlItemWrappedArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemWrappedArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemWrappedArrayL"},{"display_html":"xmlItemNameStringL :: Lens_' XmlItem (Maybe Text)","name":"xmlItemNameStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNameStringL"},{"display_html":"xmlItemNameNumberL :: Lens_' XmlItem (Maybe Double)","name":"xmlItemNameNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNameNumberL"},{"display_html":"xmlItemNameIntegerL :: Lens_' XmlItem (Maybe Int)","name":"xmlItemNameIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNameIntegerL"},{"display_html":"xmlItemNameBooleanL :: Lens_' XmlItem (Maybe Bool)","name":"xmlItemNameBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNameBooleanL"},{"display_html":"xmlItemNameArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemNameArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNameArrayL"},{"display_html":"xmlItemNameWrappedArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemNameWrappedArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNameWrappedArrayL"},{"display_html":"xmlItemPrefixStringL :: Lens_' XmlItem (Maybe Text)","name":"xmlItemPrefixStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixStringL"},{"display_html":"xmlItemPrefixNumberL :: Lens_' XmlItem (Maybe Double)","name":"xmlItemPrefixNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNumberL"},{"display_html":"xmlItemPrefixIntegerL :: Lens_' XmlItem (Maybe Int)","name":"xmlItemPrefixIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixIntegerL"},{"display_html":"xmlItemPrefixBooleanL :: Lens_' XmlItem (Maybe Bool)","name":"xmlItemPrefixBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixBooleanL"},{"display_html":"xmlItemPrefixArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemPrefixArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixArrayL"},{"display_html":"xmlItemPrefixWrappedArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemPrefixWrappedArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixWrappedArrayL"},{"display_html":"xmlItemNamespaceStringL :: Lens_' XmlItem (Maybe Text)","name":"xmlItemNamespaceStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNamespaceStringL"},{"display_html":"xmlItemNamespaceNumberL :: Lens_' XmlItem (Maybe Double)","name":"xmlItemNamespaceNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNamespaceNumberL"},{"display_html":"xmlItemNamespaceIntegerL :: Lens_' XmlItem (Maybe Int)","name":"xmlItemNamespaceIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNamespaceIntegerL"},{"display_html":"xmlItemNamespaceBooleanL :: Lens_' XmlItem (Maybe Bool)","name":"xmlItemNamespaceBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNamespaceBooleanL"},{"display_html":"xmlItemNamespaceArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemNamespaceArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNamespaceArrayL"},{"display_html":"xmlItemNamespaceWrappedArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemNamespaceWrappedArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemNamespaceWrappedArrayL"},{"display_html":"xmlItemPrefixNsStringL :: Lens_' XmlItem (Maybe Text)","name":"xmlItemPrefixNsStringL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNsStringL"},{"display_html":"xmlItemPrefixNsNumberL :: Lens_' XmlItem (Maybe Double)","name":"xmlItemPrefixNsNumberL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNsNumberL"},{"display_html":"xmlItemPrefixNsIntegerL :: Lens_' XmlItem (Maybe Int)","name":"xmlItemPrefixNsIntegerL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNsIntegerL"},{"display_html":"xmlItemPrefixNsBooleanL :: Lens_' XmlItem (Maybe Bool)","name":"xmlItemPrefixNsBooleanL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNsBooleanL"},{"display_html":"xmlItemPrefixNsArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemPrefixNsArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNsArrayL"},{"display_html":"xmlItemPrefixNsWrappedArrayL :: Lens_' XmlItem (Maybe [Int])","name":"xmlItemPrefixNsWrappedArrayL","module":"OpenAPIPetstore.ModelLens","link":"OpenAPIPetstore-ModelLens.html#v:xmlItemPrefixNsWrappedArrayL"},{"display_html":"module OpenAPIPetstore.API","name":"","module":"OpenAPIPetstore","link":""},{"display_html":"module OpenAPIPetstore.Client","name":"","module":"OpenAPIPetstore","link":""},{"display_html":"module OpenAPIPetstore.Core","name":"","module":"OpenAPIPetstore","link":""},{"display_html":"module OpenAPIPetstore.Logging","name":"","module":"OpenAPIPetstore","link":""},{"display_html":"module OpenAPIPetstore.MimeTypes","name":"","module":"OpenAPIPetstore","link":""},{"display_html":"module OpenAPIPetstore.Model","name":"","module":"OpenAPIPetstore","link":""},{"display_html":"module OpenAPIPetstore.ModelLens","name":"","module":"OpenAPIPetstore","link":""}] \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/haddock-util.js b/samples/client/petstore/haskell-http-client/docs/haddock-util.js deleted file mode 100644 index 967e202665e8..000000000000 --- a/samples/client/petstore/haskell-http-client/docs/haddock-util.js +++ /dev/null @@ -1,186 +0,0 @@ -// Haddock JavaScript utilities - -var rspace = /\s\s+/g, - rtrim = /^\s+|\s+$/g; - -function spaced(s) { return (" " + s + " ").replace(rspace, " "); } -function trim(s) { return s.replace(rtrim, ""); } - -function hasClass(elem, value) { - var className = spaced(elem.className || ""); - return className.indexOf( " " + value + " " ) >= 0; -} - -function addClass(elem, value) { - var className = spaced(elem.className || ""); - if ( className.indexOf( " " + value + " " ) < 0 ) { - elem.className = trim(className + " " + value); - } -} - -function removeClass(elem, value) { - var className = spaced(elem.className || ""); - className = className.replace(" " + value + " ", " "); - elem.className = trim(className); -} - -function toggleClass(elem, valueOn, valueOff, bool) { - if (bool == null) { bool = ! hasClass(elem, valueOn); } - if (bool) { - removeClass(elem, valueOff); - addClass(elem, valueOn); - } - else { - removeClass(elem, valueOn); - addClass(elem, valueOff); - } - return bool; -} - - -function makeClassToggle(valueOn, valueOff) -{ - return function(elem, bool) { - return toggleClass(elem, valueOn, valueOff, bool); - } -} - -toggleShow = makeClassToggle("show", "hide"); -toggleCollapser = makeClassToggle("collapser", "expander"); - -function toggleSection(id) -{ - var b = toggleShow(document.getElementById("section." + id)); - toggleCollapser(document.getElementById("control." + id), b); - rememberCollapsed(id); - return b; -} - -var collapsed = {}; -function rememberCollapsed(id) -{ - if(collapsed[id]) - delete collapsed[id] - else - collapsed[id] = true; - - var sections = []; - for(var i in collapsed) - { - if(collapsed.hasOwnProperty(i)) - sections.push(i); - } - // cookie specific to this page; don't use setCookie which sets path=/ - document.cookie = "collapsed=" + escape(sections.join('+')); -} - -function restoreCollapsed() -{ - var cookie = getCookie("collapsed"); - if(!cookie) - return; - - var ids = cookie.split('+'); - for(var i in ids) - { - if(document.getElementById("section." + ids[i])) - toggleSection(ids[i]); - } -} - -function setCookie(name, value) { - document.cookie = name + "=" + escape(value) + ";path=/;"; -} - -function clearCookie(name) { - document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"; -} - -function getCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) { - return unescape(c.substring(nameEQ.length,c.length)); - } - } - return null; -} - -function addMenuItem(html) { - var menu = document.getElementById("page-menu"); - if (menu) { - var btn = menu.firstChild.cloneNode(false); - btn.innerHTML = html; - menu.appendChild(btn); - } -} - -function styles() { - var i, a, es = document.getElementsByTagName("link"), rs = []; - for (i = 0; a = es[i]; i++) { - if(a.rel.indexOf("style") != -1 && a.title) { - rs.push(a); - } - } - return rs; -} - -function addStyleMenu() { - var as = styles(); - var i, a, btns = ""; - for(i=0; a = as[i]; i++) { - btns += "
  • " - + a.title + "
  • " - } - if (as.length > 1) { - var h = "
    " - + "Style ▾" - + "
      " + btns + "
    " - + "
    "; - addMenuItem(h); - } -} - -function setActiveStyleSheet(title) { - var as = styles(); - var i, a, found; - for(i=0; a = as[i]; i++) { - a.disabled = true; - // need to do this always, some browsers are edge triggered - if(a.title == title) { - found = a; - } - } - if (found) { - found.disabled = false; - setCookie("haddock-style", title); - } - else { - as[0].disabled = false; - clearCookie("haddock-style"); - } - styleMenu(false); -} - -function resetStyle() { - var s = getCookie("haddock-style"); - if (s) setActiveStyleSheet(s); -} - - -function styleMenu(show) { - var m = document.getElementById('style-menu'); - if (m) toggleShow(m, show); -} - - -function pageLoad() { - addStyleMenu(); - resetStyle(); - restoreCollapsed(); -} - diff --git a/samples/client/petstore/haskell-http-client/docs/index.html b/samples/client/petstore/haskell-http-client/docs/index.html index 26868cca7951..230e4018ce56 100644 --- a/samples/client/petstore/haskell-http-client/docs/index.html +++ b/samples/client/petstore/haskell-http-client/docs/index.html @@ -1 +1 @@ -openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

    openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

    openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

    Client library for calling the OpenAPI Petstore API based on http-client.

    host: petstore.swagger.io

    base path: http://petstore.swagger.io:80/v2

    OpenAPI Petstore API version: 1.0.0

    OpenAPI version: 3.0.1

    category: Web

    Signatures

    \ No newline at end of file +openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

    openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

    openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

    Client library for calling the OpenAPI Petstore API based on http-client.

    host: petstore.swagger.io

    base path: http://petstore.swagger.io:80/v2

    OpenAPI Petstore API version: 1.0.0

    OpenAPI version: 3.0.1

    Signatures

    \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/openapi-petstore.txt b/samples/client/petstore/haskell-http-client/docs/openapi-petstore.txt index c477ff882243..b447ed9a56ea 100644 --- a/samples/client/petstore/haskell-http-client/docs/openapi-petstore.txt +++ b/samples/client/petstore/haskell-http-client/docs/openapi-petstore.txt @@ -14,8 +14,6 @@ -- OpenAPI Petstore API version: 1.0.0 -- -- OpenAPI version: 3.0.1 --- --- category: Web @package openapi-petstore @version 0.1.0.0 @@ -23,56 +21,47 @@ -- | Logging functions module OpenAPIPetstore.Logging --- | Runs a monad-logger block with the filter predicate +-- | Runs a Katip logging block with the Log environment type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m --- | A monad-logger block -type LogExec m = forall a. LoggingT m a -> m a +-- | A Katip logging block +type LogExec m = forall a. KatipT m a -> m a --- | A monad-logger filter predicate -type LogContext = LogSource -> LogLevel -> Bool +-- | A Katip Log environment +type LogContext = LogEnv --- | A monad-logger log level -type LogLevel = LogLevel +-- | A Katip Log severity +type LogLevel = Severity -- | the default log environment initLogContext :: IO LogContext --- | Runs a monad-logger block with the filter predicate +-- | Runs a Katip logging block with the Log environment runDefaultLogExecWithContext :: LogExecWithContext --- | Runs a monad-logger block targeting stdout, with the filter predicate +-- | Runs a Katip logging block with the Log environment stdoutLoggingExec :: LogExecWithContext --- |
    ---   pure
    ---   
    +-- | A Katip Log environment which targets stdout stdoutLoggingContext :: LogContext -> IO LogContext --- | Runs a monad-logger block targeting stderr, with the filter predicate +-- | Runs a Katip logging block with the Log environment stderrLoggingExec :: LogExecWithContext --- |
    ---   pure
    ---   
    +-- | A Katip Log environment which targets stderr stderrLoggingContext :: LogContext -> IO LogContext --- | Disables monad-logger logging +-- | Disables Katip logging runNullLogExec :: LogExecWithContext --- | monad-logger which does nothing -nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO () - --- | Log a message using the current time -_log :: (MonadIO m, MonadLogger m) => Text -> LogLevel -> Text -> m () +-- | Log a katip message +_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m () -- | re-throws exceptions after logging them -logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a +logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a levelInfo :: LogLevel levelError :: LogLevel levelDebug :: LogLevel -minLevelFilter :: LogLevel -> LogSource -> LogLevel -> Bool -infoLevelFilter :: LogSource -> LogLevel -> Bool module OpenAPIPetstore.MimeTypes @@ -120,17 +109,17 @@ data MimeXmlCharsetutf16 MimeXmlCharsetutf16 :: MimeXmlCharsetutf16 data MimeXmlCharsetutf8 MimeXmlCharsetutf8 :: MimeXmlCharsetutf8 -data MimeTextxml -MimeTextxml :: MimeTextxml -data MimeTextxmlCharsetutf16 -MimeTextxmlCharsetutf16 :: MimeTextxmlCharsetutf16 -data MimeTextxmlCharsetutf8 -MimeTextxmlCharsetutf8 :: MimeTextxmlCharsetutf8 +data MimeTextXml +MimeTextXml :: MimeTextXml +data MimeTextXmlCharsetutf16 +MimeTextXmlCharsetutf16 :: MimeTextXmlCharsetutf16 +data MimeTextXmlCharsetutf8 +MimeTextXmlCharsetutf8 :: MimeTextXmlCharsetutf8 instance GHC.Classes.Eq OpenAPIPetstore.MimeTypes.NoContent instance GHC.Show.Show OpenAPIPetstore.MimeTypes.NoContent -instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeTextxmlCharsetutf8 -instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeTextxmlCharsetutf16 -instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeTextxml +instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeTextXmlCharsetutf8 +instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeTextXmlCharsetutf16 +instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeTextXml instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeXmlCharsetutf8 instance OpenAPIPetstore.MimeTypes.MimeType OpenAPIPetstore.MimeTypes.MimeXmlCharsetutf16 instance Data.Aeson.Types.FromJSON.FromJSON a => OpenAPIPetstore.MimeTypes.MimeUnrender OpenAPIPetstore.MimeTypes.MimeJSON a @@ -565,6 +554,9 @@ Byte :: ByteArray -> Byte newtype Callback Callback :: Text -> Callback [unCallback] :: Callback -> Text +newtype Context +Context :: [Text] -> Context +[unContext] :: Context -> [Text] newtype EnumFormString EnumFormString :: E'EnumFormString -> EnumFormString [unEnumFormString] :: EnumFormString -> E'EnumFormString @@ -592,6 +584,9 @@ EnumQueryStringArray :: [E'EnumFormStringArray] -> EnumQueryStringArray newtype File2 File2 :: FilePath -> File2 [unFile2] :: File2 -> FilePath +newtype Http +Http :: [Text] -> Http +[unHttp] :: Http -> [Text] newtype Int32 Int32 :: Int -> Int32 [unInt32] :: Int32 -> Int @@ -601,6 +596,9 @@ Int64 :: Integer -> Int64 newtype Int64Group Int64Group :: Integer -> Int64Group [unInt64Group] :: Int64Group -> Integer +newtype Ioutil +Ioutil :: [Text] -> Ioutil +[unIoutil] :: Ioutil -> [Text] newtype Name2 Name2 :: Text -> Name2 [unName2] :: Name2 -> Text @@ -652,6 +650,9 @@ PatternWithoutDelimiter :: Text -> PatternWithoutDelimiter newtype PetId PetId :: Integer -> PetId [unPetId] :: PetId -> Integer +newtype Pipe +Pipe :: [Text] -> Pipe +[unPipe] :: Pipe -> [Text] newtype Query Query :: Text -> Query [unQuery] :: Query -> Text @@ -679,24 +680,131 @@ StringGroup :: Int -> StringGroup newtype Tags Tags :: [Text] -> Tags [unTags] :: Tags -> [Text] +newtype Url +Url :: [Text] -> Url +[unUrl] :: Url -> [Text] newtype Username Username :: Text -> Username [unUsername] :: Username -> Text +-- | AdditionalPropertiesAnyType +data AdditionalPropertiesAnyType +AdditionalPropertiesAnyType :: !Maybe Text -> AdditionalPropertiesAnyType + +-- | "name" +[additionalPropertiesAnyTypeName] :: AdditionalPropertiesAnyType -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesAnyType (by +-- applying it's required fields, if any) +mkAdditionalPropertiesAnyType :: AdditionalPropertiesAnyType + +-- | AdditionalPropertiesArray +data AdditionalPropertiesArray +AdditionalPropertiesArray :: !Maybe Text -> AdditionalPropertiesArray + +-- | "name" +[additionalPropertiesArrayName] :: AdditionalPropertiesArray -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesArray (by +-- applying it's required fields, if any) +mkAdditionalPropertiesArray :: AdditionalPropertiesArray + +-- | AdditionalPropertiesBoolean +data AdditionalPropertiesBoolean +AdditionalPropertiesBoolean :: !Maybe Text -> AdditionalPropertiesBoolean + +-- | "name" +[additionalPropertiesBooleanName] :: AdditionalPropertiesBoolean -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesBoolean (by +-- applying it's required fields, if any) +mkAdditionalPropertiesBoolean :: AdditionalPropertiesBoolean + -- | AdditionalPropertiesClass data AdditionalPropertiesClass -AdditionalPropertiesClass :: !Maybe (Map String Text) -> !Maybe (Map String (Map String Text)) -> AdditionalPropertiesClass +AdditionalPropertiesClass :: !Maybe (Map String Text) -> !Maybe (Map String Double) -> !Maybe (Map String Int) -> !Maybe (Map String Bool) -> !Maybe (Map String [Int]) -> !Maybe (Map String [Value]) -> !Maybe (Map String (Map String Text)) -> !Maybe (Map String (Map String Value)) -> !Maybe Value -> !Maybe Value -> !Maybe Value -> AdditionalPropertiesClass --- | "map_property" -[additionalPropertiesClassMapProperty] :: AdditionalPropertiesClass -> !Maybe (Map String Text) +-- | "map_string" +[additionalPropertiesClassMapString] :: AdditionalPropertiesClass -> !Maybe (Map String Text) --- | "map_of_map_property" -[additionalPropertiesClassMapOfMapProperty] :: AdditionalPropertiesClass -> !Maybe (Map String (Map String Text)) +-- | "map_number" +[additionalPropertiesClassMapNumber] :: AdditionalPropertiesClass -> !Maybe (Map String Double) + +-- | "map_integer" +[additionalPropertiesClassMapInteger] :: AdditionalPropertiesClass -> !Maybe (Map String Int) + +-- | "map_boolean" +[additionalPropertiesClassMapBoolean] :: AdditionalPropertiesClass -> !Maybe (Map String Bool) + +-- | "map_array_integer" +[additionalPropertiesClassMapArrayInteger] :: AdditionalPropertiesClass -> !Maybe (Map String [Int]) + +-- | "map_array_anytype" +[additionalPropertiesClassMapArrayAnytype] :: AdditionalPropertiesClass -> !Maybe (Map String [Value]) + +-- | "map_map_string" +[additionalPropertiesClassMapMapString] :: AdditionalPropertiesClass -> !Maybe (Map String (Map String Text)) + +-- | "map_map_anytype" +[additionalPropertiesClassMapMapAnytype] :: AdditionalPropertiesClass -> !Maybe (Map String (Map String Value)) + +-- | "anytype_1" +[additionalPropertiesClassAnytype1] :: AdditionalPropertiesClass -> !Maybe Value + +-- | "anytype_2" +[additionalPropertiesClassAnytype2] :: AdditionalPropertiesClass -> !Maybe Value + +-- | "anytype_3" +[additionalPropertiesClassAnytype3] :: AdditionalPropertiesClass -> !Maybe Value -- | Construct a value of type AdditionalPropertiesClass (by -- applying it's required fields, if any) mkAdditionalPropertiesClass :: AdditionalPropertiesClass +-- | AdditionalPropertiesInteger +data AdditionalPropertiesInteger +AdditionalPropertiesInteger :: !Maybe Text -> AdditionalPropertiesInteger + +-- | "name" +[additionalPropertiesIntegerName] :: AdditionalPropertiesInteger -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesInteger (by +-- applying it's required fields, if any) +mkAdditionalPropertiesInteger :: AdditionalPropertiesInteger + +-- | AdditionalPropertiesNumber +data AdditionalPropertiesNumber +AdditionalPropertiesNumber :: !Maybe Text -> AdditionalPropertiesNumber + +-- | "name" +[additionalPropertiesNumberName] :: AdditionalPropertiesNumber -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesNumber (by +-- applying it's required fields, if any) +mkAdditionalPropertiesNumber :: AdditionalPropertiesNumber + +-- | AdditionalPropertiesObject +data AdditionalPropertiesObject +AdditionalPropertiesObject :: !Maybe Text -> AdditionalPropertiesObject + +-- | "name" +[additionalPropertiesObjectName] :: AdditionalPropertiesObject -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesObject (by +-- applying it's required fields, if any) +mkAdditionalPropertiesObject :: AdditionalPropertiesObject + +-- | AdditionalPropertiesString +data AdditionalPropertiesString +AdditionalPropertiesString :: !Maybe Text -> AdditionalPropertiesString + +-- | "name" +[additionalPropertiesStringName] :: AdditionalPropertiesString -> !Maybe Text + +-- | Construct a value of type AdditionalPropertiesString (by +-- applying it's required fields, if any) +mkAdditionalPropertiesString :: AdditionalPropertiesString + -- | Animal data Animal Animal :: !Text -> !Maybe Text -> Animal @@ -810,6 +918,17 @@ Cat :: !Text -> !Maybe Text -> !Maybe Bool -> Cat -- fields, if any) mkCat :: Text -> Cat +-- | CatAllOf +data CatAllOf +CatAllOf :: !Maybe Bool -> CatAllOf + +-- | "declawed" +[catAllOfDeclawed] :: CatAllOf -> !Maybe Bool + +-- | Construct a value of type CatAllOf (by applying it's required +-- fields, if any) +mkCatAllOf :: CatAllOf + -- | Category data Category Category :: !Maybe Integer -> !Text -> Category @@ -863,6 +982,17 @@ Dog :: !Text -> !Maybe Text -> !Maybe Text -> Dog -- fields, if any) mkDog :: Text -> Dog +-- | DogAllOf +data DogAllOf +DogAllOf :: !Maybe Text -> DogAllOf + +-- | "breed" +[dogAllOfBreed] :: DogAllOf -> !Maybe Text + +-- | Construct a value of type DogAllOf (by applying it's required +-- fields, if any) +mkDogAllOf :: DogAllOf + -- | EnumArrays data EnumArrays EnumArrays :: !Maybe E'JustSymbol -> !Maybe [E'ArrayEnum] -> EnumArrays @@ -1806,6 +1936,8 @@ instance GHC.Classes.Eq OpenAPIPetstore.Model.FileSchemaTestClass instance GHC.Show.Show OpenAPIPetstore.Model.FileSchemaTestClass instance GHC.Classes.Eq OpenAPIPetstore.Model.File instance GHC.Show.Show OpenAPIPetstore.Model.File +instance GHC.Classes.Eq OpenAPIPetstore.Model.DogAllOf +instance GHC.Show.Show OpenAPIPetstore.Model.DogAllOf instance GHC.Classes.Eq OpenAPIPetstore.Model.Dog instance GHC.Show.Show OpenAPIPetstore.Model.Dog instance GHC.Classes.Eq OpenAPIPetstore.Model.Client @@ -1814,6 +1946,8 @@ instance GHC.Classes.Eq OpenAPIPetstore.Model.ClassModel instance GHC.Show.Show OpenAPIPetstore.Model.ClassModel instance GHC.Classes.Eq OpenAPIPetstore.Model.Category instance GHC.Show.Show OpenAPIPetstore.Model.Category +instance GHC.Classes.Eq OpenAPIPetstore.Model.CatAllOf +instance GHC.Show.Show OpenAPIPetstore.Model.CatAllOf instance GHC.Classes.Eq OpenAPIPetstore.Model.Cat instance GHC.Show.Show OpenAPIPetstore.Model.Cat instance GHC.Classes.Eq OpenAPIPetstore.Model.Capitalization @@ -1826,10 +1960,26 @@ instance GHC.Classes.Eq OpenAPIPetstore.Model.ApiResponse instance GHC.Show.Show OpenAPIPetstore.Model.ApiResponse instance GHC.Classes.Eq OpenAPIPetstore.Model.Animal instance GHC.Show.Show OpenAPIPetstore.Model.Animal +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesString +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesString +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesObject +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesObject +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesNumber +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesNumber +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesInteger +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesInteger instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesClass instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesClass +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesBoolean +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesBoolean +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesArray +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesArray +instance GHC.Classes.Eq OpenAPIPetstore.Model.AdditionalPropertiesAnyType +instance GHC.Show.Show OpenAPIPetstore.Model.AdditionalPropertiesAnyType instance GHC.Show.Show OpenAPIPetstore.Model.Username instance GHC.Classes.Eq OpenAPIPetstore.Model.Username +instance GHC.Show.Show OpenAPIPetstore.Model.Url +instance GHC.Classes.Eq OpenAPIPetstore.Model.Url instance GHC.Show.Show OpenAPIPetstore.Model.Tags instance GHC.Classes.Eq OpenAPIPetstore.Model.Tags instance GHC.Show.Show OpenAPIPetstore.Model.StringGroup @@ -1846,6 +1996,8 @@ instance GHC.Show.Show OpenAPIPetstore.Model.RequiredBooleanGroup instance GHC.Classes.Eq OpenAPIPetstore.Model.RequiredBooleanGroup instance GHC.Show.Show OpenAPIPetstore.Model.Query instance GHC.Classes.Eq OpenAPIPetstore.Model.Query +instance GHC.Show.Show OpenAPIPetstore.Model.Pipe +instance GHC.Classes.Eq OpenAPIPetstore.Model.Pipe instance GHC.Show.Show OpenAPIPetstore.Model.PetId instance GHC.Classes.Eq OpenAPIPetstore.Model.PetId instance GHC.Show.Show OpenAPIPetstore.Model.PatternWithoutDelimiter @@ -1881,14 +2033,20 @@ instance GHC.Show.Show OpenAPIPetstore.Model.Number instance GHC.Classes.Eq OpenAPIPetstore.Model.Number instance GHC.Show.Show OpenAPIPetstore.Model.Name2 instance GHC.Classes.Eq OpenAPIPetstore.Model.Name2 +instance GHC.Show.Show OpenAPIPetstore.Model.Ioutil +instance GHC.Classes.Eq OpenAPIPetstore.Model.Ioutil instance GHC.Show.Show OpenAPIPetstore.Model.Int64Group instance GHC.Classes.Eq OpenAPIPetstore.Model.Int64Group instance GHC.Show.Show OpenAPIPetstore.Model.Int64 instance GHC.Classes.Eq OpenAPIPetstore.Model.Int64 instance GHC.Show.Show OpenAPIPetstore.Model.Int32 instance GHC.Classes.Eq OpenAPIPetstore.Model.Int32 +instance GHC.Show.Show OpenAPIPetstore.Model.Http +instance GHC.Classes.Eq OpenAPIPetstore.Model.Http instance GHC.Show.Show OpenAPIPetstore.Model.File2 instance GHC.Classes.Eq OpenAPIPetstore.Model.File2 +instance GHC.Show.Show OpenAPIPetstore.Model.Context +instance GHC.Classes.Eq OpenAPIPetstore.Model.Context instance GHC.Show.Show OpenAPIPetstore.Model.Callback instance GHC.Classes.Eq OpenAPIPetstore.Model.Callback instance GHC.Show.Show OpenAPIPetstore.Model.Byte @@ -2025,6 +2183,8 @@ instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.FileSchemaTest instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.FileSchemaTestClass instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.File instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.File +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.DogAllOf +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.DogAllOf instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.Dog instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.Dog instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.Client @@ -2033,6 +2193,8 @@ instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.ClassModel instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.ClassModel instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.Category instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.Category +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.CatAllOf +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.CatAllOf instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.Cat instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.Cat instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.Capitalization @@ -2045,8 +2207,22 @@ instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.ApiResponse instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.ApiResponse instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.Animal instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.Animal +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesString +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesString +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesObject +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesObject +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesNumber +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesNumber +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesInteger +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesInteger instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesClass instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesClass +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesBoolean +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesBoolean +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesArray +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesArray +instance Data.Aeson.Types.FromJSON.FromJSON OpenAPIPetstore.Model.AdditionalPropertiesAnyType +instance Data.Aeson.Types.ToJSON.ToJSON OpenAPIPetstore.Model.AdditionalPropertiesAnyType module OpenAPIPetstore.API.User @@ -2456,6 +2632,15 @@ data TestInlineAdditionalProperties -- test json serialization of form data testJsonFormData :: Consumes TestJsonFormData MimeFormUrlEncoded => Param -> Param2 -> OpenAPIPetstoreRequest TestJsonFormData MimeFormUrlEncoded NoContent MimeNoContent data TestJsonFormData + +-- |
    +--   PUT /fake/test-query-paramters
    +--   
    +-- +-- To test the collection format in query parameters +testQueryParameterCollectionFormat :: Pipe -> Ioutil -> Http -> Url -> Context -> OpenAPIPetstoreRequest TestQueryParameterCollectionFormat MimeNoContent NoContent MimeNoContent +data TestQueryParameterCollectionFormat +instance OpenAPIPetstore.MimeTypes.Produces OpenAPIPetstore.API.Fake.TestQueryParameterCollectionFormat OpenAPIPetstore.MimeTypes.MimeNoContent instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.TestJsonFormData OpenAPIPetstore.MimeTypes.MimeFormUrlEncoded instance OpenAPIPetstore.MimeTypes.Produces OpenAPIPetstore.API.Fake.TestJsonFormData OpenAPIPetstore.MimeTypes.MimeNoContent instance OpenAPIPetstore.Core.HasBodyParam OpenAPIPetstore.API.Fake.TestInlineAdditionalProperties OpenAPIPetstore.Model.ParamMapMapStringText @@ -2510,9 +2695,9 @@ instance OpenAPIPetstore.MimeTypes.MimeType mtype => OpenAPIPetstore.MimeTypes.C instance OpenAPIPetstore.MimeTypes.MimeType mtype => OpenAPIPetstore.MimeTypes.Produces OpenAPIPetstore.API.Fake.FakeOuterBooleanSerialize mtype instance OpenAPIPetstore.Core.HasBodyParam OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.Model.XmlItem instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeXML -instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeTextxml -instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeTextxmlCharsetutf8 -instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeTextxmlCharsetutf16 +instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeTextXml +instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeTextXmlCharsetutf8 +instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeTextXmlCharsetutf16 instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeXmlCharsetutf8 instance OpenAPIPetstore.MimeTypes.Consumes OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeXmlCharsetutf16 instance OpenAPIPetstore.MimeTypes.Produces OpenAPIPetstore.API.Fake.CreateXmlItem OpenAPIPetstore.MimeTypes.MimeNoContent @@ -2539,11 +2724,59 @@ module OpenAPIPetstore.API module OpenAPIPetstore.ModelLens --- | additionalPropertiesClassMapProperty Lens -additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Text)) +-- | additionalPropertiesAnyTypeName Lens +additionalPropertiesAnyTypeNameL :: Lens_' AdditionalPropertiesAnyType (Maybe Text) + +-- | additionalPropertiesArrayName Lens +additionalPropertiesArrayNameL :: Lens_' AdditionalPropertiesArray (Maybe Text) + +-- | additionalPropertiesBooleanName Lens +additionalPropertiesBooleanNameL :: Lens_' AdditionalPropertiesBoolean (Maybe Text) + +-- | additionalPropertiesClassMapString Lens +additionalPropertiesClassMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Text)) + +-- | additionalPropertiesClassMapNumber Lens +additionalPropertiesClassMapNumberL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Double)) + +-- | additionalPropertiesClassMapInteger Lens +additionalPropertiesClassMapIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Int)) + +-- | additionalPropertiesClassMapBoolean Lens +additionalPropertiesClassMapBooleanL :: Lens_' AdditionalPropertiesClass (Maybe (Map String Bool)) + +-- | additionalPropertiesClassMapArrayInteger Lens +additionalPropertiesClassMapArrayIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map String [Int])) + +-- | additionalPropertiesClassMapArrayAnytype Lens +additionalPropertiesClassMapArrayAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map String [Value])) --- | additionalPropertiesClassMapOfMapProperty Lens -additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map String (Map String Text))) +-- | additionalPropertiesClassMapMapString Lens +additionalPropertiesClassMapMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map String (Map String Text))) + +-- | additionalPropertiesClassMapMapAnytype Lens +additionalPropertiesClassMapMapAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map String (Map String Value))) + +-- | additionalPropertiesClassAnytype1 Lens +additionalPropertiesClassAnytype1L :: Lens_' AdditionalPropertiesClass (Maybe Value) + +-- | additionalPropertiesClassAnytype2 Lens +additionalPropertiesClassAnytype2L :: Lens_' AdditionalPropertiesClass (Maybe Value) + +-- | additionalPropertiesClassAnytype3 Lens +additionalPropertiesClassAnytype3L :: Lens_' AdditionalPropertiesClass (Maybe Value) + +-- | additionalPropertiesIntegerName Lens +additionalPropertiesIntegerNameL :: Lens_' AdditionalPropertiesInteger (Maybe Text) + +-- | additionalPropertiesNumberName Lens +additionalPropertiesNumberNameL :: Lens_' AdditionalPropertiesNumber (Maybe Text) + +-- | additionalPropertiesObjectName Lens +additionalPropertiesObjectNameL :: Lens_' AdditionalPropertiesObject (Maybe Text) + +-- | additionalPropertiesStringName Lens +additionalPropertiesStringNameL :: Lens_' AdditionalPropertiesString (Maybe Text) -- | animalClassName Lens animalClassNameL :: Lens_' Animal Text @@ -2602,6 +2835,9 @@ catColorL :: Lens_' Cat (Maybe Text) -- | catDeclawed Lens catDeclawedL :: Lens_' Cat (Maybe Bool) +-- | catAllOfDeclawed Lens +catAllOfDeclawedL :: Lens_' CatAllOf (Maybe Bool) + -- | categoryId Lens categoryIdL :: Lens_' Category (Maybe Integer) @@ -2623,6 +2859,9 @@ dogColorL :: Lens_' Dog (Maybe Text) -- | dogBreed Lens dogBreedL :: Lens_' Dog (Maybe Text) +-- | dogAllOfBreed Lens +dogAllOfBreedL :: Lens_' DogAllOf (Maybe Text) + -- | enumArraysJustSymbol Lens enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) diff --git a/samples/client/petstore/haskell-http-client/docs/quick-jump.min.js b/samples/client/petstore/haskell-http-client/docs/quick-jump.min.js new file mode 100644 index 000000000000..c03e0836076f --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/quick-jump.min.js @@ -0,0 +1,2 @@ +!function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n||e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s=0&&e.followActiveLink()),"s"===t.key&&"input"!==t.target.tagName.toLowerCase()&&(t.preventDefault(),e.show())})},t.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},t.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},t.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},t.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t={};this.state.fuse.search(e).forEach(function(e){var n=e.item.module;(t[n]||(t[n]=[])).push(e)});var n=[];for(var o in t)!function(e){var o=t[e],r=0;o.forEach(function(e){r+=1/e.score}),n.push({module:e,totalScore:1/r,items:o})}(o);n.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:n})},t.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.topn)return i(e,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},function(e,t,n){"use strict";var o=n(0),r=function e(t,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i=t&&n.push([o,r]),o=-1)}return e[i-1]&&i-o>=t&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(o,"\\$&").replace(n,"|")),i=e.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=O;E-=1){var R=E-1,U=n[e.charAt(R)];if(U&&(b[R]=1),P[E]=(P[E+1]<<1|1)&U,0!==I&&(P[E]|=(L[E+1]|L[E])<<1|1|L[E+1]),P[E]&N&&(C=o(t,{errors:I,currentLocation:R,expectedLocation:_,distance:c}))<=m){if(m=C,(y=R)<=_)break;O=Math.max(1,2*_-y)}}if(o(t,{errors:I+1,currentLocation:_,expectedLocation:_,distance:c})>m)break;L=P}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");d=d.name}else a[d]={weight:1};this._analyze({key:d,value:this.options.getFn(u,d),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,h=t.fullSearcher,p=void 0===h?[]:h,d=t.resultMap,f=void 0===d?{}:d,v=t.results,_=void 0===v?[]:v;if(void 0!==i&&null!==i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=p.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],w=0;w-1&&(O=(O+m)/2),this._log("Score average:",O);var j=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: "+j),(g||k.isMatch)&&j){var P=f[l];P?P.output.push({key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}):(f[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:O,matchedIndices:k.matchedIndices}]},_.push(f[l]))}}else if(a(i))for(var E=0,R=i.length;E-1&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===T?a=[r]:a.push(r),o=i;var l=new e;return l.nodeName=t,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==P.push(e)&&(I.debounceRendering||O)(i)}function i(){var e,t=P;for(P=[];e=t.pop();)e.__d&&L(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===j.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,d,s):e.removeEventListener(t,d,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)p(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function p(e,t,n){try{e[t]=n}catch(e){}}function d(e){return this.__l[e.type](I.event&&I.event(e)||e)}function f(){for(var e;e=E.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function v(e,t,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=e&&!("__preactattr_"in e));var s=_(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||f()),s}function _(e,t,n,o,r){var i=e,s=U;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0))),i.__preactattr_=!0,i;var l=t.nodeName;if("function"==typeof l)return C(e,t,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!e||!a(e,l))&&(i=c(l,U),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),m(e,!0)}var u=i.firstChild,h=i.__preactattr_,p=t.children;if(null==h){h=i.__preactattr_={};for(var d=i.attributes,f=d.length;f--;)h[d[f].name]=d[f].value}return!D&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&g(i,p,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,t.attributes,h),U=s,i}function g(e,t,n,o,r){var i,a,l,c,h,p=e.childNodes,d=[],f={},v=0,g=0,y=p.length,k=0,b=t?t.length:0;if(0!==y)for(L=0;L2?[].slice.call(arguments,2):e.children)},Component:N,render:function(e,t,n){return v(n,e,{},!1,t,!1)},rerender:i,options:I};void 0!==t?t.exports=F:self.preact=F}()},{}]},{},[1]); +//# sourceMappingURL=quick-jump.min.js.map diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html index ff64a3469bc3..23b3b23213c4 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html @@ -69,9 +69,9 @@ :: (Consumes Op123testSpecialTags MimeJSON, MimeRender MimeJSON Client) => Client -- ^ "body" - client model -> OpenAPIPetstoreRequest Op123testSpecialTags MimeJSON Client MimeJSON -op123testSpecialTags body = +op123testSpecialTags body = _mkRequest "PATCH" ["/another-fake/dummy"] - `setBodyParam` body + `setBodyParam` body data Op123testSpecialTags diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html index 0ad233cd8e2e..076f4c46f30f 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html @@ -66,13 +66,13 @@ -- this route creates an XmlItem -- createXmlItem - :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) + => ContentType contentType -- ^ request content-type ('MimeType') -> XmlItem -- ^ "xmlItem" - XmlItem Body - -> OpenAPIPetstoreRequest CreateXmlItem contentType NoContent MimeNoContent -createXmlItem _ xmlItem = + -> OpenAPIPetstoreRequest CreateXmlItem contentType NoContent MimeNoContent +createXmlItem _ xmlItem = _mkRequest "POST" ["/fake/create_xml_item"] - `setBodyParam` xmlItem + `setBodyParam` xmlItem data CreateXmlItem @@ -82,11 +82,11 @@ -- | @application/xml@ instance Consumes CreateXmlItem MimeXML -- | @text/xml@ -instance Consumes CreateXmlItem MimeTextxml +instance Consumes CreateXmlItem MimeTextXml -- | @text/xml; charset=utf-8@ -instance Consumes CreateXmlItem MimeTextxmlCharsetutf8 +instance Consumes CreateXmlItem MimeTextXmlCharsetutf8 -- | @text/xml; charset=utf-16@ -instance Consumes CreateXmlItem MimeTextxmlCharsetutf16 +instance Consumes CreateXmlItem MimeTextXmlCharsetutf16 -- | @application/xml; charset=utf-8@ instance Consumes CreateXmlItem MimeXmlCharsetutf8 -- | @application/xml; charset=utf-16@ @@ -102,10 +102,10 @@ -- Test serialization of outer boolean types -- fakeOuterBooleanSerialize - :: (Consumes FakeOuterBooleanSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept + :: (Consumes FakeOuterBooleanSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept fakeOuterBooleanSerialize _ _ = _mkRequest "POST" ["/fake/outer/boolean"] @@ -115,10 +115,10 @@ instance HasBodyParam FakeOuterBooleanSerialize BodyBool -- | @*/*@ -instance MimeType mtype => Consumes FakeOuterBooleanSerialize mtype +instance MimeType mtype => Consumes FakeOuterBooleanSerialize mtype -- | @*/*@ -instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype +instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype -- *** fakeOuterCompositeSerialize @@ -128,10 +128,10 @@ -- Test serialization of object with outer number type -- fakeOuterCompositeSerialize - :: (Consumes FakeOuterCompositeSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept + :: (Consumes FakeOuterCompositeSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept fakeOuterCompositeSerialize _ _ = _mkRequest "POST" ["/fake/outer/composite"] @@ -141,10 +141,10 @@ instance HasBodyParam FakeOuterCompositeSerialize OuterComposite -- | @*/*@ -instance MimeType mtype => Consumes FakeOuterCompositeSerialize mtype +instance MimeType mtype => Consumes FakeOuterCompositeSerialize mtype -- | @*/*@ -instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype +instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype -- *** fakeOuterNumberSerialize @@ -154,10 +154,10 @@ -- Test serialization of outer number types -- fakeOuterNumberSerialize - :: (Consumes FakeOuterNumberSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept + :: (Consumes FakeOuterNumberSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept fakeOuterNumberSerialize _ _ = _mkRequest "POST" ["/fake/outer/number"] @@ -167,10 +167,10 @@ instance HasBodyParam FakeOuterNumberSerialize BodyDouble -- | @*/*@ -instance MimeType mtype => Consumes FakeOuterNumberSerialize mtype +instance MimeType mtype => Consumes FakeOuterNumberSerialize mtype -- | @*/*@ -instance MimeType mtype => Produces FakeOuterNumberSerialize mtype +instance MimeType mtype => Produces FakeOuterNumberSerialize mtype -- *** fakeOuterStringSerialize @@ -180,10 +180,10 @@ -- Test serialization of outer string types -- fakeOuterStringSerialize - :: (Consumes FakeOuterStringSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept + :: (Consumes FakeOuterStringSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept fakeOuterStringSerialize _ _ = _mkRequest "POST" ["/fake/outer/string"] @@ -193,10 +193,10 @@ instance HasBodyParam FakeOuterStringSerialize BodyText -- | @*/*@ -instance MimeType mtype => Consumes FakeOuterStringSerialize mtype +instance MimeType mtype => Consumes FakeOuterStringSerialize mtype -- | @*/*@ -instance MimeType mtype => Produces FakeOuterStringSerialize mtype +instance MimeType mtype => Produces FakeOuterStringSerialize mtype -- *** testBodyWithFileSchema @@ -209,9 +209,9 @@ :: (Consumes TestBodyWithFileSchema MimeJSON, MimeRender MimeJSON FileSchemaTestClass) => FileSchemaTestClass -- ^ "body" -> OpenAPIPetstoreRequest TestBodyWithFileSchema MimeJSON NoContent MimeNoContent -testBodyWithFileSchema body = +testBodyWithFileSchema body = _mkRequest "PUT" ["/fake/body-with-file-schema"] - `setBodyParam` body + `setBodyParam` body data TestBodyWithFileSchema instance HasBodyParam TestBodyWithFileSchema FileSchemaTestClass @@ -231,10 +231,10 @@ => User -- ^ "body" -> Query -- ^ "query" -> OpenAPIPetstoreRequest TestBodyWithQueryParams MimeJSON NoContent MimeNoContent -testBodyWithQueryParams body (Query query) = +testBodyWithQueryParams body (Query query) = _mkRequest "PUT" ["/fake/body-with-query-params"] - `setBodyParam` body - `setQuery` toQuery ("query", Just query) + `setBodyParam` body + `setQuery` toQuery ("query", Just query) data TestBodyWithQueryParams instance HasBodyParam TestBodyWithQueryParams User @@ -257,9 +257,9 @@ :: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client) => Client -- ^ "body" - client model -> OpenAPIPetstoreRequest TestClientModel MimeJSON Client MimeJSON -testClientModel body = +testClientModel body = _mkRequest "PATCH" ["/fake"] - `setBodyParam` body + `setBodyParam` body data TestClientModel @@ -290,65 +290,65 @@ -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None -> Byte -- ^ "byte" - None -> OpenAPIPetstoreRequest TestEndpointParameters MimeFormUrlEncoded NoContent MimeNoContent -testEndpointParameters (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = +testEndpointParameters (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = _mkRequest "POST" ["/fake"] `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) - `addForm` toForm ("number", number) - `addForm` toForm ("double", double) - `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) - `addForm` toForm ("byte", byte) + `addForm` toForm ("number", number) + `addForm` toForm ("double", double) + `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) + `addForm` toForm ("byte", byte) data TestEndpointParameters -- | /Optional Param/ "integer" - None instance HasOptionalParam TestEndpointParameters ParamInteger where - applyOptionalParam req (ParamInteger xs) = - req `addForm` toForm ("integer", xs) + applyOptionalParam req (ParamInteger xs) = + req `addForm` toForm ("integer", xs) -- | /Optional Param/ "int32" - None instance HasOptionalParam TestEndpointParameters Int32 where - applyOptionalParam req (Int32 xs) = - req `addForm` toForm ("int32", xs) + applyOptionalParam req (Int32 xs) = + req `addForm` toForm ("int32", xs) -- | /Optional Param/ "int64" - None instance HasOptionalParam TestEndpointParameters Int64 where - applyOptionalParam req (Int64 xs) = - req `addForm` toForm ("int64", xs) + applyOptionalParam req (Int64 xs) = + req `addForm` toForm ("int64", xs) -- | /Optional Param/ "float" - None instance HasOptionalParam TestEndpointParameters ParamFloat where - applyOptionalParam req (ParamFloat xs) = - req `addForm` toForm ("float", xs) + applyOptionalParam req (ParamFloat xs) = + req `addForm` toForm ("float", xs) -- | /Optional Param/ "string" - None instance HasOptionalParam TestEndpointParameters ParamString where - applyOptionalParam req (ParamString xs) = - req `addForm` toForm ("string", xs) + applyOptionalParam req (ParamString xs) = + req `addForm` toForm ("string", xs) -- | /Optional Param/ "binary" - None instance HasOptionalParam TestEndpointParameters ParamBinary where - applyOptionalParam req (ParamBinary xs) = - req `_addMultiFormPart` NH.partFileSource "binary" xs + applyOptionalParam req (ParamBinary xs) = + req `_addMultiFormPart` NH.partFileSource "binary" xs -- | /Optional Param/ "date" - None instance HasOptionalParam TestEndpointParameters ParamDate where - applyOptionalParam req (ParamDate xs) = - req `addForm` toForm ("date", xs) + applyOptionalParam req (ParamDate xs) = + req `addForm` toForm ("date", xs) -- | /Optional Param/ "dateTime" - None instance HasOptionalParam TestEndpointParameters ParamDateTime where - applyOptionalParam req (ParamDateTime xs) = - req `addForm` toForm ("dateTime", xs) + applyOptionalParam req (ParamDateTime xs) = + req `addForm` toForm ("dateTime", xs) -- | /Optional Param/ "password" - None instance HasOptionalParam TestEndpointParameters Password where - applyOptionalParam req (Password xs) = - req `addForm` toForm ("password", xs) + applyOptionalParam req (Password xs) = + req `addForm` toForm ("password", xs) -- | /Optional Param/ "callback" - None instance HasOptionalParam TestEndpointParameters Callback where - applyOptionalParam req (Callback xs) = - req `addForm` toForm ("callback", xs) + applyOptionalParam req (Callback xs) = + req `addForm` toForm ("callback", xs) -- | @application/x-www-form-urlencoded@ instance Consumes TestEndpointParameters MimeFormUrlEncoded @@ -374,43 +374,43 @@ -- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumFormStringArray where - applyOptionalParam req (EnumFormStringArray xs) = - req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) + applyOptionalParam req (EnumFormStringArray xs) = + req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) -- | /Optional Param/ "enum_form_string" - Form parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumFormString where - applyOptionalParam req (EnumFormString xs) = - req `addForm` toForm ("enum_form_string", xs) + applyOptionalParam req (EnumFormString xs) = + req `addForm` toForm ("enum_form_string", xs) -- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where - applyOptionalParam req (EnumHeaderStringArray xs) = - req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) + applyOptionalParam req (EnumHeaderStringArray xs) = + req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) -- | /Optional Param/ "enum_header_string" - Header parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumHeaderString where - applyOptionalParam req (EnumHeaderString xs) = - req `setHeader` toHeader ("enum_header_string", xs) + applyOptionalParam req (EnumHeaderString xs) = + req `setHeader` toHeader ("enum_header_string", xs) -- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumQueryStringArray where - applyOptionalParam req (EnumQueryStringArray xs) = - req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs) + applyOptionalParam req (EnumQueryStringArray xs) = + req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs) -- | /Optional Param/ "enum_query_string" - Query parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumQueryString where - applyOptionalParam req (EnumQueryString xs) = - req `setQuery` toQuery ("enum_query_string", Just xs) + applyOptionalParam req (EnumQueryString xs) = + req `setQuery` toQuery ("enum_query_string", Just xs) -- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double) instance HasOptionalParam TestEnumParameters EnumQueryInteger where - applyOptionalParam req (EnumQueryInteger xs) = - req `setQuery` toQuery ("enum_query_integer", Just xs) + applyOptionalParam req (EnumQueryInteger xs) = + req `setQuery` toQuery ("enum_query_integer", Just xs) -- | /Optional Param/ "enum_query_double" - Query parameter enum test (double) instance HasOptionalParam TestEnumParameters EnumQueryDouble where - applyOptionalParam req (EnumQueryDouble xs) = - req `setQuery` toQuery ("enum_query_double", Just xs) + applyOptionalParam req (EnumQueryDouble xs) = + req `setQuery` toQuery ("enum_query_double", Just xs) -- | @application/x-www-form-urlencoded@ instance Consumes TestEnumParameters MimeFormUrlEncoded @@ -431,28 +431,28 @@ -> RequiredBooleanGroup -- ^ "requiredBooleanGroup" - Required Boolean in group parameters -> RequiredInt64Group -- ^ "requiredInt64Group" - Required Integer in group parameters -> OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent -testGroupParameters (RequiredStringGroup requiredStringGroup) (RequiredBooleanGroup requiredBooleanGroup) (RequiredInt64Group requiredInt64Group) = +testGroupParameters (RequiredStringGroup requiredStringGroup) (RequiredBooleanGroup requiredBooleanGroup) (RequiredInt64Group requiredInt64Group) = _mkRequest "DELETE" ["/fake"] - `setQuery` toQuery ("required_string_group", Just requiredStringGroup) - `setHeader` toHeader ("required_boolean_group", requiredBooleanGroup) - `setQuery` toQuery ("required_int64_group", Just requiredInt64Group) + `setQuery` toQuery ("required_string_group", Just requiredStringGroup) + `setHeader` toHeader ("required_boolean_group", requiredBooleanGroup) + `setQuery` toQuery ("required_int64_group", Just requiredInt64Group) data TestGroupParameters -- | /Optional Param/ "string_group" - String in group parameters instance HasOptionalParam TestGroupParameters StringGroup where - applyOptionalParam req (StringGroup xs) = - req `setQuery` toQuery ("string_group", Just xs) + applyOptionalParam req (StringGroup xs) = + req `setQuery` toQuery ("string_group", Just xs) -- | /Optional Param/ "boolean_group" - Boolean in group parameters instance HasOptionalParam TestGroupParameters BooleanGroup where - applyOptionalParam req (BooleanGroup xs) = - req `setHeader` toHeader ("boolean_group", xs) + applyOptionalParam req (BooleanGroup xs) = + req `setHeader` toHeader ("boolean_group", xs) -- | /Optional Param/ "int64_group" - Integer in group parameters instance HasOptionalParam TestGroupParameters Int64Group where - applyOptionalParam req (Int64Group xs) = - req `setQuery` toQuery ("int64_group", Just xs) + applyOptionalParam req (Int64Group xs) = + req `setQuery` toQuery ("int64_group", Just xs) instance Produces TestGroupParameters MimeNoContent @@ -466,9 +466,9 @@ :: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON ParamMapMapStringText) => ParamMapMapStringText -- ^ "param" - request body -> OpenAPIPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent -testInlineAdditionalProperties param = +testInlineAdditionalProperties param = _mkRequest "POST" ["/fake/inline-additionalProperties"] - `setBodyParam` param + `setBodyParam` param data TestInlineAdditionalProperties @@ -492,10 +492,10 @@ => Param -- ^ "param" - field1 -> Param2 -- ^ "param2" - field2 -> OpenAPIPetstoreRequest TestJsonFormData MimeFormUrlEncoded NoContent MimeNoContent -testJsonFormData (Param param) (Param2 param2) = +testJsonFormData (Param param) (Param2 param2) = _mkRequest "GET" ["/fake/jsonFormData"] - `addForm` toForm ("param", param) - `addForm` toForm ("param2", param2) + `addForm` toForm ("param", param) + `addForm` toForm ("param2", param2) data TestJsonFormData @@ -504,4 +504,29 @@ instance Produces TestJsonFormData MimeNoContent - \ No newline at end of file + +-- *** testQueryParameterCollectionFormat + +-- | @PUT \/fake\/test-query-paramters@ +-- +-- To test the collection format in query parameters +-- +testQueryParameterCollectionFormat + :: Pipe -- ^ "pipe" + -> Ioutil -- ^ "ioutil" + -> Http -- ^ "http" + -> Url -- ^ "url" + -> Context -- ^ "context" + -> OpenAPIPetstoreRequest TestQueryParameterCollectionFormat MimeNoContent NoContent MimeNoContent +testQueryParameterCollectionFormat (Pipe pipe) (Ioutil ioutil) (Http http) (Url url) (Context context) = + _mkRequest "PUT" ["/fake/test-query-paramters"] + `setQuery` toQueryColl CommaSeparated ("pipe", Just pipe) + `setQuery` toQueryColl CommaSeparated ("ioutil", Just ioutil) + `setQuery` toQueryColl SpaceSeparated ("http", Just http) + `setQuery` toQueryColl CommaSeparated ("url", Just url) + `setQuery` toQueryColl MultiParamArray ("context", Just context) + +data TestQueryParameterCollectionFormat +instance Produces TestQueryParameterCollectionFormat MimeNoContent + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html index c4bd94d40338..53982b7f79d7 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html @@ -71,10 +71,10 @@ :: (Consumes TestClassname MimeJSON, MimeRender MimeJSON Client) => Client -- ^ "body" - client model -> OpenAPIPetstoreRequest TestClassname MimeJSON Client MimeJSON -testClassname body = +testClassname body = _mkRequest "PATCH" ["/fake_classname_test"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - `setBodyParam` body + `setBodyParam` body data TestClassname diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html index 860cc8be2b00..d930d9ca0c33 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html @@ -66,14 +66,14 @@ -- AuthMethod: 'AuthOAuthPetstoreAuth' -- addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => ContentType contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent -addPet _ body = + -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent +addPet _ body = _mkRequest "POST" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body + `setBodyParam` body data AddPet @@ -99,14 +99,14 @@ deletePet :: PetId -- ^ "petId" - Pet id to delete -> OpenAPIPetstoreRequest DeletePet MimeNoContent NoContent MimeNoContent -deletePet (PetId petId) = - _mkRequest "DELETE" ["/pet/",toPath petId] +deletePet (PetId petId) = + _mkRequest "DELETE" ["/pet/",toPath petId] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data DeletePet instance HasOptionalParam DeletePet ApiKey where - applyOptionalParam req (ApiKey xs) = - req `setHeader` toHeader ("api_key", xs) + applyOptionalParam req (ApiKey xs) = + req `setHeader` toHeader ("api_key", xs) instance Produces DeletePet MimeNoContent @@ -121,13 +121,13 @@ -- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByStatus - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Status -- ^ "status" - Status values that need to be considered for filter - -> OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept -findPetsByStatus _ (Status status) = + -> OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept +findPetsByStatus _ (Status status) = _mkRequest "GET" ["/pet/findByStatus"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("status", Just status) + `setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus -- | @application/xml@ @@ -147,13 +147,13 @@ -- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByTags - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Tags -- ^ "tags" - Tags to filter by - -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept -findPetsByTags _ (Tags tags) = + -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept +findPetsByTags _ (Tags tags) = _mkRequest "GET" ["/pet/findByTags"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -175,11 +175,11 @@ -- AuthMethod: 'AuthApiKeyApiKey' -- getPetById - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> PetId -- ^ "petId" - ID of pet to return - -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept -getPetById _ (PetId petId) = - _mkRequest "GET" ["/pet/",toPath petId] + -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept +getPetById _ (PetId petId) = + _mkRequest "GET" ["/pet/",toPath petId] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) data GetPetById @@ -198,14 +198,14 @@ -- AuthMethod: 'AuthOAuthPetstoreAuth' -- updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => ContentType contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent -updatePet _ body = + -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent +updatePet _ body = _mkRequest "PUT" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body + `setBodyParam` body data UpdatePet @@ -232,21 +232,21 @@ :: (Consumes UpdatePetWithForm MimeFormUrlEncoded) => PetId -- ^ "petId" - ID of pet that needs to be updated -> OpenAPIPetstoreRequest UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent -updatePetWithForm (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId] +updatePetWithForm (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet instance HasOptionalParam UpdatePetWithForm Name2 where - applyOptionalParam req (Name2 xs) = - req `addForm` toForm ("name", xs) + applyOptionalParam req (Name2 xs) = + req `addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet instance HasOptionalParam UpdatePetWithForm StatusText where - applyOptionalParam req (StatusText xs) = - req `addForm` toForm ("status", xs) + applyOptionalParam req (StatusText xs) = + req `addForm` toForm ("status", xs) -- | @application/x-www-form-urlencoded@ instance Consumes UpdatePetWithForm MimeFormUrlEncoded @@ -266,21 +266,21 @@ :: (Consumes UploadFile MimeMultipartFormData) => PetId -- ^ "petId" - ID of pet to update -> OpenAPIPetstoreRequest UploadFile MimeMultipartFormData ApiResponse MimeJSON -uploadFile (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] +uploadFile (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UploadFile -- | /Optional Param/ "additionalMetadata" - Additional data to pass to server instance HasOptionalParam UploadFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) + applyOptionalParam req (AdditionalMetadata xs) = + req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) -- | /Optional Param/ "file" - file to upload instance HasOptionalParam UploadFile File2 where - applyOptionalParam req (File2 xs) = - req `_addMultiFormPart` NH.partFileSource "file" xs + applyOptionalParam req (File2 xs) = + req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ instance Consumes UploadFile MimeMultipartFormData @@ -302,17 +302,17 @@ => RequiredFile -- ^ "requiredFile" - file to upload -> PetId -- ^ "petId" - ID of pet to update -> OpenAPIPetstoreRequest UploadFileWithRequiredFile MimeMultipartFormData ApiResponse MimeJSON -uploadFileWithRequiredFile (RequiredFile requiredFile) (PetId petId) = - _mkRequest "POST" ["/fake/",toPath petId,"/uploadImageWithRequiredFile"] +uploadFileWithRequiredFile (RequiredFile requiredFile) (PetId petId) = + _mkRequest "POST" ["/fake/",toPath petId,"/uploadImageWithRequiredFile"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `_addMultiFormPart` NH.partFileSource "requiredFile" requiredFile + `_addMultiFormPart` NH.partFileSource "requiredFile" requiredFile data UploadFileWithRequiredFile -- | /Optional Param/ "additionalMetadata" - Additional data to pass to server instance HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) + applyOptionalParam req (AdditionalMetadata xs) = + req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) -- | @multipart/form-data@ instance Consumes UploadFileWithRequiredFile MimeMultipartFormData diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html index 1f1f7ef41869..4f6cf6a60713 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html @@ -68,8 +68,8 @@ deleteOrder :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted -> OpenAPIPetstoreRequest DeleteOrder MimeNoContent NoContent MimeNoContent -deleteOrder (OrderIdText orderId) = - _mkRequest "DELETE" ["/store/order/",toPath orderId] +deleteOrder (OrderIdText orderId) = + _mkRequest "DELETE" ["/store/order/",toPath orderId] data DeleteOrder instance Produces DeleteOrder MimeNoContent @@ -105,11 +105,11 @@ -- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -- getOrderById - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> OrderId -- ^ "orderId" - ID of pet that needs to be fetched - -> OpenAPIPetstoreRequest GetOrderById MimeNoContent Order accept -getOrderById _ (OrderId orderId) = - _mkRequest "GET" ["/store/order/",toPath orderId] + -> OpenAPIPetstoreRequest GetOrderById MimeNoContent Order accept +getOrderById _ (OrderId orderId) = + _mkRequest "GET" ["/store/order/",toPath orderId] data GetOrderById -- | @application/xml@ @@ -125,14 +125,14 @@ -- Place an order for a pet -- placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') + :: (Consumes PlaceOrder contentType, MimeRender contentType Order) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') -> Order -- ^ "body" - order placed for purchasing the pet - -> OpenAPIPetstoreRequest PlaceOrder contentType Order accept -placeOrder _ _ body = + -> OpenAPIPetstoreRequest PlaceOrder contentType Order accept +placeOrder _ _ body = _mkRequest "POST" ["/store/order"] - `setBodyParam` body + `setBodyParam` body data PlaceOrder @@ -140,7 +140,7 @@ instance HasBodyParam PlaceOrder Order -- | @*/*@ -instance MimeType mtype => Consumes PlaceOrder mtype +instance MimeType mtype => Consumes PlaceOrder mtype -- | @application/xml@ instance Produces PlaceOrder MimeXML diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html index e28e1d492bd3..c1fee5ceb552 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html @@ -66,13 +66,13 @@ -- This can only be done by the logged in user. -- createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUser contentType, MimeRender contentType User) + => ContentType contentType -- ^ request content-type ('MimeType') -> User -- ^ "body" - Created user object - -> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent -createUser _ body = + -> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent +createUser _ body = _mkRequest "POST" ["/user"] - `setBodyParam` body + `setBodyParam` body data CreateUser @@ -80,7 +80,7 @@ instance HasBodyParam CreateUser User -- | @*/*@ -instance MimeType mtype => Consumes CreateUser mtype +instance MimeType mtype => Consumes CreateUser mtype instance Produces CreateUser MimeNoContent @@ -92,13 +92,13 @@ -- Creates list of users with given input array -- createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) + => ContentType contentType -- ^ request content-type ('MimeType') -> Body -- ^ "body" - List of user object - -> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent -createUsersWithArrayInput _ body = + -> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent +createUsersWithArrayInput _ body = _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithArrayInput @@ -106,7 +106,7 @@ instance HasBodyParam CreateUsersWithArrayInput Body -- | @*/*@ -instance MimeType mtype => Consumes CreateUsersWithArrayInput mtype +instance MimeType mtype => Consumes CreateUsersWithArrayInput mtype instance Produces CreateUsersWithArrayInput MimeNoContent @@ -118,13 +118,13 @@ -- Creates list of users with given input array -- createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) + => ContentType contentType -- ^ request content-type ('MimeType') -> Body -- ^ "body" - List of user object - -> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent -createUsersWithListInput _ body = + -> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent +createUsersWithListInput _ body = _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithListInput @@ -132,7 +132,7 @@ instance HasBodyParam CreateUsersWithListInput Body -- | @*/*@ -instance MimeType mtype => Consumes CreateUsersWithListInput mtype +instance MimeType mtype => Consumes CreateUsersWithListInput mtype instance Produces CreateUsersWithListInput MimeNoContent @@ -148,8 +148,8 @@ deleteUser :: Username -- ^ "username" - The name that needs to be deleted -> OpenAPIPetstoreRequest DeleteUser MimeNoContent NoContent MimeNoContent -deleteUser (Username username) = - _mkRequest "DELETE" ["/user/",toPath username] +deleteUser (Username username) = + _mkRequest "DELETE" ["/user/",toPath username] data DeleteUser instance Produces DeleteUser MimeNoContent @@ -162,11 +162,11 @@ -- Get user by user name -- getUserByName - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept -getUserByName _ (Username username) = - _mkRequest "GET" ["/user/",toPath username] + -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept +getUserByName _ (Username username) = + _mkRequest "GET" ["/user/",toPath username] data GetUserByName -- | @application/xml@ @@ -182,14 +182,14 @@ -- Logs user into the system -- loginUser - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Username -- ^ "username" - The user name for login -> Password -- ^ "password" - The password for login in clear text - -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept -loginUser _ (Username username) (Password password) = + -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept +loginUser _ (Username username) (Password password) = _mkRequest "GET" ["/user/login"] - `setQuery` toQuery ("username", Just username) - `setQuery` toQuery ("password", Just password) + `setQuery` toQuery ("username", Just username) + `setQuery` toQuery ("password", Just password) data LoginUser -- | @application/xml@ @@ -222,14 +222,14 @@ -- This can only be done by the logged in user. -- updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdateUser contentType, MimeRender contentType User) + => ContentType contentType -- ^ request content-type ('MimeType') -> User -- ^ "body" - Updated user object -> Username -- ^ "username" - name that need to be deleted - -> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent -updateUser _ body (Username username) = - _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body + -> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent +updateUser _ body (Username username) = + _mkRequest "PUT" ["/user/",toPath username] + `setBodyParam` body data UpdateUser @@ -237,7 +237,7 @@ instance HasBodyParam UpdateUser User -- | @*/*@ -instance MimeType mtype => Consumes UpdateUser mtype +instance MimeType mtype => Consumes UpdateUser mtype instance Produces UpdateUser MimeNoContent diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html index d33f0a636969..41359014a157 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html @@ -55,20 +55,20 @@ -- | send a request returning the raw http response dispatchLbs - :: (Produces req accept, MimeType contentType) + :: (Produces req accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request = do - initReq <- _toInitRequest config request - dispatchInitUnsafe manager config initReq +dispatchLbs manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq -- ** Mime -- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Show, Functor, Foldable, Traversable) @@ -82,137 +82,137 @@ -- | send a request returning the 'MimeResult' dispatchMime - :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request = do - httpResponse <- dispatchLbs manager config request - let statusCode = NH.statusCode . NH.responseStatus $ httpResponse - parsedResult <- - runConfigLogWithExceptions "Client" config $ - do if (statusCode >= 400 && statusCode < 600) + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request = do + httpResponse <- dispatchLbs manager config request + let statusCode = NH.statusCode . NH.responseStatus $ httpResponse + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do if (statusCode >= 400 && statusCode < 600) then do - let s = "error statusCode: " ++ show statusCode - _log "Client" levelError (T.pack s) - pure (Left (MimeError s httpResponse)) - else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of - Left s -> do - _log "Client" levelError (T.pack s) - pure (Left (MimeError s httpResponse)) - Right r -> pure (Right r) - return (MimeResult parsedResult httpResponse) + let s = "error statusCode: " ++ show statusCode + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of + Left s -> do + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + Right r -> pure (Right r) + return (MimeResult parsedResult httpResponse) -- | like 'dispatchMime', but only returns the decoded http body dispatchMime' - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request = do - MimeResult parsedResult _ <- dispatchMime manager config request - return parsedResult + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request = do + MimeResult parsedResult _ <- dispatchMime manager config request + return parsedResult -- ** Unsafe -- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented) dispatchLbsUnsafe - :: (MimeType accept, MimeType contentType) + :: (MimeType accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request = do - initReq <- _toInitRequest config request - dispatchInitUnsafe manager config initReq +dispatchLbsUnsafe manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq -- | dispatch an InitRequest dispatchInitUnsafe :: NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> InitRequest req contentType res accept -- ^ init request + -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchInitUnsafe manager config (InitRequest req) = do - runConfigLogWithExceptions src config $ - do _log src levelInfo requestLogMsg - _log src levelDebug requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - _log src levelInfo (responseLogMsg res) - _log src levelDebug ((T.pack . show) res) - return res +dispatchInitUnsafe manager config (InitRequest req) = do + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) + return res where - src = "Client" - endpoint = + src = "Client" + endpoint = T.pack $ BC.unpack $ - NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req - requestLogMsg = "REQ:" <> endpoint - requestDbgLogMsg = - "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> - (case NH.requestBody req of - NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) + NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req + requestLogMsg = "REQ:" <> endpoint + requestDbgLogMsg = + "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> + (case NH.requestBody req of + NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) _ -> "<RequestBody>") - responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus - responseLogMsg res = - "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" + responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus + responseLogMsg res = + "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" -- * InitRequest -- | wraps an http-client 'Request' with request/response type parameters -newtype InitRequest req contentType res accept = InitRequest +newtype InitRequest req contentType res accept = InitRequest { unInitRequest :: NH.Request } deriving (Show) -- | Build an http-client 'Request' record from the supplied config and request _toInitRequest - :: (MimeType accept, MimeType contentType) + :: (MimeType accept, MimeType contentType) => OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 = - runConfigLogWithExceptions "Client" config $ do - parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - req1 <- P.liftIO $ _applyAuthMethods req0 config + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 = + runConfigLogWithExceptions "Client" config $ do + parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + req1 <- P.liftIO $ _applyAuthMethods req0 config P.when - (configValidateAuthMethods config && (not . null . rAuthTypes) req1) - (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) - let req2 = req1 & _setContentTypeHeader & _setAcceptHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2) - reqQuery = NH.renderQuery True (paramsQuery (rParams req2)) - pReq = parsedReq { NH.method = (rMethod req2) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + (configValidateAuthMethods config && (not . null . rAuthTypes) req1) + (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & _setAcceptHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2) + reqQuery = NH.renderQuery True (paramsQuery (rParams req2)) + pReq = parsedReq { NH.method = (rMethod req2) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (rParams req2) of - ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) - ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) - ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) - ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) - ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq + outReq <- case paramsBody (rParams req2) of + ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) + ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) + ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) + ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) + ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq - pure (InitRequest outReq) + pure (InitRequest outReq) -- | modify the underlying Request -modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept -modifyInitRequest (InitRequest req) f = InitRequest (f req) +modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept +modifyInitRequest (InitRequest req) f = InitRequest (f req) -- | modify the underlying Request (monadic) -modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) -modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) +modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) +modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) -- ** Logging -- | Run a block using the configured logger instance runConfigLog - :: P.MonadIO m - => OpenAPIPetstoreConfig -> LogExec m -runConfigLog config = configLogExecWithContext config (configLogContext config) + :: P.MonadIO m + => OpenAPIPetstoreConfig -> LogExec m +runConfigLog config = configLogExecWithContext config (configLogContext config) -- | Run a block using the configured logger instance (logs exceptions) runConfigLogWithExceptions - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> OpenAPIPetstoreConfig -> LogExec m -runConfigLogWithExceptions src config = runConfigLog config . logExceptions src + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> OpenAPIPetstoreConfig -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html index 8d9bc8471481..1af661718b0a 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html @@ -73,19 +73,19 @@ data OpenAPIPetstoreConfig = OpenAPIPetstoreConfig { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance - , configLogContext :: LogContext -- ^ Configures the logger + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods , configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured } -- | display the config instance P.Show OpenAPIPetstoreConfig where - show c = + show c = T.printf "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) + (show (configHost c)) + (show (configUserAgent c)) -- | constructs a default OpenAPIPetstoreConfig -- @@ -99,36 +99,36 @@ -- newConfig :: IO OpenAPIPetstoreConfig newConfig = do - logCxt <- initLogContext + logCxt <- initLogContext return $ OpenAPIPetstoreConfig { configHost = "http://petstore.swagger.io:80/v2" , configUserAgent = "openapi-petstore/0.1.0.0" - , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt , configAuthMethods = [] , configValidateAuthMethods = True } -- | updates config use AuthMethod on matching requests -addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig -addAuthMethod config@OpenAPIPetstoreConfig {configAuthMethods = as} a = - config { configAuthMethods = AnyAuthMethod a : as} +addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig +addAuthMethod config@OpenAPIPetstoreConfig {configAuthMethods = as} a = + config { configAuthMethods = AnyAuthMethod a : as} -- | updates the config to use stdout logging withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig -withStdoutLogging p = do - logCxt <- stdoutLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } -- | updates the config to use stderr logging withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig -withStderrLogging p = do - logCxt <- stderrLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } -- | updates the config to disable logging withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig -withNoLogging p = p { configLogExecWithContext = runNullLogExec} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * OpenAPIPetstoreRequest @@ -140,7 +140,7 @@ -- * contentType - 'MimeType' associated with request body -- * res - response model -- * accept - 'MimeType' associated with response body -data OpenAPIPetstoreRequest req contentType res accept = OpenAPIPetstoreRequest +data OpenAPIPetstoreRequest req contentType res accept = OpenAPIPetstoreRequest { rMethod :: NH.Method -- ^ Method of OpenAPIPetstoreRequest , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of OpenAPIPetstoreRequest , rParams :: Params -- ^ params of OpenAPIPetstoreRequest @@ -149,47 +149,47 @@ deriving (P.Show) -- | 'rMethod' Lens -rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) NH.Method -rMethodL f OpenAPIPetstoreRequest{..} = (\rMethod -> OpenAPIPetstoreRequest { rMethod, ..} ) <$> f rMethod +rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) NH.Method +rMethodL f OpenAPIPetstoreRequest{..} = (\rMethod -> OpenAPIPetstoreRequest { rMethod, ..} ) <$> f rMethod {-# INLINE rMethodL #-} -- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [BCL.ByteString] -rUrlPathL f OpenAPIPetstoreRequest{..} = (\rUrlPath -> OpenAPIPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [BCL.ByteString] +rUrlPathL f OpenAPIPetstoreRequest{..} = (\rUrlPath -> OpenAPIPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath {-# INLINE rUrlPathL #-} -- | 'rParams' Lens -rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params -rParamsL f OpenAPIPetstoreRequest{..} = (\rParams -> OpenAPIPetstoreRequest { rParams, ..} ) <$> f rParams +rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params +rParamsL f OpenAPIPetstoreRequest{..} = (\rParams -> OpenAPIPetstoreRequest { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} -- | 'rParams' Lens -rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [P.TypeRep] -rAuthTypesL f OpenAPIPetstoreRequest{..} = (\rAuthTypes -> OpenAPIPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes +rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [P.TypeRep] +rAuthTypesL f OpenAPIPetstoreRequest{..} = (\rAuthTypes -> OpenAPIPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes {-# INLINE rAuthTypesL #-} -- * HasBodyParam -- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept - setBodyParam req xs = - req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader +class HasBodyParam req param where + setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader -- * HasOptionalParam -- | Designates the optional parameters of a request -class HasOptionalParam req param where +class HasOptionalParam req param where {-# MINIMAL applyOptionalParam | (-&-) #-} -- | Apply an optional parameter to a request - applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept - applyOptionalParam = (-&-) + applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept + applyOptionalParam = (-&-) {-# INLINE applyOptionalParam #-} -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept - (-&-) = applyOptionalParam + (-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept + (-&-) = applyOptionalParam {-# INLINE (-&-) #-} infixl 2 -&- @@ -204,17 +204,17 @@ -- | 'paramsQuery' Lens paramsQueryL :: Lens_' Params NH.Query -paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery +paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery {-# INLINE paramsQueryL #-} -- | 'paramsHeaders' Lens paramsHeadersL :: Lens_' Params NH.RequestHeaders -paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders +paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders {-# INLINE paramsHeadersL #-} -- | 'paramsBody' Lens paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody {-# INLINE paramsBodyL #-} -- | Request Body @@ -230,90 +230,90 @@ _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint - -> OpenAPIPetstoreRequest req contentType res accept -- ^ req: Request Type, res: Response Type -_mkRequest m u = OpenAPIPetstoreRequest m u _mkParams [] + -> OpenAPIPetstoreRequest req contentType res accept -- ^ req: Request Type, res: Response Type +_mkRequest m u = OpenAPIPetstoreRequest m u _mkParams [] _mkParams :: Params _mkParams = Params [] [] ParamBodyNone -setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.Header] -> OpenAPIPetstoreRequest req contentType res accept -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) +setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.Header] -> OpenAPIPetstoreRequest req contentType res accept +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) -removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.HeaderName] -> OpenAPIPetstoreRequest req contentType res accept -removeHeader req header = - req & +removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.HeaderName] -> OpenAPIPetstoreRequest req contentType res accept +removeHeader req header = + req & L.over (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept -_setContentTypeHeader req = - case mimeType (P.Proxy :: P.Proxy contentType) of - Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["content-type"] +_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept +_setContentTypeHeader req = + case mimeType (P.Proxy :: P.Proxy contentType) of + Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["content-type"] -_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept -_setAcceptHeader req = - case mimeType (P.Proxy :: P.Proxy accept) of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] +_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept +_setAcceptHeader req = + case mimeType (P.Proxy :: P.Proxy accept) of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] -setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [NH.QueryItem] -> OpenAPIPetstoreRequest req contentType res accept -setQuery req query = - req & +setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [NH.QueryItem] -> OpenAPIPetstoreRequest req contentType res accept +setQuery req query = + req & L.over (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -addForm :: OpenAPIPetstoreRequest req contentType res accept -> WH.Form -> OpenAPIPetstoreRequest req contentType res accept -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form +addForm :: OpenAPIPetstoreRequest req contentType res accept -> WH.Form -> OpenAPIPetstoreRequest req contentType res accept +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) -_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> NH.Part -> OpenAPIPetstoreRequest req contentType res accept -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> NH.Part -> OpenAPIPetstoreRequest req contentType res accept +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) -_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> B.ByteString -> OpenAPIPetstoreRequest req contentType res accept -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) +_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> B.ByteString -> OpenAPIPetstoreRequest req contentType res accept +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) -_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> BL.ByteString -> OpenAPIPetstoreRequest req contentType res accept -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> BL.ByteString -> OpenAPIPetstoreRequest req contentType res accept +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> P.Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) +_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> P.Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) -- ** Params Utils toPath - :: WH.ToHttpApiData a - => a -> BCL.ByteString + :: WH.ToHttpApiData a + => a -> BCL.ByteString toPath = BB.toLazyByteString . WH.toEncodedUrlPiece -toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] -toHeader x = [fmap WH.toHeader x] +toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] +toHeader x = [fmap WH.toHeader x] -toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form -toForm (k,v) = WH.toForm [(BC.unpack k,v)] +toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form +toForm (k,v) = WH.toForm [(BC.unpack k,v)] -toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] -toQuery x = [(fmap . fmap) toQueryParam x] - where toQueryParam = T.encodeUtf8 . WH.toQueryParam +toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] +toQuery x = [(fmap . fmap) toQueryParam x] + where toQueryParam = T.encodeUtf8 . WH.toQueryParam -- *** OpenAPI `CollectionFormat` Utils @@ -325,38 +325,38 @@ | PipeSeparated -- ^ `value1|value2|value2` | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form') -toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] -toHeaderColl c xs = _toColl c toHeader xs +toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] +toHeaderColl c xs = _toColl c toHeader xs -toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form -toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs +toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form +toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs where - pack (k,v) = (CI.mk k, v) - unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) + pack (k,v) = (CI.mk k, v) + unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) -toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query -toQueryColl c xs = _toCollA c toQuery xs +toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query +toQueryColl c xs = _toCollA c toQuery xs -_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] -_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) - where fencode = fmap (fmap Just) . encode . fmap P.fromJust +_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] +_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) + where fencode = fmap (fmap Just) . encode . fmap P.fromJust {-# INLINE fencode #-} -_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] -_toCollA c encode xs = _toCollA' c encode BC.singleton xs +_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] +_toCollA c encode xs = _toCollA' c encode BC.singleton xs -_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] -_toCollA' c encode one xs = case c of - CommaSeparated -> go (one ',') - SpaceSeparated -> go (one ' ') - TabSeparated -> go (one '\t') - PipeSeparated -> go (one '|') - MultiParamArray -> expandList +_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] +_toCollA' c encode one xs = case c of + CommaSeparated -> go (one ',') + SpaceSeparated -> go (one ' ') + TabSeparated -> go (one '\t') + PipeSeparated -> go (one '|') + MultiParamArray -> expandList where - go sep = - [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] - combine sep x y = x <> sep <> y - expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs + go sep = + [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] + combine sep x y = x <> sep <> y + expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs {-# INLINE go #-} {-# INLINE expandList #-} {-# INLINE combine #-} @@ -364,18 +364,18 @@ -- * AuthMethods -- | Provides a method to apply auth methods to requests -class P.Typeable a => - AuthMethod a where +class P.Typeable a => + AuthMethod a where applyAuthMethod :: OpenAPIPetstoreConfig - -> a - -> OpenAPIPetstoreRequest req contentType res accept - -> IO (OpenAPIPetstoreRequest req contentType res accept) + -> a + -> OpenAPIPetstoreRequest req contentType res accept + -> IO (OpenAPIPetstoreRequest req contentType res accept) -- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) -instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req +instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req -- | indicates exceptions related to AuthMethods data AuthMethodException = AuthMethodException String deriving (P.Show, P.Typeable) @@ -384,37 +384,37 @@ -- | apply all matching AuthMethods in config to request _applyAuthMethods - :: OpenAPIPetstoreRequest req contentType res accept + :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig - -> IO (OpenAPIPetstoreRequest req contentType res accept) -_applyAuthMethods req config@(OpenAPIPetstoreConfig {configAuthMethods = as}) = - foldlM go req as + -> IO (OpenAPIPetstoreRequest req contentType res accept) +_applyAuthMethods req config@(OpenAPIPetstoreConfig {configAuthMethods = as}) = + foldlM go req as where - go r (AnyAuthMethod a) = applyAuthMethod config a r + go r (AnyAuthMethod a) = applyAuthMethod config a r -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) _omitNulls :: [(Text, A.Value)] -> A.Value -_omitNulls = A.object . P.filter notNull +_omitNulls = A.object . P.filter notNull where - notNull (_, A.Null) = False + notNull (_, A.Null) = False notNull _ = True -- | Encodes fields using WH.toQueryParam -_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) -_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x -- | Collapse (Just "") to Nothing _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing -_emptyToNothing x = x +_emptyToNothing x = x {-# INLINE _emptyToNothing #-} -- | Collapse (Just mempty) to Nothing -_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a -_memptyToNothing (Just x) | x P.== P.mempty = Nothing -_memptyToNothing x = x +_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a +_memptyToNothing (Just x) | x P.== P.mempty = Nothing +_memptyToNothing x = x {-# INLINE _memptyToNothing #-} -- * DateTime Formatting @@ -422,35 +422,35 @@ newtype DateTime = DateTime { unDateTime :: TI.UTCTime } deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) instance A.FromJSON DateTime where - parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) instance A.ToJSON DateTime where - toJSON (DateTime t) = A.toJSON (_showDateTime t) + toJSON (DateTime t) = A.toJSON (_showDateTime t) instance WH.FromHttpApiData DateTime where - parseUrlPiece = P.left T.pack . _readDateTime . T.unpack + parseUrlPiece = P.left T.pack . _readDateTime . T.unpack instance WH.ToHttpApiData DateTime where - toUrlPiece (DateTime t) = T.pack (_showDateTime t) + toUrlPiece (DateTime t) = T.pack (_showDateTime t) instance P.Show DateTime where - show (DateTime t) = _showDateTime t + show (DateTime t) = _showDateTime t instance MimeRender MimeMultipartFormData DateTime where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | @_parseISO8601@ -_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _readDateTime = _parseISO8601 {-# INLINE _readDateTime #-} -- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String +_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} -- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] {-# INLINE _parseISO8601 #-} @@ -459,26 +459,26 @@ newtype Date = Date { unDate :: TI.Day } deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) instance A.FromJSON Date where - parseJSON = A.withText "Date" (_readDate . T.unpack) + parseJSON = A.withText "Date" (_readDate . T.unpack) instance A.ToJSON Date where - toJSON (Date t) = A.toJSON (_showDate t) + toJSON (Date t) = A.toJSON (_showDate t) instance WH.FromHttpApiData Date where - parseUrlPiece = P.left T.pack . _readDate . T.unpack + parseUrlPiece = P.left T.pack . _readDate . T.unpack instance WH.ToHttpApiData Date where - toUrlPiece (Date t) = T.pack (_showDate t) + toUrlPiece (Date t) = T.pack (_showDate t) instance P.Show Date where - show (Date t) = _showDate t + show (Date t) = _showDate t instance MimeRender MimeMultipartFormData Date where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_readDate :: (TI.ParseTime t, Monad m) => String -> m t +_readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} -- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ -_showDate :: TI.FormatTime t => t -> String +_showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} @@ -491,20 +491,20 @@ deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) instance A.FromJSON ByteArray where - parseJSON = A.withText "ByteArray" _readByteArray + parseJSON = A.withText "ByteArray" _readByteArray instance A.ToJSON ByteArray where - toJSON = A.toJSON . _showByteArray + toJSON = A.toJSON . _showByteArray instance WH.FromHttpApiData ByteArray where - parseUrlPiece = P.left T.pack . _readByteArray + parseUrlPiece = P.left T.pack . _readByteArray instance WH.ToHttpApiData ByteArray where - toUrlPiece = _showByteArray + toUrlPiece = _showByteArray instance P.Show ByteArray where - show = T.unpack . _showByteArray + show = T.unpack . _showByteArray instance MimeRender MimeMultipartFormData ByteArray where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray :: Monad m => Text -> m ByteArray _readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 {-# INLINE _readByteArray #-} @@ -518,19 +518,19 @@ deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) instance A.FromJSON Binary where - parseJSON = A.withText "Binary" _readBinaryBase64 + parseJSON = A.withText "Binary" _readBinaryBase64 instance A.ToJSON Binary where - toJSON = A.toJSON . _showBinaryBase64 + toJSON = A.toJSON . _showBinaryBase64 instance WH.FromHttpApiData Binary where - parseUrlPiece = P.left T.pack . _readBinaryBase64 + parseUrlPiece = P.left T.pack . _readBinaryBase64 instance WH.ToHttpApiData Binary where - toUrlPiece = _showBinaryBase64 + toUrlPiece = _showBinaryBase64 instance P.Show Binary where - show = T.unpack . _showBinaryBase64 + show = T.unpack . _showBinaryBase64 instance MimeRender MimeMultipartFormData Binary where - mimeRender _ = unBinary + mimeRender _ = unBinary -_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 :: Monad m => Text -> m Binary _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 {-# INLINE _readBinaryBase64 #-} @@ -540,6 +540,6 @@ -- * Lens Type Aliases -type Lens_' s a = Lens_ s s a a -type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t +type Lens_' s a = Lens_ s s a a +type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html index eb08cee1d481..f954bf53ddc6 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html @@ -17,18 +17,18 @@ #ifdef USE_KATIP module OpenAPIPetstore.Logging - ( module OpenAPIPetstore.LoggingKatip + ( module OpenAPIPetstore.LoggingKatip ) where -import OpenAPIPetstore.LoggingKatip +import OpenAPIPetstore.LoggingKatip #else module OpenAPIPetstore.Logging - ( module OpenAPIPetstore.LoggingMonadLogger + ( module OpenAPIPetstore.LoggingMonadLogger ) where -import OpenAPIPetstore.LoggingMonadLogger +import OpenAPIPetstore.LoggingMonadLogger #endif \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.LoggingKatip.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.LoggingKatip.html new file mode 100644 index 000000000000..df2253203086 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.LoggingKatip.html @@ -0,0 +1,119 @@ +
    {-
    +   OpenAPI Petstore
    +
    +   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
    +
    +   OpenAPI Version: 3.0.1
    +   OpenAPI Petstore API version: 1.0.0
    +   Generated by OpenAPI Generator (https://openapi-generator.tech)
    +-}
    +
    +{-|
    +Module : OpenAPIPetstore.LoggingKatip
    +Katip Logging functions
    +-}
    +
    +{-# LANGUAGE OverloadedStrings #-}
    +{-# LANGUAGE RankNTypes #-}
    +{-# LANGUAGE ScopedTypeVariables #-}
    +
    +module OpenAPIPetstore.LoggingKatip where
    +
    +import qualified Control.Exception.Safe as E
    +import qualified Control.Monad.IO.Class as P
    +import qualified Control.Monad.Trans.Reader as P
    +import qualified Data.Text as T
    +import qualified Lens.Micro as L
    +import qualified System.IO as IO
    +
    +import Data.Text (Text)
    +import GHC.Exts (IsString(..))
    +
    +import qualified Katip as LG
    +
    +-- * Type Aliases (for compatibility)
    +
    +-- | Runs a Katip logging block with the Log environment
    +type LogExecWithContext = forall m. P.MonadIO m =>
    +                                    LogContext -> LogExec m
    +
    +-- | A Katip logging block
    +type LogExec m = forall a. LG.KatipT m a -> m a
    +
    +-- | A Katip Log environment
    +type LogContext = LG.LogEnv
    +
    +-- | A Katip Log severity
    +type LogLevel = LG.Severity
    +
    +-- * default logger
    +
    +-- | the default log environment
    +initLogContext :: IO LogContext
    +initLogContext = LG.initLogEnv "OpenAPIPetstore" "dev"
    +
    +-- | Runs a Katip logging block with the Log environment
    +runDefaultLogExecWithContext :: LogExecWithContext
    +runDefaultLogExecWithContext = LG.runKatipT
    +
    +-- * stdout logger
    +
    +-- | Runs a Katip logging block with the Log environment
    +stdoutLoggingExec :: LogExecWithContext
    +stdoutLoggingExec = runDefaultLogExecWithContext
    +
    +-- | A Katip Log environment which targets stdout
    +stdoutLoggingContext :: LogContext -> IO LogContext
    +stdoutLoggingContext cxt = do
    +    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout (LG.permitItem LG.InfoS) LG.V2
    +    LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt
    +
    +-- * stderr logger
    +
    +-- | Runs a Katip logging block with the Log environment
    +stderrLoggingExec :: LogExecWithContext
    +stderrLoggingExec = runDefaultLogExecWithContext
    +
    +-- | A Katip Log environment which targets stderr
    +stderrLoggingContext :: LogContext -> IO LogContext
    +stderrLoggingContext cxt = do
    +    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr (LG.permitItem LG.InfoS) LG.V2
    +    LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
    +
    +-- * Null logger
    +
    +-- | Disables Katip logging
    +runNullLogExec :: LogExecWithContext
    +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)
    +
    +-- * Log Msg
    +
    +-- | Log a katip message
    +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()
    +_log src level msg = do
    +  LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)
    +
    +-- * Log Exceptions
    +
    +-- | re-throws exceptions after logging them
    +logExceptions
    +  :: (LG.Katip m, E.MonadCatch m, Applicative m)
    +  => Text -> m a -> m a
    +logExceptions src =
    +  E.handle
    +    (\(e :: E.SomeException) -> do
    +       _log src LG.ErrorS ((T.pack . show) e)
    +       E.throw e)
    +
    +-- * Log Level
    +
    +levelInfo :: LogLevel
    +levelInfo = LG.InfoS
    +
    +levelError :: LogLevel
    +levelError = LG.ErrorS
    +
    +levelDebug :: LogLevel
    +levelDebug = LG.DebugS
    +
    +
    \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.LoggingMonadLogger.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.LoggingMonadLogger.html deleted file mode 100644 index 116d7e731f74..000000000000 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.LoggingMonadLogger.html +++ /dev/null @@ -1,128 +0,0 @@ -
    {-
    -   OpenAPI Petstore
    -
    -   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
    -
    -   OpenAPI Version: 3.0.1
    -   OpenAPI Petstore API version: 1.0.0
    -   Generated by OpenAPI Generator (https://openapi-generator.tech)
    --}
    -
    -{-|
    -Module : OpenAPIPetstore.LoggingMonadLogger
    -monad-logger Logging functions
    --}
    -
    -{-# LANGUAGE OverloadedStrings #-}
    -{-# LANGUAGE RankNTypes #-}
    -{-# LANGUAGE ScopedTypeVariables #-}
    -
    -module OpenAPIPetstore.LoggingMonadLogger where
    -
    -import qualified Control.Exception.Safe as E
    -import qualified Control.Monad.IO.Class as P
    -import qualified Data.Text as T
    -import qualified Data.Time as TI
    -
    -import Data.Monoid ((<>))
    -import Data.Text (Text)
    -
    -import qualified Control.Monad.Logger as LG
    -
    --- * Type Aliases (for compatibility)
    -
    --- | Runs a monad-logger  block with the filter predicate
    -type LogExecWithContext = forall m. P.MonadIO m =>
    -                                    LogContext -> LogExec m
    -
    --- | A monad-logger block
    -type LogExec m = forall a. LG.LoggingT m a -> m a
    -
    --- | A monad-logger filter predicate
    -type LogContext = LG.LogSource -> LG.LogLevel -> Bool
    -
    --- | A monad-logger log level
    -type LogLevel = LG.LogLevel
    -
    --- * default logger
    -
    --- | the default log environment
    -initLogContext :: IO LogContext
    -initLogContext = pure infoLevelFilter
    -
    --- | Runs a monad-logger block with the filter predicate
    -runDefaultLogExecWithContext :: LogExecWithContext
    -runDefaultLogExecWithContext = runNullLogExec
    -
    --- * stdout logger
    -
    --- | Runs a monad-logger block targeting stdout, with the filter predicate
    -stdoutLoggingExec :: LogExecWithContext
    -stdoutLoggingExec cxt = LG.runStdoutLoggingT . LG.filterLogger cxt
    -
    --- | @pure@
    -stdoutLoggingContext :: LogContext -> IO LogContext
    -stdoutLoggingContext = pure
    -
    --- * stderr logger
    -
    --- | Runs a monad-logger block targeting stderr, with the filter predicate
    -stderrLoggingExec :: LogExecWithContext
    -stderrLoggingExec cxt = LG.runStderrLoggingT . LG.filterLogger cxt
    -
    --- | @pure@
    -stderrLoggingContext :: LogContext -> IO LogContext
    -stderrLoggingContext = pure
    -
    --- * Null logger
    -
    --- | Disables monad-logger logging
    -runNullLogExec :: LogExecWithContext
    -runNullLogExec = const (`LG.runLoggingT` nullLogger)
    -
    --- | monad-logger which does nothing
    -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO ()
    -nullLogger _ _ _ _ = return ()
    -
    --- * Log Msg
    -
    --- | Log a message using the current time
    -_log :: (P.MonadIO m, LG.MonadLogger m) => Text -> LG.LogLevel -> Text -> m ()
    -_log src level msg = do
    -  now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime)
    -  LG.logOtherNS ("OpenAPIPetstore." <> src) level ("[" <> now <> "] " <> msg)
    - where
    -  formatTimeLog =
    -    T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z"
    -
    --- * Log Exceptions
    -
    --- | re-throws exceptions after logging them
    -logExceptions
    -   :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m)
    -   => Text -> m a -> m a
    -logExceptions src =
    -   E.handle
    -     (\(e :: E.SomeException) -> do
    -        _log src LG.LevelError ((T.pack . show) e)
    -        E.throw e)
    -
    --- * Log Level
    -
    -levelInfo :: LogLevel
    -levelInfo = LG.LevelInfo
    -
    -levelError :: LogLevel
    -levelError = LG.LevelError
    -
    -levelDebug :: LogLevel
    -levelDebug = LG.LevelDebug
    -
    --- * Level Filter
    -
    -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool
    -minLevelFilter l _ l' = l' >= l
    -
    -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool
    -infoLevelFilter = minLevelFilter LG.LevelInfo
    -
    \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html index 3c4e355945d3..bb271a2362c7 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html @@ -44,19 +44,19 @@ -- * ContentType MimeType -data ContentType a = MimeType a => ContentType { unContentType :: a } +data ContentType a = MimeType a => ContentType { unContentType :: a } -- * Accept MimeType -data Accept a = MimeType a => Accept { unAccept :: a } +data Accept a = MimeType a => Accept { unAccept :: a } -- * Consumes Class -class MimeType mtype => Consumes req mtype where +class MimeType mtype => Consumes req mtype where -- * Produces Class -class MimeType mtype => Produces req mtype where +class MimeType mtype => Produces req mtype where -- * Default Mime Types @@ -76,129 +76,129 @@ -- * MimeType Class -class P.Typeable mtype => MimeType mtype where +class P.Typeable mtype => MimeType mtype where {-# MINIMAL mimeType | mimeTypes #-} - mimeTypes :: P.Proxy mtype -> [ME.MediaType] - mimeTypes p = - case mimeType p of - Just x -> [x] + mimeTypes :: P.Proxy mtype -> [ME.MediaType] + mimeTypes p = + case mimeType p of + Just x -> [x] Nothing -> [] - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of [] -> Nothing - (x:_) -> Just x + (x:_) -> Just x - mimeType' :: mtype -> Maybe ME.MediaType - mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) - mimeTypes' :: mtype -> [ME.MediaType] - mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) + mimeType' :: mtype -> Maybe ME.MediaType + mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) + mimeTypes' :: mtype -> [ME.MediaType] + mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) -- Default MimeType Instances -- | @application/json; charset=utf-8@ instance MimeType MimeJSON where - mimeType _ = Just $ P.fromString "application/json" + mimeType _ = Just $ P.fromString "application/json" -- | @application/xml; charset=utf-8@ instance MimeType MimeXML where - mimeType _ = Just $ P.fromString "application/xml" + mimeType _ = Just $ P.fromString "application/xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ P.fromString "multipart/form-data" + mimeType _ = Just $ P.fromString "multipart/form-data" -- | @text/plain; charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ P.fromString "text/plain" + mimeType _ = Just $ P.fromString "text/plain" -- | @application/octet-stream@ instance MimeType MimeOctetStream where - mimeType _ = Just $ P.fromString "application/octet-stream" + mimeType _ = Just $ P.fromString "application/octet-stream" -- | @"*/*"@ instance MimeType MimeAny where - mimeType _ = Just $ P.fromString "*/*" + mimeType _ = Just $ P.fromString "*/*" instance MimeType MimeNoContent where - mimeType _ = Nothing + mimeType _ = Nothing -- * MimeRender Class -class MimeType mtype => MimeRender mtype x where - mimeRender :: P.Proxy mtype -> x -> BL.ByteString - mimeRender' :: mtype -> x -> BL.ByteString - mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeRender mtype x where + mimeRender :: P.Proxy mtype -> x -> BL.ByteString + mimeRender' :: mtype -> x -> BL.ByteString + mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam -- Default MimeRender Instances -- | `A.encode` -instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode +instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode -- | @WH.urlEncodeAsForm@ -instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm +instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm -- | @P.id@ -instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id +instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack -- | @P.id@ -instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData -- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty -- * MimeUnrender Class -class MimeType mtype => MimeUnrender mtype o where - mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o - mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o - mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeUnrender mtype o where + mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o + mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o + mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x -- Default MimeUnrender Instances -- | @A.eitherDecode@ -instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode +instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode -- | @P.left T.unpack . WH.urlDecodeAsForm@ -instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm +instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm -- | @P.Right . P.id@ -instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . TL.decodeUtf8'@ -instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.id@ -instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . T.decodeUtf8' . BL.toStrict@ -instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent -- * Custom Mime Types @@ -209,7 +209,7 @@ -- | @application/xml; charset=utf-16@ instance MimeType MimeXmlCharsetutf16 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-16" + mimeType _ = Just $ P.fromString "application/xml; charset=utf-16" -- instance MimeRender MimeXmlCharsetutf16 T.Text where mimeRender _ = undefined -- instance MimeUnrender MimeXmlCharsetutf16 T.Text where mimeUnrender _ = undefined @@ -219,38 +219,38 @@ -- | @application/xml; charset=utf-8@ instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" -- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined -- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined --- ** MimeTextxml +-- ** MimeTextXml -data MimeTextxml = MimeTextxml deriving (P.Typeable) +data MimeTextXml = MimeTextXml deriving (P.Typeable) -- | @text/xml@ -instance MimeType MimeTextxml where - mimeType _ = Just $ P.fromString "text/xml" --- instance MimeRender MimeTextxml T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextxml T.Text where mimeUnrender _ = undefined +instance MimeType MimeTextXml where + mimeType _ = Just $ P.fromString "text/xml" +-- instance MimeRender MimeTextXml T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeTextXml T.Text where mimeUnrender _ = undefined --- ** MimeTextxmlCharsetutf16 +-- ** MimeTextXmlCharsetutf16 -data MimeTextxmlCharsetutf16 = MimeTextxmlCharsetutf16 deriving (P.Typeable) +data MimeTextXmlCharsetutf16 = MimeTextXmlCharsetutf16 deriving (P.Typeable) -- | @text/xml; charset=utf-16@ -instance MimeType MimeTextxmlCharsetutf16 where - mimeType _ = Just $ P.fromString "text/xml; charset=utf-16" --- instance MimeRender MimeTextxmlCharsetutf16 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextxmlCharsetutf16 T.Text where mimeUnrender _ = undefined +instance MimeType MimeTextXmlCharsetutf16 where + mimeType _ = Just $ P.fromString "text/xml; charset=utf-16" +-- instance MimeRender MimeTextXmlCharsetutf16 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeTextXmlCharsetutf16 T.Text where mimeUnrender _ = undefined --- ** MimeTextxmlCharsetutf8 +-- ** MimeTextXmlCharsetutf8 -data MimeTextxmlCharsetutf8 = MimeTextxmlCharsetutf8 deriving (P.Typeable) +data MimeTextXmlCharsetutf8 = MimeTextXmlCharsetutf8 deriving (P.Typeable) -- | @text/xml; charset=utf-8@ -instance MimeType MimeTextxmlCharsetutf8 where - mimeType _ = Just $ P.fromString "text/xml; charset=utf-8" --- instance MimeRender MimeTextxmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextxmlCharsetutf8 T.Text where mimeUnrender _ = undefined +instance MimeType MimeTextXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "text/xml; charset=utf-8" +-- instance MimeRender MimeTextXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeTextXmlCharsetutf8 T.Text where mimeUnrender _ = undefined \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html index b943b121a6fb..c5823a693935 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html @@ -93,1980 +93,2283 @@ -- ** Callback newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) --- ** EnumFormString -newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) +-- ** Context +newtype Context = Context { unContext :: [Text] } deriving (P.Eq, P.Show) --- ** EnumFormStringArray -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) +-- ** EnumFormString +newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) --- ** EnumHeaderString -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) +-- ** EnumFormStringArray +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) --- ** EnumHeaderStringArray -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) +-- ** EnumHeaderString +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) --- ** EnumQueryDouble -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) +-- ** EnumHeaderStringArray +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) --- ** EnumQueryInteger -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) +-- ** EnumQueryDouble +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) --- ** EnumQueryString -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) +-- ** EnumQueryInteger +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) --- ** EnumQueryStringArray -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) +-- ** EnumQueryString +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) --- ** File2 -newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show) +-- ** EnumQueryStringArray +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show) --- ** Int32 -newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) +-- ** File2 +newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show) --- ** Int64 -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) +-- ** Http +newtype Http = Http { unHttp :: [Text] } deriving (P.Eq, P.Show) --- ** Int64Group -newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show) +-- ** Int32 +newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) --- ** Name2 -newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) +-- ** Int64 +newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) --- ** Number -newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) +-- ** Int64Group +newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show) --- ** OrderId -newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) +-- ** Ioutil +newtype Ioutil = Ioutil { unIoutil :: [Text] } deriving (P.Eq, P.Show) --- ** OrderIdText -newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) +-- ** Name2 +newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) --- ** Param -newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) +-- ** Number +newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) --- ** Param2 -newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) +-- ** OrderId +newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) --- ** ParamBinary -newtype ParamBinary = ParamBinary { unParamBinary :: FilePath } deriving (P.Eq, P.Show) +-- ** OrderIdText +newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) --- ** ParamDate -newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) +-- ** Param +newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) --- ** ParamDateTime -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) +-- ** Param2 +newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) --- ** ParamDouble -newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) +-- ** ParamBinary +newtype ParamBinary = ParamBinary { unParamBinary :: FilePath } deriving (P.Eq, P.Show) --- ** ParamFloat -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) +-- ** ParamDate +newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) --- ** ParamInteger -newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) +-- ** ParamDateTime +newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) --- ** ParamMapMapStringText -newtype ParamMapMapStringText = ParamMapMapStringText { unParamMapMapStringText :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) +-- ** ParamDouble +newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) --- ** ParamString -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) +-- ** ParamFloat +newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) --- ** Password -newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) +-- ** ParamInteger +newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) --- ** PatternWithoutDelimiter -newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) +-- ** ParamMapMapStringText +newtype ParamMapMapStringText = ParamMapMapStringText { unParamMapMapStringText :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) --- ** PetId -newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) +-- ** ParamString +newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) --- ** Query -newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) +-- ** Password +newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) --- ** RequiredBooleanGroup -newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show) +-- ** PatternWithoutDelimiter +newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) --- ** RequiredFile -newtype RequiredFile = RequiredFile { unRequiredFile :: FilePath } deriving (P.Eq, P.Show) +-- ** PetId +newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) --- ** RequiredInt64Group -newtype RequiredInt64Group = RequiredInt64Group { unRequiredInt64Group :: Integer } deriving (P.Eq, P.Show) +-- ** Pipe +newtype Pipe = Pipe { unPipe :: [Text] } deriving (P.Eq, P.Show) --- ** RequiredStringGroup -newtype RequiredStringGroup = RequiredStringGroup { unRequiredStringGroup :: Int } deriving (P.Eq, P.Show) +-- ** Query +newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) --- ** Status -newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) +-- ** RequiredBooleanGroup +newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show) --- ** StatusText -newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) +-- ** RequiredFile +newtype RequiredFile = RequiredFile { unRequiredFile :: FilePath } deriving (P.Eq, P.Show) --- ** StringGroup -newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Show) +-- ** RequiredInt64Group +newtype RequiredInt64Group = RequiredInt64Group { unRequiredInt64Group :: Integer } deriving (P.Eq, P.Show) --- ** Tags -newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) +-- ** RequiredStringGroup +newtype RequiredStringGroup = RequiredStringGroup { unRequiredStringGroup :: Int } deriving (P.Eq, P.Show) --- ** Username -newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) +-- ** Status +newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) --- * Models - +-- ** StatusText +newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) --- ** AdditionalPropertiesClass --- | AdditionalPropertiesClass -data AdditionalPropertiesClass = AdditionalPropertiesClass - { additionalPropertiesClassMapProperty :: !(Maybe (Map.Map String Text)) -- ^ "map_property" - , additionalPropertiesClassMapOfMapProperty :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_of_map_property" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesClass -instance A.FromJSON AdditionalPropertiesClass where - parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> - AdditionalPropertiesClass - <$> (o .:? "map_property") - <*> (o .:? "map_of_map_property") +-- ** StringGroup +newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Show) + +-- ** Tags +newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) + +-- ** Url +newtype Url = Url { unUrl :: [Text] } deriving (P.Eq, P.Show) + +-- ** Username +newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) + +-- * Models --- | ToJSON AdditionalPropertiesClass -instance A.ToJSON AdditionalPropertiesClass where - toJSON AdditionalPropertiesClass {..} = - _omitNulls - [ "map_property" .= additionalPropertiesClassMapProperty - , "map_of_map_property" .= additionalPropertiesClassMapOfMapProperty - ] - - --- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) -mkAdditionalPropertiesClass - :: AdditionalPropertiesClass -mkAdditionalPropertiesClass = - AdditionalPropertiesClass - { additionalPropertiesClassMapProperty = Nothing - , additionalPropertiesClassMapOfMapProperty = Nothing - } - --- ** Animal --- | Animal -data Animal = Animal - { animalClassName :: !(Text) -- ^ /Required/ "className" - , animalColor :: !(Maybe Text) -- ^ "color" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Animal -instance A.FromJSON Animal where - parseJSON = A.withObject "Animal" $ \o -> - Animal - <$> (o .: "className") - <*> (o .:? "color") - --- | ToJSON Animal -instance A.ToJSON Animal where - toJSON Animal {..} = - _omitNulls - [ "className" .= animalClassName - , "color" .= animalColor - ] - + +-- ** AdditionalPropertiesAnyType +-- | AdditionalPropertiesAnyType +data AdditionalPropertiesAnyType = AdditionalPropertiesAnyType + { additionalPropertiesAnyTypeName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesAnyType +instance A.FromJSON AdditionalPropertiesAnyType where + parseJSON = A.withObject "AdditionalPropertiesAnyType" $ \o -> + AdditionalPropertiesAnyType + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesAnyType +instance A.ToJSON AdditionalPropertiesAnyType where + toJSON AdditionalPropertiesAnyType {..} = + _omitNulls + [ "name" .= additionalPropertiesAnyTypeName + ] + + +-- | Construct a value of type 'AdditionalPropertiesAnyType' (by applying it's required fields, if any) +mkAdditionalPropertiesAnyType + :: AdditionalPropertiesAnyType +mkAdditionalPropertiesAnyType = + AdditionalPropertiesAnyType + { additionalPropertiesAnyTypeName = Nothing + } + +-- ** AdditionalPropertiesArray +-- | AdditionalPropertiesArray +data AdditionalPropertiesArray = AdditionalPropertiesArray + { additionalPropertiesArrayName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesArray +instance A.FromJSON AdditionalPropertiesArray where + parseJSON = A.withObject "AdditionalPropertiesArray" $ \o -> + AdditionalPropertiesArray + <$> (o .:? "name") --- | Construct a value of type 'Animal' (by applying it's required fields, if any) -mkAnimal - :: Text -- ^ 'animalClassName' - -> Animal -mkAnimal animalClassName = - Animal - { animalClassName - , animalColor = Nothing - } - --- ** ApiResponse --- | ApiResponse -data ApiResponse = ApiResponse - { apiResponseCode :: !(Maybe Int) -- ^ "code" - , apiResponseType :: !(Maybe Text) -- ^ "type" - , apiResponseMessage :: !(Maybe Text) -- ^ "message" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ApiResponse -instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> - ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") - --- | ToJSON ApiResponse -instance A.ToJSON ApiResponse where - toJSON ApiResponse {..} = - _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage +-- | ToJSON AdditionalPropertiesArray +instance A.ToJSON AdditionalPropertiesArray where + toJSON AdditionalPropertiesArray {..} = + _omitNulls + [ "name" .= additionalPropertiesArrayName + ] + + +-- | Construct a value of type 'AdditionalPropertiesArray' (by applying it's required fields, if any) +mkAdditionalPropertiesArray + :: AdditionalPropertiesArray +mkAdditionalPropertiesArray = + AdditionalPropertiesArray + { additionalPropertiesArrayName = Nothing + } + +-- ** AdditionalPropertiesBoolean +-- | AdditionalPropertiesBoolean +data AdditionalPropertiesBoolean = AdditionalPropertiesBoolean + { additionalPropertiesBooleanName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesBoolean +instance A.FromJSON AdditionalPropertiesBoolean where + parseJSON = A.withObject "AdditionalPropertiesBoolean" $ \o -> + AdditionalPropertiesBoolean + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesBoolean +instance A.ToJSON AdditionalPropertiesBoolean where + toJSON AdditionalPropertiesBoolean {..} = + _omitNulls + [ "name" .= additionalPropertiesBooleanName ] --- | Construct a value of type 'ApiResponse' (by applying it's required fields, if any) -mkApiResponse - :: ApiResponse -mkApiResponse = - ApiResponse - { apiResponseCode = Nothing - , apiResponseType = Nothing - , apiResponseMessage = Nothing - } - --- ** ArrayOfArrayOfNumberOnly --- | ArrayOfArrayOfNumberOnly -data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly - { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayOfArrayOfNumberOnly -instance A.FromJSON ArrayOfArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> - ArrayOfArrayOfNumberOnly - <$> (o .:? "ArrayArrayNumber") - --- | ToJSON ArrayOfArrayOfNumberOnly -instance A.ToJSON ArrayOfArrayOfNumberOnly where - toJSON ArrayOfArrayOfNumberOnly {..} = - _omitNulls - [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber - ] - - --- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any) -mkArrayOfArrayOfNumberOnly - :: ArrayOfArrayOfNumberOnly -mkArrayOfArrayOfNumberOnly = - ArrayOfArrayOfNumberOnly - { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing - } - --- ** ArrayOfNumberOnly --- | ArrayOfNumberOnly -data ArrayOfNumberOnly = ArrayOfNumberOnly - { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayOfNumberOnly -instance A.FromJSON ArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> - ArrayOfNumberOnly - <$> (o .:? "ArrayNumber") - --- | ToJSON ArrayOfNumberOnly -instance A.ToJSON ArrayOfNumberOnly where - toJSON ArrayOfNumberOnly {..} = - _omitNulls - [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber +-- | Construct a value of type 'AdditionalPropertiesBoolean' (by applying it's required fields, if any) +mkAdditionalPropertiesBoolean + :: AdditionalPropertiesBoolean +mkAdditionalPropertiesBoolean = + AdditionalPropertiesBoolean + { additionalPropertiesBooleanName = Nothing + } + +-- ** AdditionalPropertiesClass +-- | AdditionalPropertiesClass +data AdditionalPropertiesClass = AdditionalPropertiesClass + { additionalPropertiesClassMapString :: !(Maybe (Map.Map String Text)) -- ^ "map_string" + , additionalPropertiesClassMapNumber :: !(Maybe (Map.Map String Double)) -- ^ "map_number" + , additionalPropertiesClassMapInteger :: !(Maybe (Map.Map String Int)) -- ^ "map_integer" + , additionalPropertiesClassMapBoolean :: !(Maybe (Map.Map String Bool)) -- ^ "map_boolean" + , additionalPropertiesClassMapArrayInteger :: !(Maybe (Map.Map String [Int])) -- ^ "map_array_integer" + , additionalPropertiesClassMapArrayAnytype :: !(Maybe (Map.Map String [A.Value])) -- ^ "map_array_anytype" + , additionalPropertiesClassMapMapString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_string" + , additionalPropertiesClassMapMapAnytype :: !(Maybe (Map.Map String (Map.Map String A.Value))) -- ^ "map_map_anytype" + , additionalPropertiesClassAnytype1 :: !(Maybe A.Value) -- ^ "anytype_1" + , additionalPropertiesClassAnytype2 :: !(Maybe A.Value) -- ^ "anytype_2" + , additionalPropertiesClassAnytype3 :: !(Maybe A.Value) -- ^ "anytype_3" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesClass +instance A.FromJSON AdditionalPropertiesClass where + parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> + AdditionalPropertiesClass + <$> (o .:? "map_string") + <*> (o .:? "map_number") + <*> (o .:? "map_integer") + <*> (o .:? "map_boolean") + <*> (o .:? "map_array_integer") + <*> (o .:? "map_array_anytype") + <*> (o .:? "map_map_string") + <*> (o .:? "map_map_anytype") + <*> (o .:? "anytype_1") + <*> (o .:? "anytype_2") + <*> (o .:? "anytype_3") + +-- | ToJSON AdditionalPropertiesClass +instance A.ToJSON AdditionalPropertiesClass where + toJSON AdditionalPropertiesClass {..} = + _omitNulls + [ "map_string" .= additionalPropertiesClassMapString + , "map_number" .= additionalPropertiesClassMapNumber + , "map_integer" .= additionalPropertiesClassMapInteger + , "map_boolean" .= additionalPropertiesClassMapBoolean + , "map_array_integer" .= additionalPropertiesClassMapArrayInteger + , "map_array_anytype" .= additionalPropertiesClassMapArrayAnytype + , "map_map_string" .= additionalPropertiesClassMapMapString + , "map_map_anytype" .= additionalPropertiesClassMapMapAnytype + , "anytype_1" .= additionalPropertiesClassAnytype1 + , "anytype_2" .= additionalPropertiesClassAnytype2 + , "anytype_3" .= additionalPropertiesClassAnytype3 ] --- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any) -mkArrayOfNumberOnly - :: ArrayOfNumberOnly -mkArrayOfNumberOnly = - ArrayOfNumberOnly - { arrayOfNumberOnlyArrayNumber = Nothing - } - --- ** ArrayTest --- | ArrayTest -data ArrayTest = ArrayTest - { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string" - , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer" - , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayTest -instance A.FromJSON ArrayTest where - parseJSON = A.withObject "ArrayTest" $ \o -> - ArrayTest - <$> (o .:? "array_of_string") - <*> (o .:? "array_array_of_integer") - <*> (o .:? "array_array_of_model") +-- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) +mkAdditionalPropertiesClass + :: AdditionalPropertiesClass +mkAdditionalPropertiesClass = + AdditionalPropertiesClass + { additionalPropertiesClassMapString = Nothing + , additionalPropertiesClassMapNumber = Nothing + , additionalPropertiesClassMapInteger = Nothing + , additionalPropertiesClassMapBoolean = Nothing + , additionalPropertiesClassMapArrayInteger = Nothing + , additionalPropertiesClassMapArrayAnytype = Nothing + , additionalPropertiesClassMapMapString = Nothing + , additionalPropertiesClassMapMapAnytype = Nothing + , additionalPropertiesClassAnytype1 = Nothing + , additionalPropertiesClassAnytype2 = Nothing + , additionalPropertiesClassAnytype3 = Nothing + } + +-- ** AdditionalPropertiesInteger +-- | AdditionalPropertiesInteger +data AdditionalPropertiesInteger = AdditionalPropertiesInteger + { additionalPropertiesIntegerName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) --- | ToJSON ArrayTest -instance A.ToJSON ArrayTest where - toJSON ArrayTest {..} = - _omitNulls - [ "array_of_string" .= arrayTestArrayOfString - , "array_array_of_integer" .= arrayTestArrayArrayOfInteger - , "array_array_of_model" .= arrayTestArrayArrayOfModel - ] - - --- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any) -mkArrayTest - :: ArrayTest -mkArrayTest = - ArrayTest - { arrayTestArrayOfString = Nothing - , arrayTestArrayArrayOfInteger = Nothing - , arrayTestArrayArrayOfModel = Nothing - } - --- ** Capitalization --- | Capitalization -data Capitalization = Capitalization - { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" - , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" - , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake" - , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake" - , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points" - , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Capitalization -instance A.FromJSON Capitalization where - parseJSON = A.withObject "Capitalization" $ \o -> - Capitalization - <$> (o .:? "smallCamel") - <*> (o .:? "CapitalCamel") - <*> (o .:? "small_Snake") - <*> (o .:? "Capital_Snake") - <*> (o .:? "SCA_ETH_Flow_Points") - <*> (o .:? "ATT_NAME") +-- | FromJSON AdditionalPropertiesInteger +instance A.FromJSON AdditionalPropertiesInteger where + parseJSON = A.withObject "AdditionalPropertiesInteger" $ \o -> + AdditionalPropertiesInteger + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesInteger +instance A.ToJSON AdditionalPropertiesInteger where + toJSON AdditionalPropertiesInteger {..} = + _omitNulls + [ "name" .= additionalPropertiesIntegerName + ] + + +-- | Construct a value of type 'AdditionalPropertiesInteger' (by applying it's required fields, if any) +mkAdditionalPropertiesInteger + :: AdditionalPropertiesInteger +mkAdditionalPropertiesInteger = + AdditionalPropertiesInteger + { additionalPropertiesIntegerName = Nothing + } + +-- ** AdditionalPropertiesNumber +-- | AdditionalPropertiesNumber +data AdditionalPropertiesNumber = AdditionalPropertiesNumber + { additionalPropertiesNumberName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesNumber +instance A.FromJSON AdditionalPropertiesNumber where + parseJSON = A.withObject "AdditionalPropertiesNumber" $ \o -> + AdditionalPropertiesNumber + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesNumber +instance A.ToJSON AdditionalPropertiesNumber where + toJSON AdditionalPropertiesNumber {..} = + _omitNulls + [ "name" .= additionalPropertiesNumberName + ] + --- | ToJSON Capitalization -instance A.ToJSON Capitalization where - toJSON Capitalization {..} = - _omitNulls - [ "smallCamel" .= capitalizationSmallCamel - , "CapitalCamel" .= capitalizationCapitalCamel - , "small_Snake" .= capitalizationSmallSnake - , "Capital_Snake" .= capitalizationCapitalSnake - , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints - , "ATT_NAME" .= capitalizationAttName - ] - - --- | Construct a value of type 'Capitalization' (by applying it's required fields, if any) -mkCapitalization - :: Capitalization -mkCapitalization = - Capitalization - { capitalizationSmallCamel = Nothing - , capitalizationCapitalCamel = Nothing - , capitalizationSmallSnake = Nothing - , capitalizationCapitalSnake = Nothing - , capitalizationScaEthFlowPoints = Nothing - , capitalizationAttName = Nothing - } - --- ** Cat --- | Cat -data Cat = Cat - { catClassName :: !(Text) -- ^ /Required/ "className" - , catColor :: !(Maybe Text) -- ^ "color" - , catDeclawed :: !(Maybe Bool) -- ^ "declawed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Cat -instance A.FromJSON Cat where - parseJSON = A.withObject "Cat" $ \o -> - Cat - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "declawed") +-- | Construct a value of type 'AdditionalPropertiesNumber' (by applying it's required fields, if any) +mkAdditionalPropertiesNumber + :: AdditionalPropertiesNumber +mkAdditionalPropertiesNumber = + AdditionalPropertiesNumber + { additionalPropertiesNumberName = Nothing + } + +-- ** AdditionalPropertiesObject +-- | AdditionalPropertiesObject +data AdditionalPropertiesObject = AdditionalPropertiesObject + { additionalPropertiesObjectName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesObject +instance A.FromJSON AdditionalPropertiesObject where + parseJSON = A.withObject "AdditionalPropertiesObject" $ \o -> + AdditionalPropertiesObject + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesObject +instance A.ToJSON AdditionalPropertiesObject where + toJSON AdditionalPropertiesObject {..} = + _omitNulls + [ "name" .= additionalPropertiesObjectName + ] + + +-- | Construct a value of type 'AdditionalPropertiesObject' (by applying it's required fields, if any) +mkAdditionalPropertiesObject + :: AdditionalPropertiesObject +mkAdditionalPropertiesObject = + AdditionalPropertiesObject + { additionalPropertiesObjectName = Nothing + } + +-- ** AdditionalPropertiesString +-- | AdditionalPropertiesString +data AdditionalPropertiesString = AdditionalPropertiesString + { additionalPropertiesStringName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) --- | ToJSON Cat -instance A.ToJSON Cat where - toJSON Cat {..} = - _omitNulls - [ "className" .= catClassName - , "color" .= catColor - , "declawed" .= catDeclawed - ] - - --- | Construct a value of type 'Cat' (by applying it's required fields, if any) -mkCat - :: Text -- ^ 'catClassName' - -> Cat -mkCat catClassName = - Cat - { catClassName - , catColor = Nothing - , catDeclawed = Nothing - } - --- ** Category --- | Category -data Category = Category - { categoryId :: !(Maybe Integer) -- ^ "id" - , categoryName :: !(Text) -- ^ /Required/ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Category -instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> - Category - <$> (o .:? "id") - <*> (o .: "name") - --- | ToJSON Category -instance A.ToJSON Category where - toJSON Category {..} = - _omitNulls - [ "id" .= categoryId - , "name" .= categoryName - ] - +-- | FromJSON AdditionalPropertiesString +instance A.FromJSON AdditionalPropertiesString where + parseJSON = A.withObject "AdditionalPropertiesString" $ \o -> + AdditionalPropertiesString + <$> (o .:? "name") + +-- | ToJSON AdditionalPropertiesString +instance A.ToJSON AdditionalPropertiesString where + toJSON AdditionalPropertiesString {..} = + _omitNulls + [ "name" .= additionalPropertiesStringName + ] + + +-- | Construct a value of type 'AdditionalPropertiesString' (by applying it's required fields, if any) +mkAdditionalPropertiesString + :: AdditionalPropertiesString +mkAdditionalPropertiesString = + AdditionalPropertiesString + { additionalPropertiesStringName = Nothing + } + +-- ** Animal +-- | Animal +data Animal = Animal + { animalClassName :: !(Text) -- ^ /Required/ "className" + , animalColor :: !(Maybe Text) -- ^ "color" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Animal +instance A.FromJSON Animal where + parseJSON = A.withObject "Animal" $ \o -> + Animal + <$> (o .: "className") + <*> (o .:? "color") + +-- | ToJSON Animal +instance A.ToJSON Animal where + toJSON Animal {..} = + _omitNulls + [ "className" .= animalClassName + , "color" .= animalColor + ] --- | Construct a value of type 'Category' (by applying it's required fields, if any) -mkCategory - :: Text -- ^ 'categoryName' - -> Category -mkCategory categoryName = - Category - { categoryId = Nothing - , categoryName - } - --- ** ClassModel --- | ClassModel --- Model for testing model with \"_class\" property -data ClassModel = ClassModel - { classModelClass :: !(Maybe Text) -- ^ "_class" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ClassModel -instance A.FromJSON ClassModel where - parseJSON = A.withObject "ClassModel" $ \o -> - ClassModel - <$> (o .:? "_class") - --- | ToJSON ClassModel -instance A.ToJSON ClassModel where - toJSON ClassModel {..} = - _omitNulls - [ "_class" .= classModelClass - ] - - --- | Construct a value of type 'ClassModel' (by applying it's required fields, if any) -mkClassModel - :: ClassModel -mkClassModel = - ClassModel - { classModelClass = Nothing - } - --- ** Client --- | Client -data Client = Client - { clientClient :: !(Maybe Text) -- ^ "client" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Client -instance A.FromJSON Client where - parseJSON = A.withObject "Client" $ \o -> - Client - <$> (o .:? "client") - --- | ToJSON Client -instance A.ToJSON Client where - toJSON Client {..} = - _omitNulls - [ "client" .= clientClient - ] - + +-- | Construct a value of type 'Animal' (by applying it's required fields, if any) +mkAnimal + :: Text -- ^ 'animalClassName' + -> Animal +mkAnimal animalClassName = + Animal + { animalClassName + , animalColor = Nothing + } + +-- ** ApiResponse +-- | ApiResponse +data ApiResponse = ApiResponse + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ApiResponse +instance A.FromJSON ApiResponse where + parseJSON = A.withObject "ApiResponse" $ \o -> + ApiResponse + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") + +-- | ToJSON ApiResponse +instance A.ToJSON ApiResponse where + toJSON ApiResponse {..} = + _omitNulls + [ "code" .= apiResponseCode + , "type" .= apiResponseType + , "message" .= apiResponseMessage + ] + + +-- | Construct a value of type 'ApiResponse' (by applying it's required fields, if any) +mkApiResponse + :: ApiResponse +mkApiResponse = + ApiResponse + { apiResponseCode = Nothing + , apiResponseType = Nothing + , apiResponseMessage = Nothing + } + +-- ** ArrayOfArrayOfNumberOnly +-- | ArrayOfArrayOfNumberOnly +data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayOfArrayOfNumberOnly +instance A.FromJSON ArrayOfArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> + ArrayOfArrayOfNumberOnly + <$> (o .:? "ArrayArrayNumber") --- | Construct a value of type 'Client' (by applying it's required fields, if any) -mkClient - :: Client -mkClient = - Client - { clientClient = Nothing - } +-- | ToJSON ArrayOfArrayOfNumberOnly +instance A.ToJSON ArrayOfArrayOfNumberOnly where + toJSON ArrayOfArrayOfNumberOnly {..} = + _omitNulls + [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber + ] + --- ** Dog --- | Dog -data Dog = Dog - { dogClassName :: !(Text) -- ^ /Required/ "className" - , dogColor :: !(Maybe Text) -- ^ "color" - , dogBreed :: !(Maybe Text) -- ^ "breed" - } deriving (P.Show, P.Eq, P.Typeable) +-- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any) +mkArrayOfArrayOfNumberOnly + :: ArrayOfArrayOfNumberOnly +mkArrayOfArrayOfNumberOnly = + ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing + } --- | FromJSON Dog -instance A.FromJSON Dog where - parseJSON = A.withObject "Dog" $ \o -> - Dog - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "breed") - --- | ToJSON Dog -instance A.ToJSON Dog where - toJSON Dog {..} = - _omitNulls - [ "className" .= dogClassName - , "color" .= dogColor - , "breed" .= dogBreed - ] - - --- | Construct a value of type 'Dog' (by applying it's required fields, if any) -mkDog - :: Text -- ^ 'dogClassName' - -> Dog -mkDog dogClassName = - Dog - { dogClassName - , dogColor = Nothing - , dogBreed = Nothing - } - --- ** EnumArrays --- | EnumArrays -data EnumArrays = EnumArrays - { enumArraysJustSymbol :: !(Maybe E'JustSymbol) -- ^ "just_symbol" - , enumArraysArrayEnum :: !(Maybe [E'ArrayEnum]) -- ^ "array_enum" +-- ** ArrayOfNumberOnly +-- | ArrayOfNumberOnly +data ArrayOfNumberOnly = ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayOfNumberOnly +instance A.FromJSON ArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> + ArrayOfNumberOnly + <$> (o .:? "ArrayNumber") + +-- | ToJSON ArrayOfNumberOnly +instance A.ToJSON ArrayOfNumberOnly where + toJSON ArrayOfNumberOnly {..} = + _omitNulls + [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber + ] + + +-- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any) +mkArrayOfNumberOnly + :: ArrayOfNumberOnly +mkArrayOfNumberOnly = + ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber = Nothing + } + +-- ** ArrayTest +-- | ArrayTest +data ArrayTest = ArrayTest + { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string" + , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer" + , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model" } deriving (P.Show, P.Eq, P.Typeable) --- | FromJSON EnumArrays -instance A.FromJSON EnumArrays where - parseJSON = A.withObject "EnumArrays" $ \o -> - EnumArrays - <$> (o .:? "just_symbol") - <*> (o .:? "array_enum") - --- | ToJSON EnumArrays -instance A.ToJSON EnumArrays where - toJSON EnumArrays {..} = - _omitNulls - [ "just_symbol" .= enumArraysJustSymbol - , "array_enum" .= enumArraysArrayEnum - ] - - --- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) -mkEnumArrays - :: EnumArrays -mkEnumArrays = - EnumArrays - { enumArraysJustSymbol = Nothing - , enumArraysArrayEnum = Nothing - } - --- ** EnumTest --- | EnumTest -data EnumTest = EnumTest - { enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string" - , enumTestEnumStringRequired :: !(E'EnumString) -- ^ /Required/ "enum_string_required" - , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" - , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" - , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON EnumTest -instance A.FromJSON EnumTest where - parseJSON = A.withObject "EnumTest" $ \o -> - EnumTest - <$> (o .:? "enum_string") - <*> (o .: "enum_string_required") - <*> (o .:? "enum_integer") - <*> (o .:? "enum_number") - <*> (o .:? "outerEnum") - --- | ToJSON EnumTest -instance A.ToJSON EnumTest where - toJSON EnumTest {..} = - _omitNulls - [ "enum_string" .= enumTestEnumString - , "enum_string_required" .= enumTestEnumStringRequired - , "enum_integer" .= enumTestEnumInteger - , "enum_number" .= enumTestEnumNumber - , "outerEnum" .= enumTestOuterEnum - ] - - --- | Construct a value of type 'EnumTest' (by applying it's required fields, if any) -mkEnumTest - :: E'EnumString -- ^ 'enumTestEnumStringRequired' - -> EnumTest -mkEnumTest enumTestEnumStringRequired = - EnumTest - { enumTestEnumString = Nothing - , enumTestEnumStringRequired - , enumTestEnumInteger = Nothing - , enumTestEnumNumber = Nothing - , enumTestOuterEnum = Nothing - } - --- ** File --- | File --- Must be named `File` for test. -data File = File - { fileSourceUri :: !(Maybe Text) -- ^ "sourceURI" - Test capitalization - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON File -instance A.FromJSON File where - parseJSON = A.withObject "File" $ \o -> - File - <$> (o .:? "sourceURI") - --- | ToJSON File -instance A.ToJSON File where - toJSON File {..} = - _omitNulls - [ "sourceURI" .= fileSourceUri - ] - - --- | Construct a value of type 'File' (by applying it's required fields, if any) -mkFile - :: File -mkFile = - File - { fileSourceUri = Nothing - } - --- ** FileSchemaTestClass --- | FileSchemaTestClass -data FileSchemaTestClass = FileSchemaTestClass - { fileSchemaTestClassFile :: !(Maybe File) -- ^ "file" - , fileSchemaTestClassFiles :: !(Maybe [File]) -- ^ "files" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON FileSchemaTestClass -instance A.FromJSON FileSchemaTestClass where - parseJSON = A.withObject "FileSchemaTestClass" $ \o -> - FileSchemaTestClass - <$> (o .:? "file") - <*> (o .:? "files") +-- | FromJSON ArrayTest +instance A.FromJSON ArrayTest where + parseJSON = A.withObject "ArrayTest" $ \o -> + ArrayTest + <$> (o .:? "array_of_string") + <*> (o .:? "array_array_of_integer") + <*> (o .:? "array_array_of_model") + +-- | ToJSON ArrayTest +instance A.ToJSON ArrayTest where + toJSON ArrayTest {..} = + _omitNulls + [ "array_of_string" .= arrayTestArrayOfString + , "array_array_of_integer" .= arrayTestArrayArrayOfInteger + , "array_array_of_model" .= arrayTestArrayArrayOfModel + ] + + +-- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any) +mkArrayTest + :: ArrayTest +mkArrayTest = + ArrayTest + { arrayTestArrayOfString = Nothing + , arrayTestArrayArrayOfInteger = Nothing + , arrayTestArrayArrayOfModel = Nothing + } + +-- ** Capitalization +-- | Capitalization +data Capitalization = Capitalization + { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" + , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" + , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake" + , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake" + , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points" + , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Capitalization +instance A.FromJSON Capitalization where + parseJSON = A.withObject "Capitalization" $ \o -> + Capitalization + <$> (o .:? "smallCamel") + <*> (o .:? "CapitalCamel") + <*> (o .:? "small_Snake") + <*> (o .:? "Capital_Snake") + <*> (o .:? "SCA_ETH_Flow_Points") + <*> (o .:? "ATT_NAME") + +-- | ToJSON Capitalization +instance A.ToJSON Capitalization where + toJSON Capitalization {..} = + _omitNulls + [ "smallCamel" .= capitalizationSmallCamel + , "CapitalCamel" .= capitalizationCapitalCamel + , "small_Snake" .= capitalizationSmallSnake + , "Capital_Snake" .= capitalizationCapitalSnake + , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints + , "ATT_NAME" .= capitalizationAttName + ] + + +-- | Construct a value of type 'Capitalization' (by applying it's required fields, if any) +mkCapitalization + :: Capitalization +mkCapitalization = + Capitalization + { capitalizationSmallCamel = Nothing + , capitalizationCapitalCamel = Nothing + , capitalizationSmallSnake = Nothing + , capitalizationCapitalSnake = Nothing + , capitalizationScaEthFlowPoints = Nothing + , capitalizationAttName = Nothing + } + +-- ** Cat +-- | Cat +data Cat = Cat + { catClassName :: !(Text) -- ^ /Required/ "className" + , catColor :: !(Maybe Text) -- ^ "color" + , catDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Cat +instance A.FromJSON Cat where + parseJSON = A.withObject "Cat" $ \o -> + Cat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + +-- | ToJSON Cat +instance A.ToJSON Cat where + toJSON Cat {..} = + _omitNulls + [ "className" .= catClassName + , "color" .= catColor + , "declawed" .= catDeclawed + ] + + +-- | Construct a value of type 'Cat' (by applying it's required fields, if any) +mkCat + :: Text -- ^ 'catClassName' + -> Cat +mkCat catClassName = + Cat + { catClassName + , catColor = Nothing + , catDeclawed = Nothing + } --- | ToJSON FileSchemaTestClass -instance A.ToJSON FileSchemaTestClass where - toJSON FileSchemaTestClass {..} = - _omitNulls - [ "file" .= fileSchemaTestClassFile - , "files" .= fileSchemaTestClassFiles - ] - - --- | Construct a value of type 'FileSchemaTestClass' (by applying it's required fields, if any) -mkFileSchemaTestClass - :: FileSchemaTestClass -mkFileSchemaTestClass = - FileSchemaTestClass - { fileSchemaTestClassFile = Nothing - , fileSchemaTestClassFiles = Nothing - } - --- ** FormatTest --- | FormatTest -data FormatTest = FormatTest - { formatTestInteger :: !(Maybe Int) -- ^ "integer" - , formatTestInt32 :: !(Maybe Int) -- ^ "int32" - , formatTestInt64 :: !(Maybe Integer) -- ^ "int64" - , formatTestNumber :: !(Double) -- ^ /Required/ "number" - , formatTestFloat :: !(Maybe Float) -- ^ "float" - , formatTestDouble :: !(Maybe Double) -- ^ "double" - , formatTestString :: !(Maybe Text) -- ^ "string" - , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte" - , formatTestBinary :: !(Maybe FilePath) -- ^ "binary" - , formatTestDate :: !(Date) -- ^ /Required/ "date" - , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" - , formatTestUuid :: !(Maybe Text) -- ^ "uuid" - , formatTestPassword :: !(Text) -- ^ /Required/ "password" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON FormatTest -instance A.FromJSON FormatTest where - parseJSON = A.withObject "FormatTest" $ \o -> - FormatTest - <$> (o .:? "integer") - <*> (o .:? "int32") - <*> (o .:? "int64") - <*> (o .: "number") - <*> (o .:? "float") - <*> (o .:? "double") - <*> (o .:? "string") - <*> (o .: "byte") - <*> (o .:? "binary") - <*> (o .: "date") - <*> (o .:? "dateTime") - <*> (o .:? "uuid") - <*> (o .: "password") - --- | ToJSON FormatTest -instance A.ToJSON FormatTest where - toJSON FormatTest {..} = - _omitNulls - [ "integer" .= formatTestInteger - , "int32" .= formatTestInt32 - , "int64" .= formatTestInt64 - , "number" .= formatTestNumber - , "float" .= formatTestFloat - , "double" .= formatTestDouble - , "string" .= formatTestString - , "byte" .= formatTestByte - , "binary" .= formatTestBinary - , "date" .= formatTestDate - , "dateTime" .= formatTestDateTime - , "uuid" .= formatTestUuid - , "password" .= formatTestPassword - ] - +-- ** CatAllOf +-- | CatAllOf +data CatAllOf = CatAllOf + { catAllOfDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON CatAllOf +instance A.FromJSON CatAllOf where + parseJSON = A.withObject "CatAllOf" $ \o -> + CatAllOf + <$> (o .:? "declawed") + +-- | ToJSON CatAllOf +instance A.ToJSON CatAllOf where + toJSON CatAllOf {..} = + _omitNulls + [ "declawed" .= catAllOfDeclawed + ] + + +-- | Construct a value of type 'CatAllOf' (by applying it's required fields, if any) +mkCatAllOf + :: CatAllOf +mkCatAllOf = + CatAllOf + { catAllOfDeclawed = Nothing + } + +-- ** Category +-- | Category +data Category = Category + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Text) -- ^ /Required/ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Category +instance A.FromJSON Category where + parseJSON = A.withObject "Category" $ \o -> + Category + <$> (o .:? "id") + <*> (o .: "name") + +-- | ToJSON Category +instance A.ToJSON Category where + toJSON Category {..} = + _omitNulls + [ "id" .= categoryId + , "name" .= categoryName + ] + + +-- | Construct a value of type 'Category' (by applying it's required fields, if any) +mkCategory + :: Text -- ^ 'categoryName' + -> Category +mkCategory categoryName = + Category + { categoryId = Nothing + , categoryName + } + +-- ** ClassModel +-- | ClassModel +-- Model for testing model with \"_class\" property +data ClassModel = ClassModel + { classModelClass :: !(Maybe Text) -- ^ "_class" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ClassModel +instance A.FromJSON ClassModel where + parseJSON = A.withObject "ClassModel" $ \o -> + ClassModel + <$> (o .:? "_class") --- | Construct a value of type 'FormatTest' (by applying it's required fields, if any) -mkFormatTest - :: Double -- ^ 'formatTestNumber' - -> ByteArray -- ^ 'formatTestByte' - -> Date -- ^ 'formatTestDate' - -> Text -- ^ 'formatTestPassword' - -> FormatTest -mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = - FormatTest - { formatTestInteger = Nothing - , formatTestInt32 = Nothing - , formatTestInt64 = Nothing - , formatTestNumber - , formatTestFloat = Nothing - , formatTestDouble = Nothing - , formatTestString = Nothing - , formatTestByte - , formatTestBinary = Nothing - , formatTestDate - , formatTestDateTime = Nothing - , formatTestUuid = Nothing - , formatTestPassword - } - --- ** HasOnlyReadOnly --- | HasOnlyReadOnly -data HasOnlyReadOnly = HasOnlyReadOnly - { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" - , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON HasOnlyReadOnly -instance A.FromJSON HasOnlyReadOnly where - parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> - HasOnlyReadOnly - <$> (o .:? "bar") - <*> (o .:? "foo") - --- | ToJSON HasOnlyReadOnly -instance A.ToJSON HasOnlyReadOnly where - toJSON HasOnlyReadOnly {..} = - _omitNulls - [ "bar" .= hasOnlyReadOnlyBar - , "foo" .= hasOnlyReadOnlyFoo - ] - - --- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any) -mkHasOnlyReadOnly - :: HasOnlyReadOnly -mkHasOnlyReadOnly = - HasOnlyReadOnly - { hasOnlyReadOnlyBar = Nothing - , hasOnlyReadOnlyFoo = Nothing - } - --- ** MapTest --- | MapTest -data MapTest = MapTest - { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" - , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" - , mapTestDirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "direct_map" - , mapTestIndirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "indirect_map" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON MapTest -instance A.FromJSON MapTest where - parseJSON = A.withObject "MapTest" $ \o -> - MapTest - <$> (o .:? "map_map_of_string") - <*> (o .:? "map_of_enum_string") - <*> (o .:? "direct_map") - <*> (o .:? "indirect_map") - --- | ToJSON MapTest -instance A.ToJSON MapTest where - toJSON MapTest {..} = - _omitNulls - [ "map_map_of_string" .= mapTestMapMapOfString - , "map_of_enum_string" .= mapTestMapOfEnumString - , "direct_map" .= mapTestDirectMap - , "indirect_map" .= mapTestIndirectMap - ] - - --- | Construct a value of type 'MapTest' (by applying it's required fields, if any) -mkMapTest - :: MapTest -mkMapTest = - MapTest - { mapTestMapMapOfString = Nothing - , mapTestMapOfEnumString = Nothing - , mapTestDirectMap = Nothing - , mapTestIndirectMap = Nothing - } - --- ** MixedPropertiesAndAdditionalPropertiesClass --- | MixedPropertiesAndAdditionalPropertiesClass -data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass - { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" - , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" - , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON MixedPropertiesAndAdditionalPropertiesClass -instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where - parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> - MixedPropertiesAndAdditionalPropertiesClass - <$> (o .:? "uuid") - <*> (o .:? "dateTime") - <*> (o .:? "map") - --- | ToJSON MixedPropertiesAndAdditionalPropertiesClass -instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where - toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = - _omitNulls - [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid - , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime - , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap - ] - - --- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any) -mkMixedPropertiesAndAdditionalPropertiesClass - :: MixedPropertiesAndAdditionalPropertiesClass -mkMixedPropertiesAndAdditionalPropertiesClass = - MixedPropertiesAndAdditionalPropertiesClass - { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing - , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing - , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing - } +-- | ToJSON ClassModel +instance A.ToJSON ClassModel where + toJSON ClassModel {..} = + _omitNulls + [ "_class" .= classModelClass + ] + + +-- | Construct a value of type 'ClassModel' (by applying it's required fields, if any) +mkClassModel + :: ClassModel +mkClassModel = + ClassModel + { classModelClass = Nothing + } + +-- ** Client +-- | Client +data Client = Client + { clientClient :: !(Maybe Text) -- ^ "client" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Client +instance A.FromJSON Client where + parseJSON = A.withObject "Client" $ \o -> + Client + <$> (o .:? "client") + +-- | ToJSON Client +instance A.ToJSON Client where + toJSON Client {..} = + _omitNulls + [ "client" .= clientClient + ] + + +-- | Construct a value of type 'Client' (by applying it's required fields, if any) +mkClient + :: Client +mkClient = + Client + { clientClient = Nothing + } + +-- ** Dog +-- | Dog +data Dog = Dog + { dogClassName :: !(Text) -- ^ /Required/ "className" + , dogColor :: !(Maybe Text) -- ^ "color" + , dogBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Dog +instance A.FromJSON Dog where + parseJSON = A.withObject "Dog" $ \o -> + Dog + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "breed") + +-- | ToJSON Dog +instance A.ToJSON Dog where + toJSON Dog {..} = + _omitNulls + [ "className" .= dogClassName + , "color" .= dogColor + , "breed" .= dogBreed + ] + + +-- | Construct a value of type 'Dog' (by applying it's required fields, if any) +mkDog + :: Text -- ^ 'dogClassName' + -> Dog +mkDog dogClassName = + Dog + { dogClassName + , dogColor = Nothing + , dogBreed = Nothing + } + +-- ** DogAllOf +-- | DogAllOf +data DogAllOf = DogAllOf + { dogAllOfBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON DogAllOf +instance A.FromJSON DogAllOf where + parseJSON = A.withObject "DogAllOf" $ \o -> + DogAllOf + <$> (o .:? "breed") + +-- | ToJSON DogAllOf +instance A.ToJSON DogAllOf where + toJSON DogAllOf {..} = + _omitNulls + [ "breed" .= dogAllOfBreed + ] + + +-- | Construct a value of type 'DogAllOf' (by applying it's required fields, if any) +mkDogAllOf + :: DogAllOf +mkDogAllOf = + DogAllOf + { dogAllOfBreed = Nothing + } + +-- ** EnumArrays +-- | EnumArrays +data EnumArrays = EnumArrays + { enumArraysJustSymbol :: !(Maybe E'JustSymbol) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [E'ArrayEnum]) -- ^ "array_enum" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumArrays +instance A.FromJSON EnumArrays where + parseJSON = A.withObject "EnumArrays" $ \o -> + EnumArrays + <$> (o .:? "just_symbol") + <*> (o .:? "array_enum") + +-- | ToJSON EnumArrays +instance A.ToJSON EnumArrays where + toJSON EnumArrays {..} = + _omitNulls + [ "just_symbol" .= enumArraysJustSymbol + , "array_enum" .= enumArraysArrayEnum + ] + --- ** Model200Response --- | Model200Response --- Model for testing model name starting with number -data Model200Response = Model200Response - { model200ResponseName :: !(Maybe Int) -- ^ "name" - , model200ResponseClass :: !(Maybe Text) -- ^ "class" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Model200Response -instance A.FromJSON Model200Response where - parseJSON = A.withObject "Model200Response" $ \o -> - Model200Response - <$> (o .:? "name") - <*> (o .:? "class") - --- | ToJSON Model200Response -instance A.ToJSON Model200Response where - toJSON Model200Response {..} = - _omitNulls - [ "name" .= model200ResponseName - , "class" .= model200ResponseClass - ] - - --- | Construct a value of type 'Model200Response' (by applying it's required fields, if any) -mkModel200Response - :: Model200Response -mkModel200Response = - Model200Response - { model200ResponseName = Nothing - , model200ResponseClass = Nothing - } - --- ** ModelList --- | ModelList -data ModelList = ModelList - { modelList123list :: !(Maybe Text) -- ^ "123-list" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ModelList -instance A.FromJSON ModelList where - parseJSON = A.withObject "ModelList" $ \o -> - ModelList - <$> (o .:? "123-list") - --- | ToJSON ModelList -instance A.ToJSON ModelList where - toJSON ModelList {..} = - _omitNulls - [ "123-list" .= modelList123list - ] - - --- | Construct a value of type 'ModelList' (by applying it's required fields, if any) -mkModelList - :: ModelList -mkModelList = - ModelList - { modelList123list = Nothing - } +-- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) +mkEnumArrays + :: EnumArrays +mkEnumArrays = + EnumArrays + { enumArraysJustSymbol = Nothing + , enumArraysArrayEnum = Nothing + } + +-- ** EnumTest +-- | EnumTest +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string" + , enumTestEnumStringRequired :: !(E'EnumString) -- ^ /Required/ "enum_string_required" + , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" + , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumTest +instance A.FromJSON EnumTest where + parseJSON = A.withObject "EnumTest" $ \o -> + EnumTest + <$> (o .:? "enum_string") + <*> (o .: "enum_string_required") + <*> (o .:? "enum_integer") + <*> (o .:? "enum_number") + <*> (o .:? "outerEnum") + +-- | ToJSON EnumTest +instance A.ToJSON EnumTest where + toJSON EnumTest {..} = + _omitNulls + [ "enum_string" .= enumTestEnumString + , "enum_string_required" .= enumTestEnumStringRequired + , "enum_integer" .= enumTestEnumInteger + , "enum_number" .= enumTestEnumNumber + , "outerEnum" .= enumTestOuterEnum + ] + + +-- | Construct a value of type 'EnumTest' (by applying it's required fields, if any) +mkEnumTest + :: E'EnumString -- ^ 'enumTestEnumStringRequired' + -> EnumTest +mkEnumTest enumTestEnumStringRequired = + EnumTest + { enumTestEnumString = Nothing + , enumTestEnumStringRequired + , enumTestEnumInteger = Nothing + , enumTestEnumNumber = Nothing + , enumTestOuterEnum = Nothing + } + +-- ** File +-- | File +-- Must be named `File` for test. +data File = File + { fileSourceUri :: !(Maybe Text) -- ^ "sourceURI" - Test capitalization + } deriving (P.Show, P.Eq, P.Typeable) --- ** ModelReturn --- | ModelReturn --- Model for testing reserved words -data ModelReturn = ModelReturn - { modelReturnReturn :: !(Maybe Int) -- ^ "return" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ModelReturn -instance A.FromJSON ModelReturn where - parseJSON = A.withObject "ModelReturn" $ \o -> - ModelReturn - <$> (o .:? "return") +-- | FromJSON File +instance A.FromJSON File where + parseJSON = A.withObject "File" $ \o -> + File + <$> (o .:? "sourceURI") + +-- | ToJSON File +instance A.ToJSON File where + toJSON File {..} = + _omitNulls + [ "sourceURI" .= fileSourceUri + ] --- | ToJSON ModelReturn -instance A.ToJSON ModelReturn where - toJSON ModelReturn {..} = - _omitNulls - [ "return" .= modelReturnReturn - ] - - --- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any) -mkModelReturn - :: ModelReturn -mkModelReturn = - ModelReturn - { modelReturnReturn = Nothing - } + +-- | Construct a value of type 'File' (by applying it's required fields, if any) +mkFile + :: File +mkFile = + File + { fileSourceUri = Nothing + } + +-- ** FileSchemaTestClass +-- | FileSchemaTestClass +data FileSchemaTestClass = FileSchemaTestClass + { fileSchemaTestClassFile :: !(Maybe File) -- ^ "file" + , fileSchemaTestClassFiles :: !(Maybe [File]) -- ^ "files" + } deriving (P.Show, P.Eq, P.Typeable) --- ** Name --- | Name --- Model for testing model name same as property name -data Name = Name - { nameName :: !(Int) -- ^ /Required/ "name" - , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case" - , nameProperty :: !(Maybe Text) -- ^ "property" - , name123number :: !(Maybe Int) -- ^ "123Number" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Name -instance A.FromJSON Name where - parseJSON = A.withObject "Name" $ \o -> - Name - <$> (o .: "name") - <*> (o .:? "snake_case") - <*> (o .:? "property") - <*> (o .:? "123Number") - --- | ToJSON Name -instance A.ToJSON Name where - toJSON Name {..} = - _omitNulls - [ "name" .= nameName - , "snake_case" .= nameSnakeCase - , "property" .= nameProperty - , "123Number" .= name123number - ] - - --- | Construct a value of type 'Name' (by applying it's required fields, if any) -mkName - :: Int -- ^ 'nameName' - -> Name -mkName nameName = - Name - { nameName - , nameSnakeCase = Nothing - , nameProperty = Nothing - , name123number = Nothing - } - --- ** NumberOnly --- | NumberOnly -data NumberOnly = NumberOnly - { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON NumberOnly -instance A.FromJSON NumberOnly where - parseJSON = A.withObject "NumberOnly" $ \o -> - NumberOnly - <$> (o .:? "JustNumber") - --- | ToJSON NumberOnly -instance A.ToJSON NumberOnly where - toJSON NumberOnly {..} = - _omitNulls - [ "JustNumber" .= numberOnlyJustNumber - ] +-- | FromJSON FileSchemaTestClass +instance A.FromJSON FileSchemaTestClass where + parseJSON = A.withObject "FileSchemaTestClass" $ \o -> + FileSchemaTestClass + <$> (o .:? "file") + <*> (o .:? "files") + +-- | ToJSON FileSchemaTestClass +instance A.ToJSON FileSchemaTestClass where + toJSON FileSchemaTestClass {..} = + _omitNulls + [ "file" .= fileSchemaTestClassFile + , "files" .= fileSchemaTestClassFiles + ] + + +-- | Construct a value of type 'FileSchemaTestClass' (by applying it's required fields, if any) +mkFileSchemaTestClass + :: FileSchemaTestClass +mkFileSchemaTestClass = + FileSchemaTestClass + { fileSchemaTestClassFile = Nothing + , fileSchemaTestClassFiles = Nothing + } + +-- ** FormatTest +-- | FormatTest +data FormatTest = FormatTest + { formatTestInteger :: !(Maybe Int) -- ^ "integer" + , formatTestInt32 :: !(Maybe Int) -- ^ "int32" + , formatTestInt64 :: !(Maybe Integer) -- ^ "int64" + , formatTestNumber :: !(Double) -- ^ /Required/ "number" + , formatTestFloat :: !(Maybe Float) -- ^ "float" + , formatTestDouble :: !(Maybe Double) -- ^ "double" + , formatTestString :: !(Maybe Text) -- ^ "string" + , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte" + , formatTestBinary :: !(Maybe FilePath) -- ^ "binary" + , formatTestDate :: !(Date) -- ^ /Required/ "date" + , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" + , formatTestUuid :: !(Maybe Text) -- ^ "uuid" + , formatTestPassword :: !(Text) -- ^ /Required/ "password" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON FormatTest +instance A.FromJSON FormatTest where + parseJSON = A.withObject "FormatTest" $ \o -> + FormatTest + <$> (o .:? "integer") + <*> (o .:? "int32") + <*> (o .:? "int64") + <*> (o .: "number") + <*> (o .:? "float") + <*> (o .:? "double") + <*> (o .:? "string") + <*> (o .: "byte") + <*> (o .:? "binary") + <*> (o .: "date") + <*> (o .:? "dateTime") + <*> (o .:? "uuid") + <*> (o .: "password") - --- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any) -mkNumberOnly - :: NumberOnly -mkNumberOnly = - NumberOnly - { numberOnlyJustNumber = Nothing - } - --- ** Order --- | Order -data Order = Order - { orderId :: !(Maybe Integer) -- ^ "id" - , orderPetId :: !(Maybe Integer) -- ^ "petId" - , orderQuantity :: !(Maybe Int) -- ^ "quantity" - , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" - , orderStatus :: !(Maybe E'Status) -- ^ "status" - Order Status - , orderComplete :: !(Maybe Bool) -- ^ "complete" - } deriving (P.Show, P.Eq, P.Typeable) +-- | ToJSON FormatTest +instance A.ToJSON FormatTest where + toJSON FormatTest {..} = + _omitNulls + [ "integer" .= formatTestInteger + , "int32" .= formatTestInt32 + , "int64" .= formatTestInt64 + , "number" .= formatTestNumber + , "float" .= formatTestFloat + , "double" .= formatTestDouble + , "string" .= formatTestString + , "byte" .= formatTestByte + , "binary" .= formatTestBinary + , "date" .= formatTestDate + , "dateTime" .= formatTestDateTime + , "uuid" .= formatTestUuid + , "password" .= formatTestPassword + ] + --- | FromJSON Order -instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> - Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate") - <*> (o .:? "status") - <*> (o .:? "complete") - --- | ToJSON Order -instance A.ToJSON Order where - toJSON Order {..} = - _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete - ] - +-- | Construct a value of type 'FormatTest' (by applying it's required fields, if any) +mkFormatTest + :: Double -- ^ 'formatTestNumber' + -> ByteArray -- ^ 'formatTestByte' + -> Date -- ^ 'formatTestDate' + -> Text -- ^ 'formatTestPassword' + -> FormatTest +mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = + FormatTest + { formatTestInteger = Nothing + , formatTestInt32 = Nothing + , formatTestInt64 = Nothing + , formatTestNumber + , formatTestFloat = Nothing + , formatTestDouble = Nothing + , formatTestString = Nothing + , formatTestByte + , formatTestBinary = Nothing + , formatTestDate + , formatTestDateTime = Nothing + , formatTestUuid = Nothing + , formatTestPassword + } --- | Construct a value of type 'Order' (by applying it's required fields, if any) -mkOrder - :: Order -mkOrder = - Order - { orderId = Nothing - , orderPetId = Nothing - , orderQuantity = Nothing - , orderShipDate = Nothing - , orderStatus = Nothing - , orderComplete = Nothing - } - --- ** OuterComposite --- | OuterComposite -data OuterComposite = OuterComposite - { outerCompositeMyNumber :: !(Maybe Double) -- ^ "my_number" - , outerCompositeMyString :: !(Maybe Text) -- ^ "my_string" - , outerCompositeMyBoolean :: !(Maybe Bool) -- ^ "my_boolean" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON OuterComposite -instance A.FromJSON OuterComposite where - parseJSON = A.withObject "OuterComposite" $ \o -> - OuterComposite - <$> (o .:? "my_number") - <*> (o .:? "my_string") - <*> (o .:? "my_boolean") - --- | ToJSON OuterComposite -instance A.ToJSON OuterComposite where - toJSON OuterComposite {..} = - _omitNulls - [ "my_number" .= outerCompositeMyNumber - , "my_string" .= outerCompositeMyString - , "my_boolean" .= outerCompositeMyBoolean - ] - - --- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) -mkOuterComposite - :: OuterComposite -mkOuterComposite = - OuterComposite - { outerCompositeMyNumber = Nothing - , outerCompositeMyString = Nothing - , outerCompositeMyBoolean = Nothing - } - --- ** Pet --- | Pet -data Pet = Pet - { petId :: !(Maybe Integer) -- ^ "id" - , petCategory :: !(Maybe Category) -- ^ "category" - , petName :: !(Text) -- ^ /Required/ "name" - , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" - , petTags :: !(Maybe [Tag]) -- ^ "tags" - , petStatus :: !(Maybe E'Status2) -- ^ "status" - pet status in the store - } deriving (P.Show, P.Eq, P.Typeable) +-- ** HasOnlyReadOnly +-- | HasOnlyReadOnly +data HasOnlyReadOnly = HasOnlyReadOnly + { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" + , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON HasOnlyReadOnly +instance A.FromJSON HasOnlyReadOnly where + parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> + HasOnlyReadOnly + <$> (o .:? "bar") + <*> (o .:? "foo") + +-- | ToJSON HasOnlyReadOnly +instance A.ToJSON HasOnlyReadOnly where + toJSON HasOnlyReadOnly {..} = + _omitNulls + [ "bar" .= hasOnlyReadOnlyBar + , "foo" .= hasOnlyReadOnlyFoo + ] + + +-- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any) +mkHasOnlyReadOnly + :: HasOnlyReadOnly +mkHasOnlyReadOnly = + HasOnlyReadOnly + { hasOnlyReadOnlyBar = Nothing + , hasOnlyReadOnlyFoo = Nothing + } + +-- ** MapTest +-- | MapTest +data MapTest = MapTest + { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" + , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" + , mapTestDirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "direct_map" + , mapTestIndirectMap :: !(Maybe (Map.Map String Bool)) -- ^ "indirect_map" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MapTest +instance A.FromJSON MapTest where + parseJSON = A.withObject "MapTest" $ \o -> + MapTest + <$> (o .:? "map_map_of_string") + <*> (o .:? "map_of_enum_string") + <*> (o .:? "direct_map") + <*> (o .:? "indirect_map") + +-- | ToJSON MapTest +instance A.ToJSON MapTest where + toJSON MapTest {..} = + _omitNulls + [ "map_map_of_string" .= mapTestMapMapOfString + , "map_of_enum_string" .= mapTestMapOfEnumString + , "direct_map" .= mapTestDirectMap + , "indirect_map" .= mapTestIndirectMap + ] --- | FromJSON Pet -instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> - Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") - --- | ToJSON Pet -instance A.ToJSON Pet where - toJSON Pet {..} = - _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus - ] - - --- | Construct a value of type 'Pet' (by applying it's required fields, if any) -mkPet - :: Text -- ^ 'petName' - -> [Text] -- ^ 'petPhotoUrls' - -> Pet -mkPet petName petPhotoUrls = - Pet - { petId = Nothing - , petCategory = Nothing - , petName - , petPhotoUrls - , petTags = Nothing - , petStatus = Nothing - } - --- ** ReadOnlyFirst --- | ReadOnlyFirst -data ReadOnlyFirst = ReadOnlyFirst - { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar" - , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ReadOnlyFirst -instance A.FromJSON ReadOnlyFirst where - parseJSON = A.withObject "ReadOnlyFirst" $ \o -> - ReadOnlyFirst - <$> (o .:? "bar") - <*> (o .:? "baz") - --- | ToJSON ReadOnlyFirst -instance A.ToJSON ReadOnlyFirst where - toJSON ReadOnlyFirst {..} = - _omitNulls - [ "bar" .= readOnlyFirstBar - , "baz" .= readOnlyFirstBaz - ] - - --- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) -mkReadOnlyFirst - :: ReadOnlyFirst -mkReadOnlyFirst = - ReadOnlyFirst - { readOnlyFirstBar = Nothing - , readOnlyFirstBaz = Nothing - } + +-- | Construct a value of type 'MapTest' (by applying it's required fields, if any) +mkMapTest + :: MapTest +mkMapTest = + MapTest + { mapTestMapMapOfString = Nothing + , mapTestMapOfEnumString = Nothing + , mapTestDirectMap = Nothing + , mapTestIndirectMap = Nothing + } + +-- ** MixedPropertiesAndAdditionalPropertiesClass +-- | MixedPropertiesAndAdditionalPropertiesClass +data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass + { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" + , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" + , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MixedPropertiesAndAdditionalPropertiesClass +instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where + parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> + MixedPropertiesAndAdditionalPropertiesClass + <$> (o .:? "uuid") + <*> (o .:? "dateTime") + <*> (o .:? "map") + +-- | ToJSON MixedPropertiesAndAdditionalPropertiesClass +instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where + toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = + _omitNulls + [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid + , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime + , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap + ] + + +-- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any) +mkMixedPropertiesAndAdditionalPropertiesClass + :: MixedPropertiesAndAdditionalPropertiesClass +mkMixedPropertiesAndAdditionalPropertiesClass = + MixedPropertiesAndAdditionalPropertiesClass + { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing + , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing + , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing + } + +-- ** Model200Response +-- | Model200Response +-- Model for testing model name starting with number +data Model200Response = Model200Response + { model200ResponseName :: !(Maybe Int) -- ^ "name" + , model200ResponseClass :: !(Maybe Text) -- ^ "class" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Model200Response +instance A.FromJSON Model200Response where + parseJSON = A.withObject "Model200Response" $ \o -> + Model200Response + <$> (o .:? "name") + <*> (o .:? "class") + +-- | ToJSON Model200Response +instance A.ToJSON Model200Response where + toJSON Model200Response {..} = + _omitNulls + [ "name" .= model200ResponseName + , "class" .= model200ResponseClass + ] --- ** SpecialModelName --- | SpecialModelName -data SpecialModelName = SpecialModelName - { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON SpecialModelName -instance A.FromJSON SpecialModelName where - parseJSON = A.withObject "SpecialModelName" $ \o -> - SpecialModelName - <$> (o .:? "$special[property.name]") - --- | ToJSON SpecialModelName -instance A.ToJSON SpecialModelName where - toJSON SpecialModelName {..} = - _omitNulls - [ "$special[property.name]" .= specialModelNameSpecialPropertyName - ] - - --- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) -mkSpecialModelName - :: SpecialModelName -mkSpecialModelName = - SpecialModelName - { specialModelNameSpecialPropertyName = Nothing - } - --- ** Tag --- | Tag -data Tag = Tag - { tagId :: !(Maybe Integer) -- ^ "id" - , tagName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Tag -instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> - Tag - <$> (o .:? "id") - <*> (o .:? "name") - --- | ToJSON Tag -instance A.ToJSON Tag where - toJSON Tag {..} = - _omitNulls - [ "id" .= tagId - , "name" .= tagName - ] - + +-- | Construct a value of type 'Model200Response' (by applying it's required fields, if any) +mkModel200Response + :: Model200Response +mkModel200Response = + Model200Response + { model200ResponseName = Nothing + , model200ResponseClass = Nothing + } + +-- ** ModelList +-- | ModelList +data ModelList = ModelList + { modelList123list :: !(Maybe Text) -- ^ "123-list" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelList +instance A.FromJSON ModelList where + parseJSON = A.withObject "ModelList" $ \o -> + ModelList + <$> (o .:? "123-list") + +-- | ToJSON ModelList +instance A.ToJSON ModelList where + toJSON ModelList {..} = + _omitNulls + [ "123-list" .= modelList123list + ] + + +-- | Construct a value of type 'ModelList' (by applying it's required fields, if any) +mkModelList + :: ModelList +mkModelList = + ModelList + { modelList123list = Nothing + } + +-- ** ModelReturn +-- | ModelReturn +-- Model for testing reserved words +data ModelReturn = ModelReturn + { modelReturnReturn :: !(Maybe Int) -- ^ "return" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelReturn +instance A.FromJSON ModelReturn where + parseJSON = A.withObject "ModelReturn" $ \o -> + ModelReturn + <$> (o .:? "return") --- | Construct a value of type 'Tag' (by applying it's required fields, if any) -mkTag - :: Tag -mkTag = - Tag - { tagId = Nothing - , tagName = Nothing - } - --- ** TypeHolderDefault --- | TypeHolderDefault -data TypeHolderDefault = TypeHolderDefault - { typeHolderDefaultStringItem :: !(Text) -- ^ /Required/ "string_item" - , typeHolderDefaultNumberItem :: !(Double) -- ^ /Required/ "number_item" - , typeHolderDefaultIntegerItem :: !(Int) -- ^ /Required/ "integer_item" - , typeHolderDefaultBoolItem :: !(Bool) -- ^ /Required/ "bool_item" - , typeHolderDefaultArrayItem :: !([Int]) -- ^ /Required/ "array_item" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON TypeHolderDefault -instance A.FromJSON TypeHolderDefault where - parseJSON = A.withObject "TypeHolderDefault" $ \o -> - TypeHolderDefault - <$> (o .: "string_item") - <*> (o .: "number_item") - <*> (o .: "integer_item") - <*> (o .: "bool_item") - <*> (o .: "array_item") - --- | ToJSON TypeHolderDefault -instance A.ToJSON TypeHolderDefault where - toJSON TypeHolderDefault {..} = - _omitNulls - [ "string_item" .= typeHolderDefaultStringItem - , "number_item" .= typeHolderDefaultNumberItem - , "integer_item" .= typeHolderDefaultIntegerItem - , "bool_item" .= typeHolderDefaultBoolItem - , "array_item" .= typeHolderDefaultArrayItem - ] - - --- | Construct a value of type 'TypeHolderDefault' (by applying it's required fields, if any) -mkTypeHolderDefault - :: Text -- ^ 'typeHolderDefaultStringItem' - -> Double -- ^ 'typeHolderDefaultNumberItem' - -> Int -- ^ 'typeHolderDefaultIntegerItem' - -> Bool -- ^ 'typeHolderDefaultBoolItem' - -> [Int] -- ^ 'typeHolderDefaultArrayItem' - -> TypeHolderDefault -mkTypeHolderDefault typeHolderDefaultStringItem typeHolderDefaultNumberItem typeHolderDefaultIntegerItem typeHolderDefaultBoolItem typeHolderDefaultArrayItem = - TypeHolderDefault - { typeHolderDefaultStringItem - , typeHolderDefaultNumberItem - , typeHolderDefaultIntegerItem - , typeHolderDefaultBoolItem - , typeHolderDefaultArrayItem +-- | ToJSON ModelReturn +instance A.ToJSON ModelReturn where + toJSON ModelReturn {..} = + _omitNulls + [ "return" .= modelReturnReturn + ] + + +-- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any) +mkModelReturn + :: ModelReturn +mkModelReturn = + ModelReturn + { modelReturnReturn = Nothing + } + +-- ** Name +-- | Name +-- Model for testing model name same as property name +data Name = Name + { nameName :: !(Int) -- ^ /Required/ "name" + , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case" + , nameProperty :: !(Maybe Text) -- ^ "property" + , name123number :: !(Maybe Int) -- ^ "123Number" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Name +instance A.FromJSON Name where + parseJSON = A.withObject "Name" $ \o -> + Name + <$> (o .: "name") + <*> (o .:? "snake_case") + <*> (o .:? "property") + <*> (o .:? "123Number") + +-- | ToJSON Name +instance A.ToJSON Name where + toJSON Name {..} = + _omitNulls + [ "name" .= nameName + , "snake_case" .= nameSnakeCase + , "property" .= nameProperty + , "123Number" .= name123number + ] + + +-- | Construct a value of type 'Name' (by applying it's required fields, if any) +mkName + :: Int -- ^ 'nameName' + -> Name +mkName nameName = + Name + { nameName + , nameSnakeCase = Nothing + , nameProperty = Nothing + , name123number = Nothing } --- ** TypeHolderExample --- | TypeHolderExample -data TypeHolderExample = TypeHolderExample - { typeHolderExampleStringItem :: !(Text) -- ^ /Required/ "string_item" - , typeHolderExampleNumberItem :: !(Double) -- ^ /Required/ "number_item" - , typeHolderExampleIntegerItem :: !(Int) -- ^ /Required/ "integer_item" - , typeHolderExampleBoolItem :: !(Bool) -- ^ /Required/ "bool_item" - , typeHolderExampleArrayItem :: !([Int]) -- ^ /Required/ "array_item" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON TypeHolderExample -instance A.FromJSON TypeHolderExample where - parseJSON = A.withObject "TypeHolderExample" $ \o -> - TypeHolderExample - <$> (o .: "string_item") - <*> (o .: "number_item") - <*> (o .: "integer_item") - <*> (o .: "bool_item") - <*> (o .: "array_item") +-- ** NumberOnly +-- | NumberOnly +data NumberOnly = NumberOnly + { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON NumberOnly +instance A.FromJSON NumberOnly where + parseJSON = A.withObject "NumberOnly" $ \o -> + NumberOnly + <$> (o .:? "JustNumber") + +-- | ToJSON NumberOnly +instance A.ToJSON NumberOnly where + toJSON NumberOnly {..} = + _omitNulls + [ "JustNumber" .= numberOnlyJustNumber + ] + --- | ToJSON TypeHolderExample -instance A.ToJSON TypeHolderExample where - toJSON TypeHolderExample {..} = - _omitNulls - [ "string_item" .= typeHolderExampleStringItem - , "number_item" .= typeHolderExampleNumberItem - , "integer_item" .= typeHolderExampleIntegerItem - , "bool_item" .= typeHolderExampleBoolItem - , "array_item" .= typeHolderExampleArrayItem - ] - - --- | Construct a value of type 'TypeHolderExample' (by applying it's required fields, if any) -mkTypeHolderExample - :: Text -- ^ 'typeHolderExampleStringItem' - -> Double -- ^ 'typeHolderExampleNumberItem' - -> Int -- ^ 'typeHolderExampleIntegerItem' - -> Bool -- ^ 'typeHolderExampleBoolItem' - -> [Int] -- ^ 'typeHolderExampleArrayItem' - -> TypeHolderExample -mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = - TypeHolderExample - { typeHolderExampleStringItem - , typeHolderExampleNumberItem - , typeHolderExampleIntegerItem - , typeHolderExampleBoolItem - , typeHolderExampleArrayItem - } - --- ** User --- | User -data User = User - { userId :: !(Maybe Integer) -- ^ "id" - , userUsername :: !(Maybe Text) -- ^ "username" - , userFirstName :: !(Maybe Text) -- ^ "firstName" - , userLastName :: !(Maybe Text) -- ^ "lastName" - , userEmail :: !(Maybe Text) -- ^ "email" - , userPassword :: !(Maybe Text) -- ^ "password" - , userPhone :: !(Maybe Text) -- ^ "phone" - , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status - } deriving (P.Show, P.Eq, P.Typeable) +-- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any) +mkNumberOnly + :: NumberOnly +mkNumberOnly = + NumberOnly + { numberOnlyJustNumber = Nothing + } + +-- ** Order +-- | Order +data Order = Order + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" + , orderStatus :: !(Maybe E'Status) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Order +instance A.FromJSON Order where + parseJSON = A.withObject "Order" $ \o -> + Order + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate") + <*> (o .:? "status") + <*> (o .:? "complete") + +-- | ToJSON Order +instance A.ToJSON Order where + toJSON Order {..} = + _omitNulls + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= orderShipDate + , "status" .= orderStatus + , "complete" .= orderComplete + ] --- | FromJSON User -instance A.FromJSON User where - parseJSON = A.withObject "User" $ \o -> - User - <$> (o .:? "id") - <*> (o .:? "username") - <*> (o .:? "firstName") - <*> (o .:? "lastName") - <*> (o .:? "email") - <*> (o .:? "password") - <*> (o .:? "phone") - <*> (o .:? "userStatus") - --- | ToJSON User -instance A.ToJSON User where - toJSON User {..} = - _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus - ] - - --- | Construct a value of type 'User' (by applying it's required fields, if any) -mkUser - :: User -mkUser = - User - { userId = Nothing - , userUsername = Nothing - , userFirstName = Nothing - , userLastName = Nothing - , userEmail = Nothing - , userPassword = Nothing - , userPhone = Nothing - , userUserStatus = Nothing - } - --- ** XmlItem --- | XmlItem -data XmlItem = XmlItem - { xmlItemAttributeString :: !(Maybe Text) -- ^ "attribute_string" - , xmlItemAttributeNumber :: !(Maybe Double) -- ^ "attribute_number" - , xmlItemAttributeInteger :: !(Maybe Int) -- ^ "attribute_integer" - , xmlItemAttributeBoolean :: !(Maybe Bool) -- ^ "attribute_boolean" - , xmlItemWrappedArray :: !(Maybe [Int]) -- ^ "wrapped_array" - , xmlItemNameString :: !(Maybe Text) -- ^ "name_string" - , xmlItemNameNumber :: !(Maybe Double) -- ^ "name_number" - , xmlItemNameInteger :: !(Maybe Int) -- ^ "name_integer" - , xmlItemNameBoolean :: !(Maybe Bool) -- ^ "name_boolean" - , xmlItemNameArray :: !(Maybe [Int]) -- ^ "name_array" - , xmlItemNameWrappedArray :: !(Maybe [Int]) -- ^ "name_wrapped_array" - , xmlItemPrefixString :: !(Maybe Text) -- ^ "prefix_string" - , xmlItemPrefixNumber :: !(Maybe Double) -- ^ "prefix_number" - , xmlItemPrefixInteger :: !(Maybe Int) -- ^ "prefix_integer" - , xmlItemPrefixBoolean :: !(Maybe Bool) -- ^ "prefix_boolean" - , xmlItemPrefixArray :: !(Maybe [Int]) -- ^ "prefix_array" - , xmlItemPrefixWrappedArray :: !(Maybe [Int]) -- ^ "prefix_wrapped_array" - , xmlItemNamespaceString :: !(Maybe Text) -- ^ "namespace_string" - , xmlItemNamespaceNumber :: !(Maybe Double) -- ^ "namespace_number" - , xmlItemNamespaceInteger :: !(Maybe Int) -- ^ "namespace_integer" - , xmlItemNamespaceBoolean :: !(Maybe Bool) -- ^ "namespace_boolean" - , xmlItemNamespaceArray :: !(Maybe [Int]) -- ^ "namespace_array" - , xmlItemNamespaceWrappedArray :: !(Maybe [Int]) -- ^ "namespace_wrapped_array" - , xmlItemPrefixNsString :: !(Maybe Text) -- ^ "prefix_ns_string" - , xmlItemPrefixNsNumber :: !(Maybe Double) -- ^ "prefix_ns_number" - , xmlItemPrefixNsInteger :: !(Maybe Int) -- ^ "prefix_ns_integer" - , xmlItemPrefixNsBoolean :: !(Maybe Bool) -- ^ "prefix_ns_boolean" - , xmlItemPrefixNsArray :: !(Maybe [Int]) -- ^ "prefix_ns_array" - , xmlItemPrefixNsWrappedArray :: !(Maybe [Int]) -- ^ "prefix_ns_wrapped_array" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON XmlItem -instance A.FromJSON XmlItem where - parseJSON = A.withObject "XmlItem" $ \o -> - XmlItem - <$> (o .:? "attribute_string") - <*> (o .:? "attribute_number") - <*> (o .:? "attribute_integer") - <*> (o .:? "attribute_boolean") - <*> (o .:? "wrapped_array") - <*> (o .:? "name_string") - <*> (o .:? "name_number") - <*> (o .:? "name_integer") - <*> (o .:? "name_boolean") - <*> (o .:? "name_array") - <*> (o .:? "name_wrapped_array") - <*> (o .:? "prefix_string") - <*> (o .:? "prefix_number") - <*> (o .:? "prefix_integer") - <*> (o .:? "prefix_boolean") - <*> (o .:? "prefix_array") - <*> (o .:? "prefix_wrapped_array") - <*> (o .:? "namespace_string") - <*> (o .:? "namespace_number") - <*> (o .:? "namespace_integer") - <*> (o .:? "namespace_boolean") - <*> (o .:? "namespace_array") - <*> (o .:? "namespace_wrapped_array") - <*> (o .:? "prefix_ns_string") - <*> (o .:? "prefix_ns_number") - <*> (o .:? "prefix_ns_integer") - <*> (o .:? "prefix_ns_boolean") - <*> (o .:? "prefix_ns_array") - <*> (o .:? "prefix_ns_wrapped_array") - --- | ToJSON XmlItem -instance A.ToJSON XmlItem where - toJSON XmlItem {..} = - _omitNulls - [ "attribute_string" .= xmlItemAttributeString - , "attribute_number" .= xmlItemAttributeNumber - , "attribute_integer" .= xmlItemAttributeInteger - , "attribute_boolean" .= xmlItemAttributeBoolean - , "wrapped_array" .= xmlItemWrappedArray - , "name_string" .= xmlItemNameString - , "name_number" .= xmlItemNameNumber - , "name_integer" .= xmlItemNameInteger - , "name_boolean" .= xmlItemNameBoolean - , "name_array" .= xmlItemNameArray - , "name_wrapped_array" .= xmlItemNameWrappedArray - , "prefix_string" .= xmlItemPrefixString - , "prefix_number" .= xmlItemPrefixNumber - , "prefix_integer" .= xmlItemPrefixInteger - , "prefix_boolean" .= xmlItemPrefixBoolean - , "prefix_array" .= xmlItemPrefixArray - , "prefix_wrapped_array" .= xmlItemPrefixWrappedArray - , "namespace_string" .= xmlItemNamespaceString - , "namespace_number" .= xmlItemNamespaceNumber - , "namespace_integer" .= xmlItemNamespaceInteger - , "namespace_boolean" .= xmlItemNamespaceBoolean - , "namespace_array" .= xmlItemNamespaceArray - , "namespace_wrapped_array" .= xmlItemNamespaceWrappedArray - , "prefix_ns_string" .= xmlItemPrefixNsString - , "prefix_ns_number" .= xmlItemPrefixNsNumber - , "prefix_ns_integer" .= xmlItemPrefixNsInteger - , "prefix_ns_boolean" .= xmlItemPrefixNsBoolean - , "prefix_ns_array" .= xmlItemPrefixNsArray - , "prefix_ns_wrapped_array" .= xmlItemPrefixNsWrappedArray - ] - - --- | Construct a value of type 'XmlItem' (by applying it's required fields, if any) -mkXmlItem - :: XmlItem -mkXmlItem = - XmlItem - { xmlItemAttributeString = Nothing - , xmlItemAttributeNumber = Nothing - , xmlItemAttributeInteger = Nothing - , xmlItemAttributeBoolean = Nothing - , xmlItemWrappedArray = Nothing - , xmlItemNameString = Nothing - , xmlItemNameNumber = Nothing - , xmlItemNameInteger = Nothing - , xmlItemNameBoolean = Nothing - , xmlItemNameArray = Nothing - , xmlItemNameWrappedArray = Nothing - , xmlItemPrefixString = Nothing - , xmlItemPrefixNumber = Nothing - , xmlItemPrefixInteger = Nothing - , xmlItemPrefixBoolean = Nothing - , xmlItemPrefixArray = Nothing - , xmlItemPrefixWrappedArray = Nothing - , xmlItemNamespaceString = Nothing - , xmlItemNamespaceNumber = Nothing - , xmlItemNamespaceInteger = Nothing - , xmlItemNamespaceBoolean = Nothing - , xmlItemNamespaceArray = Nothing - , xmlItemNamespaceWrappedArray = Nothing - , xmlItemPrefixNsString = Nothing - , xmlItemPrefixNsNumber = Nothing - , xmlItemPrefixNsInteger = Nothing - , xmlItemPrefixNsBoolean = Nothing - , xmlItemPrefixNsArray = Nothing - , xmlItemPrefixNsWrappedArray = Nothing - } + +-- | Construct a value of type 'Order' (by applying it's required fields, if any) +mkOrder + :: Order +mkOrder = + Order + { orderId = Nothing + , orderPetId = Nothing + , orderQuantity = Nothing + , orderShipDate = Nothing + , orderStatus = Nothing + , orderComplete = Nothing + } + +-- ** OuterComposite +-- | OuterComposite +data OuterComposite = OuterComposite + { outerCompositeMyNumber :: !(Maybe Double) -- ^ "my_number" + , outerCompositeMyString :: !(Maybe Text) -- ^ "my_string" + , outerCompositeMyBoolean :: !(Maybe Bool) -- ^ "my_boolean" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON OuterComposite +instance A.FromJSON OuterComposite where + parseJSON = A.withObject "OuterComposite" $ \o -> + OuterComposite + <$> (o .:? "my_number") + <*> (o .:? "my_string") + <*> (o .:? "my_boolean") + +-- | ToJSON OuterComposite +instance A.ToJSON OuterComposite where + toJSON OuterComposite {..} = + _omitNulls + [ "my_number" .= outerCompositeMyNumber + , "my_string" .= outerCompositeMyString + , "my_boolean" .= outerCompositeMyBoolean + ] + + +-- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) +mkOuterComposite + :: OuterComposite +mkOuterComposite = + OuterComposite + { outerCompositeMyNumber = Nothing + , outerCompositeMyString = Nothing + , outerCompositeMyBoolean = Nothing + } + +-- ** Pet +-- | Pet +data Pet = Pet + { petId :: !(Maybe Integer) -- ^ "id" + , petCategory :: !(Maybe Category) -- ^ "category" + , petName :: !(Text) -- ^ /Required/ "name" + , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" + , petTags :: !(Maybe [Tag]) -- ^ "tags" + , petStatus :: !(Maybe E'Status2) -- ^ "status" - pet status in the store + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Pet +instance A.FromJSON Pet where + parseJSON = A.withObject "Pet" $ \o -> + Pet + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") + +-- | ToJSON Pet +instance A.ToJSON Pet where + toJSON Pet {..} = + _omitNulls + [ "id" .= petId + , "category" .= petCategory + , "name" .= petName + , "photoUrls" .= petPhotoUrls + , "tags" .= petTags + , "status" .= petStatus + ] + + +-- | Construct a value of type 'Pet' (by applying it's required fields, if any) +mkPet + :: Text -- ^ 'petName' + -> [Text] -- ^ 'petPhotoUrls' + -> Pet +mkPet petName petPhotoUrls = + Pet + { petId = Nothing + , petCategory = Nothing + , petName + , petPhotoUrls + , petTags = Nothing + , petStatus = Nothing + } + +-- ** ReadOnlyFirst +-- | ReadOnlyFirst +data ReadOnlyFirst = ReadOnlyFirst + { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar" + , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ReadOnlyFirst +instance A.FromJSON ReadOnlyFirst where + parseJSON = A.withObject "ReadOnlyFirst" $ \o -> + ReadOnlyFirst + <$> (o .:? "bar") + <*> (o .:? "baz") + +-- | ToJSON ReadOnlyFirst +instance A.ToJSON ReadOnlyFirst where + toJSON ReadOnlyFirst {..} = + _omitNulls + [ "bar" .= readOnlyFirstBar + , "baz" .= readOnlyFirstBaz + ] + + +-- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) +mkReadOnlyFirst + :: ReadOnlyFirst +mkReadOnlyFirst = + ReadOnlyFirst + { readOnlyFirstBar = Nothing + , readOnlyFirstBaz = Nothing + } + +-- ** SpecialModelName +-- | SpecialModelName +data SpecialModelName = SpecialModelName + { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON SpecialModelName +instance A.FromJSON SpecialModelName where + parseJSON = A.withObject "SpecialModelName" $ \o -> + SpecialModelName + <$> (o .:? "$special[property.name]") + +-- | ToJSON SpecialModelName +instance A.ToJSON SpecialModelName where + toJSON SpecialModelName {..} = + _omitNulls + [ "$special[property.name]" .= specialModelNameSpecialPropertyName + ] + + +-- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) +mkSpecialModelName + :: SpecialModelName +mkSpecialModelName = + SpecialModelName + { specialModelNameSpecialPropertyName = Nothing + } + +-- ** Tag +-- | Tag +data Tag = Tag + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Tag +instance A.FromJSON Tag where + parseJSON = A.withObject "Tag" $ \o -> + Tag + <$> (o .:? "id") + <*> (o .:? "name") + +-- | ToJSON Tag +instance A.ToJSON Tag where + toJSON Tag {..} = + _omitNulls + [ "id" .= tagId + , "name" .= tagName + ] + - --- * Enums - - --- ** E'ArrayEnum - --- | Enum of 'Text' -data E'ArrayEnum - = E'ArrayEnum'Fish -- ^ @"fish"@ - | E'ArrayEnum'Crab -- ^ @"crab"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum -instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o -instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum -instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum -instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'ArrayEnum' enum -fromE'ArrayEnum :: E'ArrayEnum -> Text -fromE'ArrayEnum = \case - E'ArrayEnum'Fish -> "fish" - E'ArrayEnum'Crab -> "crab" - --- | parse 'E'ArrayEnum' enum -toE'ArrayEnum :: Text -> P.Either String E'ArrayEnum -toE'ArrayEnum = \case - "fish" -> P.Right E'ArrayEnum'Fish - "crab" -> P.Right E'ArrayEnum'Crab - s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s - - --- ** E'EnumFormString - --- | Enum of 'Text' . --- Form parameter enum test (string) -data E'EnumFormString - = E'EnumFormString'_abc -- ^ @"_abc"@ - | E'EnumFormString'_efg -- ^ @"-efg"@ - | E'EnumFormString'_xyz -- ^ @"(xyz)"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString -instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString -instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString -instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumFormString' enum -fromE'EnumFormString :: E'EnumFormString -> Text -fromE'EnumFormString = \case - E'EnumFormString'_abc -> "_abc" - E'EnumFormString'_efg -> "-efg" - E'EnumFormString'_xyz -> "(xyz)" - --- | parse 'E'EnumFormString' enum -toE'EnumFormString :: Text -> P.Either String E'EnumFormString -toE'EnumFormString = \case - "_abc" -> P.Right E'EnumFormString'_abc - "-efg" -> P.Right E'EnumFormString'_efg - "(xyz)" -> P.Right E'EnumFormString'_xyz - s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s - - --- ** E'EnumFormStringArray - --- | Enum of 'Text' -data E'EnumFormStringArray - = E'EnumFormStringArray'GreaterThan -- ^ @">"@ - | E'EnumFormStringArray'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumFormStringArray where toJSON = A.toJSON . fromE'EnumFormStringArray -instance A.FromJSON E'EnumFormStringArray where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormStringArray =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormStringArray where toQueryParam = WH.toQueryParam . fromE'EnumFormStringArray -instance WH.FromHttpApiData E'EnumFormStringArray where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormStringArray -instance MimeRender MimeMultipartFormData E'EnumFormStringArray where mimeRender _ = mimeRenderDefaultMultipartFormData +-- | Construct a value of type 'Tag' (by applying it's required fields, if any) +mkTag + :: Tag +mkTag = + Tag + { tagId = Nothing + , tagName = Nothing + } + +-- ** TypeHolderDefault +-- | TypeHolderDefault +data TypeHolderDefault = TypeHolderDefault + { typeHolderDefaultStringItem :: !(Text) -- ^ /Required/ "string_item" + , typeHolderDefaultNumberItem :: !(Double) -- ^ /Required/ "number_item" + , typeHolderDefaultIntegerItem :: !(Int) -- ^ /Required/ "integer_item" + , typeHolderDefaultBoolItem :: !(Bool) -- ^ /Required/ "bool_item" + , typeHolderDefaultArrayItem :: !([Int]) -- ^ /Required/ "array_item" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON TypeHolderDefault +instance A.FromJSON TypeHolderDefault where + parseJSON = A.withObject "TypeHolderDefault" $ \o -> + TypeHolderDefault + <$> (o .: "string_item") + <*> (o .: "number_item") + <*> (o .: "integer_item") + <*> (o .: "bool_item") + <*> (o .: "array_item") + +-- | ToJSON TypeHolderDefault +instance A.ToJSON TypeHolderDefault where + toJSON TypeHolderDefault {..} = + _omitNulls + [ "string_item" .= typeHolderDefaultStringItem + , "number_item" .= typeHolderDefaultNumberItem + , "integer_item" .= typeHolderDefaultIntegerItem + , "bool_item" .= typeHolderDefaultBoolItem + , "array_item" .= typeHolderDefaultArrayItem + ] + + +-- | Construct a value of type 'TypeHolderDefault' (by applying it's required fields, if any) +mkTypeHolderDefault + :: Text -- ^ 'typeHolderDefaultStringItem' + -> Double -- ^ 'typeHolderDefaultNumberItem' + -> Int -- ^ 'typeHolderDefaultIntegerItem' + -> Bool -- ^ 'typeHolderDefaultBoolItem' + -> [Int] -- ^ 'typeHolderDefaultArrayItem' + -> TypeHolderDefault +mkTypeHolderDefault typeHolderDefaultStringItem typeHolderDefaultNumberItem typeHolderDefaultIntegerItem typeHolderDefaultBoolItem typeHolderDefaultArrayItem = + TypeHolderDefault + { typeHolderDefaultStringItem + , typeHolderDefaultNumberItem + , typeHolderDefaultIntegerItem + , typeHolderDefaultBoolItem + , typeHolderDefaultArrayItem + } + +-- ** TypeHolderExample +-- | TypeHolderExample +data TypeHolderExample = TypeHolderExample + { typeHolderExampleStringItem :: !(Text) -- ^ /Required/ "string_item" + , typeHolderExampleNumberItem :: !(Double) -- ^ /Required/ "number_item" + , typeHolderExampleIntegerItem :: !(Int) -- ^ /Required/ "integer_item" + , typeHolderExampleBoolItem :: !(Bool) -- ^ /Required/ "bool_item" + , typeHolderExampleArrayItem :: !([Int]) -- ^ /Required/ "array_item" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON TypeHolderExample +instance A.FromJSON TypeHolderExample where + parseJSON = A.withObject "TypeHolderExample" $ \o -> + TypeHolderExample + <$> (o .: "string_item") + <*> (o .: "number_item") + <*> (o .: "integer_item") + <*> (o .: "bool_item") + <*> (o .: "array_item") --- | unwrap 'E'EnumFormStringArray' enum -fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text -fromE'EnumFormStringArray = \case - E'EnumFormStringArray'GreaterThan -> ">" - E'EnumFormStringArray'Dollar -> "$" - --- | parse 'E'EnumFormStringArray' enum -toE'EnumFormStringArray :: Text -> P.Either String E'EnumFormStringArray -toE'EnumFormStringArray = \case - ">" -> P.Right E'EnumFormStringArray'GreaterThan - "$" -> P.Right E'EnumFormStringArray'Dollar - s -> P.Left $ "toE'EnumFormStringArray: enum parse failure: " P.++ P.show s - - --- ** E'EnumInteger - --- | Enum of 'Int' -data E'EnumInteger - = E'EnumInteger'Num1 -- ^ @1@ - | E'EnumInteger'NumMinus_1 -- ^ @-1@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger -instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger -instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger -instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumInteger' enum -fromE'EnumInteger :: E'EnumInteger -> Int -fromE'EnumInteger = \case - E'EnumInteger'Num1 -> 1 - E'EnumInteger'NumMinus_1 -> -1 - --- | parse 'E'EnumInteger' enum -toE'EnumInteger :: Int -> P.Either String E'EnumInteger -toE'EnumInteger = \case - 1 -> P.Right E'EnumInteger'Num1 - -1 -> P.Right E'EnumInteger'NumMinus_1 - s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s - +-- | ToJSON TypeHolderExample +instance A.ToJSON TypeHolderExample where + toJSON TypeHolderExample {..} = + _omitNulls + [ "string_item" .= typeHolderExampleStringItem + , "number_item" .= typeHolderExampleNumberItem + , "integer_item" .= typeHolderExampleIntegerItem + , "bool_item" .= typeHolderExampleBoolItem + , "array_item" .= typeHolderExampleArrayItem + ] + + +-- | Construct a value of type 'TypeHolderExample' (by applying it's required fields, if any) +mkTypeHolderExample + :: Text -- ^ 'typeHolderExampleStringItem' + -> Double -- ^ 'typeHolderExampleNumberItem' + -> Int -- ^ 'typeHolderExampleIntegerItem' + -> Bool -- ^ 'typeHolderExampleBoolItem' + -> [Int] -- ^ 'typeHolderExampleArrayItem' + -> TypeHolderExample +mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = + TypeHolderExample + { typeHolderExampleStringItem + , typeHolderExampleNumberItem + , typeHolderExampleIntegerItem + , typeHolderExampleBoolItem + , typeHolderExampleArrayItem + } + +-- ** User +-- | User +data User = User + { userId :: !(Maybe Integer) -- ^ "id" + , userUsername :: !(Maybe Text) -- ^ "username" + , userFirstName :: !(Maybe Text) -- ^ "firstName" + , userLastName :: !(Maybe Text) -- ^ "lastName" + , userEmail :: !(Maybe Text) -- ^ "email" + , userPassword :: !(Maybe Text) -- ^ "password" + , userPhone :: !(Maybe Text) -- ^ "phone" + , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status + } deriving (P.Show, P.Eq, P.Typeable) --- ** E'EnumNumber - --- | Enum of 'Double' -data E'EnumNumber - = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ - | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber -instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber -instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber -instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumNumber' enum -fromE'EnumNumber :: E'EnumNumber -> Double -fromE'EnumNumber = \case - E'EnumNumber'Num1_Dot_1 -> 1.1 - E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 - --- | parse 'E'EnumNumber' enum -toE'EnumNumber :: Double -> P.Either String E'EnumNumber -toE'EnumNumber = \case - 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 - -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 - s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s +-- | FromJSON User +instance A.FromJSON User where + parseJSON = A.withObject "User" $ \o -> + User + <$> (o .:? "id") + <*> (o .:? "username") + <*> (o .:? "firstName") + <*> (o .:? "lastName") + <*> (o .:? "email") + <*> (o .:? "password") + <*> (o .:? "phone") + <*> (o .:? "userStatus") + +-- | ToJSON User +instance A.ToJSON User where + toJSON User {..} = + _omitNulls + [ "id" .= userId + , "username" .= userUsername + , "firstName" .= userFirstName + , "lastName" .= userLastName + , "email" .= userEmail + , "password" .= userPassword + , "phone" .= userPhone + , "userStatus" .= userUserStatus + ] --- ** E'EnumQueryInteger - --- | Enum of 'Int' -data E'EnumQueryInteger - = E'EnumQueryInteger'Num1 -- ^ @1@ - | E'EnumQueryInteger'NumMinus_2 -- ^ @-2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger -instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger -instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger -instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumQueryInteger' enum -fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int -fromE'EnumQueryInteger = \case - E'EnumQueryInteger'Num1 -> 1 - E'EnumQueryInteger'NumMinus_2 -> -2 - --- | parse 'E'EnumQueryInteger' enum -toE'EnumQueryInteger :: Int -> P.Either String E'EnumQueryInteger -toE'EnumQueryInteger = \case - 1 -> P.Right E'EnumQueryInteger'Num1 - -2 -> P.Right E'EnumQueryInteger'NumMinus_2 - s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s - - --- ** E'EnumString - --- | Enum of 'Text' -data E'EnumString - = E'EnumString'UPPER -- ^ @"UPPER"@ - | E'EnumString'Lower -- ^ @"lower"@ - | E'EnumString'Empty -- ^ @""@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString -instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString -instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString -instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumString' enum -fromE'EnumString :: E'EnumString -> Text -fromE'EnumString = \case - E'EnumString'UPPER -> "UPPER" - E'EnumString'Lower -> "lower" - E'EnumString'Empty -> "" - --- | parse 'E'EnumString' enum -toE'EnumString :: Text -> P.Either String E'EnumString -toE'EnumString = \case - "UPPER" -> P.Right E'EnumString'UPPER - "lower" -> P.Right E'EnumString'Lower - "" -> P.Right E'EnumString'Empty - s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s - - --- ** E'Inner - --- | Enum of 'Text' -data E'Inner - = E'Inner'UPPER -- ^ @"UPPER"@ - | E'Inner'Lower -- ^ @"lower"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner -instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o -instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner -instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner -instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Inner' enum -fromE'Inner :: E'Inner -> Text -fromE'Inner = \case - E'Inner'UPPER -> "UPPER" - E'Inner'Lower -> "lower" - --- | parse 'E'Inner' enum -toE'Inner :: Text -> P.Either String E'Inner -toE'Inner = \case - "UPPER" -> P.Right E'Inner'UPPER - "lower" -> P.Right E'Inner'Lower - s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s - - --- ** E'JustSymbol - --- | Enum of 'Text' -data E'JustSymbol - = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ - | E'JustSymbol'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol -instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o -instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol -instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol -instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'JustSymbol' enum -fromE'JustSymbol :: E'JustSymbol -> Text -fromE'JustSymbol = \case - E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" - E'JustSymbol'Dollar -> "$" - --- | parse 'E'JustSymbol' enum -toE'JustSymbol :: Text -> P.Either String E'JustSymbol -toE'JustSymbol = \case - ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To - "$" -> P.Right E'JustSymbol'Dollar - s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s - - --- ** E'Status - --- | Enum of 'Text' . --- Order Status -data E'Status - = E'Status'Placed -- ^ @"placed"@ - | E'Status'Approved -- ^ @"approved"@ - | E'Status'Delivered -- ^ @"delivered"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status -instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o -instance WH.ToHttpApiData E'Status where toQueryParam = WH.toQueryParam . fromE'Status -instance WH.FromHttpApiData E'Status where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status -instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Status' enum -fromE'Status :: E'Status -> Text -fromE'Status = \case - E'Status'Placed -> "placed" - E'Status'Approved -> "approved" - E'Status'Delivered -> "delivered" - --- | parse 'E'Status' enum -toE'Status :: Text -> P.Either String E'Status -toE'Status = \case - "placed" -> P.Right E'Status'Placed - "approved" -> P.Right E'Status'Approved - "delivered" -> P.Right E'Status'Delivered - s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s - - --- ** E'Status2 - --- | Enum of 'Text' . --- pet status in the store -data E'Status2 - = E'Status2'Available -- ^ @"available"@ - | E'Status2'Pending -- ^ @"pending"@ - | E'Status2'Sold -- ^ @"sold"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 -instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o -instance WH.ToHttpApiData E'Status2 where toQueryParam = WH.toQueryParam . fromE'Status2 -instance WH.FromHttpApiData E'Status2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status2 -instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Status2' enum -fromE'Status2 :: E'Status2 -> Text -fromE'Status2 = \case - E'Status2'Available -> "available" - E'Status2'Pending -> "pending" - E'Status2'Sold -> "sold" - --- | parse 'E'Status2' enum -toE'Status2 :: Text -> P.Either String E'Status2 -toE'Status2 = \case - "available" -> P.Right E'Status2'Available - "pending" -> P.Right E'Status2'Pending - "sold" -> P.Right E'Status2'Sold - s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s - +-- | Construct a value of type 'User' (by applying it's required fields, if any) +mkUser + :: User +mkUser = + User + { userId = Nothing + , userUsername = Nothing + , userFirstName = Nothing + , userLastName = Nothing + , userEmail = Nothing + , userPassword = Nothing + , userPhone = Nothing + , userUserStatus = Nothing + } + +-- ** XmlItem +-- | XmlItem +data XmlItem = XmlItem + { xmlItemAttributeString :: !(Maybe Text) -- ^ "attribute_string" + , xmlItemAttributeNumber :: !(Maybe Double) -- ^ "attribute_number" + , xmlItemAttributeInteger :: !(Maybe Int) -- ^ "attribute_integer" + , xmlItemAttributeBoolean :: !(Maybe Bool) -- ^ "attribute_boolean" + , xmlItemWrappedArray :: !(Maybe [Int]) -- ^ "wrapped_array" + , xmlItemNameString :: !(Maybe Text) -- ^ "name_string" + , xmlItemNameNumber :: !(Maybe Double) -- ^ "name_number" + , xmlItemNameInteger :: !(Maybe Int) -- ^ "name_integer" + , xmlItemNameBoolean :: !(Maybe Bool) -- ^ "name_boolean" + , xmlItemNameArray :: !(Maybe [Int]) -- ^ "name_array" + , xmlItemNameWrappedArray :: !(Maybe [Int]) -- ^ "name_wrapped_array" + , xmlItemPrefixString :: !(Maybe Text) -- ^ "prefix_string" + , xmlItemPrefixNumber :: !(Maybe Double) -- ^ "prefix_number" + , xmlItemPrefixInteger :: !(Maybe Int) -- ^ "prefix_integer" + , xmlItemPrefixBoolean :: !(Maybe Bool) -- ^ "prefix_boolean" + , xmlItemPrefixArray :: !(Maybe [Int]) -- ^ "prefix_array" + , xmlItemPrefixWrappedArray :: !(Maybe [Int]) -- ^ "prefix_wrapped_array" + , xmlItemNamespaceString :: !(Maybe Text) -- ^ "namespace_string" + , xmlItemNamespaceNumber :: !(Maybe Double) -- ^ "namespace_number" + , xmlItemNamespaceInteger :: !(Maybe Int) -- ^ "namespace_integer" + , xmlItemNamespaceBoolean :: !(Maybe Bool) -- ^ "namespace_boolean" + , xmlItemNamespaceArray :: !(Maybe [Int]) -- ^ "namespace_array" + , xmlItemNamespaceWrappedArray :: !(Maybe [Int]) -- ^ "namespace_wrapped_array" + , xmlItemPrefixNsString :: !(Maybe Text) -- ^ "prefix_ns_string" + , xmlItemPrefixNsNumber :: !(Maybe Double) -- ^ "prefix_ns_number" + , xmlItemPrefixNsInteger :: !(Maybe Int) -- ^ "prefix_ns_integer" + , xmlItemPrefixNsBoolean :: !(Maybe Bool) -- ^ "prefix_ns_boolean" + , xmlItemPrefixNsArray :: !(Maybe [Int]) -- ^ "prefix_ns_array" + , xmlItemPrefixNsWrappedArray :: !(Maybe [Int]) -- ^ "prefix_ns_wrapped_array" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON XmlItem +instance A.FromJSON XmlItem where + parseJSON = A.withObject "XmlItem" $ \o -> + XmlItem + <$> (o .:? "attribute_string") + <*> (o .:? "attribute_number") + <*> (o .:? "attribute_integer") + <*> (o .:? "attribute_boolean") + <*> (o .:? "wrapped_array") + <*> (o .:? "name_string") + <*> (o .:? "name_number") + <*> (o .:? "name_integer") + <*> (o .:? "name_boolean") + <*> (o .:? "name_array") + <*> (o .:? "name_wrapped_array") + <*> (o .:? "prefix_string") + <*> (o .:? "prefix_number") + <*> (o .:? "prefix_integer") + <*> (o .:? "prefix_boolean") + <*> (o .:? "prefix_array") + <*> (o .:? "prefix_wrapped_array") + <*> (o .:? "namespace_string") + <*> (o .:? "namespace_number") + <*> (o .:? "namespace_integer") + <*> (o .:? "namespace_boolean") + <*> (o .:? "namespace_array") + <*> (o .:? "namespace_wrapped_array") + <*> (o .:? "prefix_ns_string") + <*> (o .:? "prefix_ns_number") + <*> (o .:? "prefix_ns_integer") + <*> (o .:? "prefix_ns_boolean") + <*> (o .:? "prefix_ns_array") + <*> (o .:? "prefix_ns_wrapped_array") + +-- | ToJSON XmlItem +instance A.ToJSON XmlItem where + toJSON XmlItem {..} = + _omitNulls + [ "attribute_string" .= xmlItemAttributeString + , "attribute_number" .= xmlItemAttributeNumber + , "attribute_integer" .= xmlItemAttributeInteger + , "attribute_boolean" .= xmlItemAttributeBoolean + , "wrapped_array" .= xmlItemWrappedArray + , "name_string" .= xmlItemNameString + , "name_number" .= xmlItemNameNumber + , "name_integer" .= xmlItemNameInteger + , "name_boolean" .= xmlItemNameBoolean + , "name_array" .= xmlItemNameArray + , "name_wrapped_array" .= xmlItemNameWrappedArray + , "prefix_string" .= xmlItemPrefixString + , "prefix_number" .= xmlItemPrefixNumber + , "prefix_integer" .= xmlItemPrefixInteger + , "prefix_boolean" .= xmlItemPrefixBoolean + , "prefix_array" .= xmlItemPrefixArray + , "prefix_wrapped_array" .= xmlItemPrefixWrappedArray + , "namespace_string" .= xmlItemNamespaceString + , "namespace_number" .= xmlItemNamespaceNumber + , "namespace_integer" .= xmlItemNamespaceInteger + , "namespace_boolean" .= xmlItemNamespaceBoolean + , "namespace_array" .= xmlItemNamespaceArray + , "namespace_wrapped_array" .= xmlItemNamespaceWrappedArray + , "prefix_ns_string" .= xmlItemPrefixNsString + , "prefix_ns_number" .= xmlItemPrefixNsNumber + , "prefix_ns_integer" .= xmlItemPrefixNsInteger + , "prefix_ns_boolean" .= xmlItemPrefixNsBoolean + , "prefix_ns_array" .= xmlItemPrefixNsArray + , "prefix_ns_wrapped_array" .= xmlItemPrefixNsWrappedArray + ] + + +-- | Construct a value of type 'XmlItem' (by applying it's required fields, if any) +mkXmlItem + :: XmlItem +mkXmlItem = + XmlItem + { xmlItemAttributeString = Nothing + , xmlItemAttributeNumber = Nothing + , xmlItemAttributeInteger = Nothing + , xmlItemAttributeBoolean = Nothing + , xmlItemWrappedArray = Nothing + , xmlItemNameString = Nothing + , xmlItemNameNumber = Nothing + , xmlItemNameInteger = Nothing + , xmlItemNameBoolean = Nothing + , xmlItemNameArray = Nothing + , xmlItemNameWrappedArray = Nothing + , xmlItemPrefixString = Nothing + , xmlItemPrefixNumber = Nothing + , xmlItemPrefixInteger = Nothing + , xmlItemPrefixBoolean = Nothing + , xmlItemPrefixArray = Nothing + , xmlItemPrefixWrappedArray = Nothing + , xmlItemNamespaceString = Nothing + , xmlItemNamespaceNumber = Nothing + , xmlItemNamespaceInteger = Nothing + , xmlItemNamespaceBoolean = Nothing + , xmlItemNamespaceArray = Nothing + , xmlItemNamespaceWrappedArray = Nothing + , xmlItemPrefixNsString = Nothing + , xmlItemPrefixNsNumber = Nothing + , xmlItemPrefixNsInteger = Nothing + , xmlItemPrefixNsBoolean = Nothing + , xmlItemPrefixNsArray = Nothing + , xmlItemPrefixNsWrappedArray = Nothing + } + + +-- * Enums + + +-- ** E'ArrayEnum + +-- | Enum of 'Text' +data E'ArrayEnum + = E'ArrayEnum'Fish -- ^ @"fish"@ + | E'ArrayEnum'Crab -- ^ @"crab"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum +instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o +instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum +instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum +instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'ArrayEnum' enum +fromE'ArrayEnum :: E'ArrayEnum -> Text +fromE'ArrayEnum = \case + E'ArrayEnum'Fish -> "fish" + E'ArrayEnum'Crab -> "crab" --- ** EnumClass - --- | Enum of 'Text' -data EnumClass - = EnumClass'_abc -- ^ @"_abc"@ - | EnumClass'_efg -- ^ @"-efg"@ - | EnumClass'_xyz -- ^ @"(xyz)"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass -instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o -instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass -instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass -instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'EnumClass' enum -fromEnumClass :: EnumClass -> Text -fromEnumClass = \case - EnumClass'_abc -> "_abc" - EnumClass'_efg -> "-efg" - EnumClass'_xyz -> "(xyz)" - --- | parse 'EnumClass' enum -toEnumClass :: Text -> P.Either String EnumClass -toEnumClass = \case - "_abc" -> P.Right EnumClass'_abc - "-efg" -> P.Right EnumClass'_efg - "(xyz)" -> P.Right EnumClass'_xyz - s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s - +-- | parse 'E'ArrayEnum' enum +toE'ArrayEnum :: Text -> P.Either String E'ArrayEnum +toE'ArrayEnum = \case + "fish" -> P.Right E'ArrayEnum'Fish + "crab" -> P.Right E'ArrayEnum'Crab + s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s + + +-- ** E'EnumFormString + +-- | Enum of 'Text' . +-- Form parameter enum test (string) +data E'EnumFormString + = E'EnumFormString'_abc -- ^ @"_abc"@ + | E'EnumFormString'_efg -- ^ @"-efg"@ + | E'EnumFormString'_xyz -- ^ @"(xyz)"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString +instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString +instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString +instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumFormString' enum +fromE'EnumFormString :: E'EnumFormString -> Text +fromE'EnumFormString = \case + E'EnumFormString'_abc -> "_abc" + E'EnumFormString'_efg -> "-efg" + E'EnumFormString'_xyz -> "(xyz)" --- ** OuterEnum - --- | Enum of 'Text' -data OuterEnum - = OuterEnum'Placed -- ^ @"placed"@ - | OuterEnum'Approved -- ^ @"approved"@ - | OuterEnum'Delivered -- ^ @"delivered"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) +-- | parse 'E'EnumFormString' enum +toE'EnumFormString :: Text -> P.Either String E'EnumFormString +toE'EnumFormString = \case + "_abc" -> P.Right E'EnumFormString'_abc + "-efg" -> P.Right E'EnumFormString'_efg + "(xyz)" -> P.Right E'EnumFormString'_xyz + s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s + -instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum -instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o -instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum -instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum -instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'OuterEnum' enum -fromOuterEnum :: OuterEnum -> Text -fromOuterEnum = \case - OuterEnum'Placed -> "placed" - OuterEnum'Approved -> "approved" - OuterEnum'Delivered -> "delivered" - --- | parse 'OuterEnum' enum -toOuterEnum :: Text -> P.Either String OuterEnum -toOuterEnum = \case - "placed" -> P.Right OuterEnum'Placed - "approved" -> P.Right OuterEnum'Approved - "delivered" -> P.Right OuterEnum'Delivered - s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s - - --- * Auth Methods - --- ** AuthApiKeyApiKey -data AuthApiKeyApiKey = - AuthApiKeyApiKey Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("api_key", secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthApiKeyApiKeyQuery -data AuthApiKeyApiKeyQuery = - AuthApiKeyApiKeyQuery Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) +-- ** E'EnumFormStringArray + +-- | Enum of 'Text' +data E'EnumFormStringArray + = E'EnumFormStringArray'GreaterThan -- ^ @">"@ + | E'EnumFormStringArray'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumFormStringArray where toJSON = A.toJSON . fromE'EnumFormStringArray +instance A.FromJSON E'EnumFormStringArray where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormStringArray =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormStringArray where toQueryParam = WH.toQueryParam . fromE'EnumFormStringArray +instance WH.FromHttpApiData E'EnumFormStringArray where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormStringArray +instance MimeRender MimeMultipartFormData E'EnumFormStringArray where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumFormStringArray' enum +fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text +fromE'EnumFormStringArray = \case + E'EnumFormStringArray'GreaterThan -> ">" + E'EnumFormStringArray'Dollar -> "$" + +-- | parse 'E'EnumFormStringArray' enum +toE'EnumFormStringArray :: Text -> P.Either String E'EnumFormStringArray +toE'EnumFormStringArray = \case + ">" -> P.Right E'EnumFormStringArray'GreaterThan + "$" -> P.Right E'EnumFormStringArray'Dollar + s -> P.Left $ "toE'EnumFormStringArray: enum parse failure: " P.++ P.show s + + +-- ** E'EnumInteger + +-- | Enum of 'Int' +data E'EnumInteger + = E'EnumInteger'Num1 -- ^ @1@ + | E'EnumInteger'NumMinus_1 -- ^ @-1@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger +instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger +instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger +instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData -instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthBasicHttpBasicTest -data AuthBasicHttpBasicTest = - AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) +-- | unwrap 'E'EnumInteger' enum +fromE'EnumInteger :: E'EnumInteger -> Int +fromE'EnumInteger = \case + E'EnumInteger'Num1 -> 1 + E'EnumInteger'NumMinus_1 -> -1 + +-- | parse 'E'EnumInteger' enum +toE'EnumInteger :: Int -> P.Either String E'EnumInteger +toE'EnumInteger = \case + 1 -> P.Right E'EnumInteger'Num1 + -1 -> P.Right E'EnumInteger'NumMinus_1 + s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s -instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + +-- ** E'EnumNumber + +-- | Enum of 'Double' +data E'EnumNumber + = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ + | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) --- ** AuthOAuthPetstoreAuth -data AuthOAuthPetstoreAuth = - AuthOAuthPetstoreAuth Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthOAuthPetstoreAuth where - applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - - - \ No newline at end of file +instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber +instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber +instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber +instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumNumber' enum +fromE'EnumNumber :: E'EnumNumber -> Double +fromE'EnumNumber = \case + E'EnumNumber'Num1_Dot_1 -> 1.1 + E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 + +-- | parse 'E'EnumNumber' enum +toE'EnumNumber :: Double -> P.Either String E'EnumNumber +toE'EnumNumber = \case + 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 + -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 + s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s + + +-- ** E'EnumQueryInteger + +-- | Enum of 'Int' +data E'EnumQueryInteger + = E'EnumQueryInteger'Num1 -- ^ @1@ + | E'EnumQueryInteger'NumMinus_2 -- ^ @-2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger +instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger +instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger +instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumQueryInteger' enum +fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int +fromE'EnumQueryInteger = \case + E'EnumQueryInteger'Num1 -> 1 + E'EnumQueryInteger'NumMinus_2 -> -2 + +-- | parse 'E'EnumQueryInteger' enum +toE'EnumQueryInteger :: Int -> P.Either String E'EnumQueryInteger +toE'EnumQueryInteger = \case + 1 -> P.Right E'EnumQueryInteger'Num1 + -2 -> P.Right E'EnumQueryInteger'NumMinus_2 + s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s + + +-- ** E'EnumString + +-- | Enum of 'Text' +data E'EnumString + = E'EnumString'UPPER -- ^ @"UPPER"@ + | E'EnumString'Lower -- ^ @"lower"@ + | E'EnumString'Empty -- ^ @""@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString +instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString +instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString +instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumString' enum +fromE'EnumString :: E'EnumString -> Text +fromE'EnumString = \case + E'EnumString'UPPER -> "UPPER" + E'EnumString'Lower -> "lower" + E'EnumString'Empty -> "" + +-- | parse 'E'EnumString' enum +toE'EnumString :: Text -> P.Either String E'EnumString +toE'EnumString = \case + "UPPER" -> P.Right E'EnumString'UPPER + "lower" -> P.Right E'EnumString'Lower + "" -> P.Right E'EnumString'Empty + s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s + + +-- ** E'Inner + +-- | Enum of 'Text' +data E'Inner + = E'Inner'UPPER -- ^ @"UPPER"@ + | E'Inner'Lower -- ^ @"lower"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner +instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o +instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner +instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner +instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Inner' enum +fromE'Inner :: E'Inner -> Text +fromE'Inner = \case + E'Inner'UPPER -> "UPPER" + E'Inner'Lower -> "lower" + +-- | parse 'E'Inner' enum +toE'Inner :: Text -> P.Either String E'Inner +toE'Inner = \case + "UPPER" -> P.Right E'Inner'UPPER + "lower" -> P.Right E'Inner'Lower + s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s + + +-- ** E'JustSymbol + +-- | Enum of 'Text' +data E'JustSymbol + = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ + | E'JustSymbol'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol +instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o +instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol +instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol +instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'JustSymbol' enum +fromE'JustSymbol :: E'JustSymbol -> Text +fromE'JustSymbol = \case + E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" + E'JustSymbol'Dollar -> "$" + +-- | parse 'E'JustSymbol' enum +toE'JustSymbol :: Text -> P.Either String E'JustSymbol +toE'JustSymbol = \case + ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To + "$" -> P.Right E'JustSymbol'Dollar + s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s + + +-- ** E'Status + +-- | Enum of 'Text' . +-- Order Status +data E'Status + = E'Status'Placed -- ^ @"placed"@ + | E'Status'Approved -- ^ @"approved"@ + | E'Status'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status +instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o +instance WH.ToHttpApiData E'Status where toQueryParam = WH.toQueryParam . fromE'Status +instance WH.FromHttpApiData E'Status where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status +instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Status' enum +fromE'Status :: E'Status -> Text +fromE'Status = \case + E'Status'Placed -> "placed" + E'Status'Approved -> "approved" + E'Status'Delivered -> "delivered" + +-- | parse 'E'Status' enum +toE'Status :: Text -> P.Either String E'Status +toE'Status = \case + "placed" -> P.Right E'Status'Placed + "approved" -> P.Right E'Status'Approved + "delivered" -> P.Right E'Status'Delivered + s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s + + +-- ** E'Status2 + +-- | Enum of 'Text' . +-- pet status in the store +data E'Status2 + = E'Status2'Available -- ^ @"available"@ + | E'Status2'Pending -- ^ @"pending"@ + | E'Status2'Sold -- ^ @"sold"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 +instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o +instance WH.ToHttpApiData E'Status2 where toQueryParam = WH.toQueryParam . fromE'Status2 +instance WH.FromHttpApiData E'Status2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status2 +instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Status2' enum +fromE'Status2 :: E'Status2 -> Text +fromE'Status2 = \case + E'Status2'Available -> "available" + E'Status2'Pending -> "pending" + E'Status2'Sold -> "sold" + +-- | parse 'E'Status2' enum +toE'Status2 :: Text -> P.Either String E'Status2 +toE'Status2 = \case + "available" -> P.Right E'Status2'Available + "pending" -> P.Right E'Status2'Pending + "sold" -> P.Right E'Status2'Sold + s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s + + +-- ** EnumClass + +-- | Enum of 'Text' +data EnumClass + = EnumClass'_abc -- ^ @"_abc"@ + | EnumClass'_efg -- ^ @"-efg"@ + | EnumClass'_xyz -- ^ @"(xyz)"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass +instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o +instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass +instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass +instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'EnumClass' enum +fromEnumClass :: EnumClass -> Text +fromEnumClass = \case + EnumClass'_abc -> "_abc" + EnumClass'_efg -> "-efg" + EnumClass'_xyz -> "(xyz)" + +-- | parse 'EnumClass' enum +toEnumClass :: Text -> P.Either String EnumClass +toEnumClass = \case + "_abc" -> P.Right EnumClass'_abc + "-efg" -> P.Right EnumClass'_efg + "(xyz)" -> P.Right EnumClass'_xyz + s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s + + +-- ** OuterEnum + +-- | Enum of 'Text' +data OuterEnum + = OuterEnum'Placed -- ^ @"placed"@ + | OuterEnum'Approved -- ^ @"approved"@ + | OuterEnum'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum +instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum +instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum +instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'OuterEnum' enum +fromOuterEnum :: OuterEnum -> Text +fromOuterEnum = \case + OuterEnum'Placed -> "placed" + OuterEnum'Approved -> "approved" + OuterEnum'Delivered -> "delivered" + +-- | parse 'OuterEnum' enum +toOuterEnum :: Text -> P.Either String OuterEnum +toOuterEnum = \case + "placed" -> P.Right OuterEnum'Placed + "approved" -> P.Right OuterEnum'Approved + "delivered" -> P.Right OuterEnum'Delivered + s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s + + +-- * Auth Methods + +-- ** AuthApiKeyApiKey +data AuthApiKeyApiKey = + AuthApiKeyApiKey Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKey where + applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + +-- ** AuthOAuthPetstoreAuth +data AuthOAuthPetstoreAuth = + AuthOAuthPetstoreAuth Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthOAuthPetstoreAuth where + applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html index 57c10a264499..916e54cf31c8 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html @@ -36,831 +36,957 @@ import OpenAPIPetstore.Core --- * AdditionalPropertiesClass +-- * AdditionalPropertiesAnyType --- | 'additionalPropertiesClassMapProperty' Lens -additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) -additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty -{-# INLINE additionalPropertiesClassMapPropertyL #-} +-- | 'additionalPropertiesAnyTypeName' Lens +additionalPropertiesAnyTypeNameL :: Lens_' AdditionalPropertiesAnyType (Maybe Text) +additionalPropertiesAnyTypeNameL f AdditionalPropertiesAnyType{..} = (\additionalPropertiesAnyTypeName -> AdditionalPropertiesAnyType { additionalPropertiesAnyTypeName, ..} ) <$> f additionalPropertiesAnyTypeName +{-# INLINE additionalPropertiesAnyTypeNameL #-} --- | 'additionalPropertiesClassMapOfMapProperty' Lens -additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) -additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty -{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} - - - --- * Animal + + +-- * AdditionalPropertiesArray + +-- | 'additionalPropertiesArrayName' Lens +additionalPropertiesArrayNameL :: Lens_' AdditionalPropertiesArray (Maybe Text) +additionalPropertiesArrayNameL f AdditionalPropertiesArray{..} = (\additionalPropertiesArrayName -> AdditionalPropertiesArray { additionalPropertiesArrayName, ..} ) <$> f additionalPropertiesArrayName +{-# INLINE additionalPropertiesArrayNameL #-} --- | 'animalClassName' Lens -animalClassNameL :: Lens_' Animal (Text) -animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName -{-# INLINE animalClassNameL #-} - --- | 'animalColor' Lens -animalColorL :: Lens_' Animal (Maybe Text) -animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor -{-# INLINE animalColorL #-} + + +-- * AdditionalPropertiesBoolean + +-- | 'additionalPropertiesBooleanName' Lens +additionalPropertiesBooleanNameL :: Lens_' AdditionalPropertiesBoolean (Maybe Text) +additionalPropertiesBooleanNameL f AdditionalPropertiesBoolean{..} = (\additionalPropertiesBooleanName -> AdditionalPropertiesBoolean { additionalPropertiesBooleanName, ..} ) <$> f additionalPropertiesBooleanName +{-# INLINE additionalPropertiesBooleanNameL #-} + - --- * ApiResponse - --- | 'apiResponseCode' Lens -apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) -apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode -{-# INLINE apiResponseCodeL #-} - --- | 'apiResponseType' Lens -apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) -apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType -{-# INLINE apiResponseTypeL #-} - --- | 'apiResponseMessage' Lens -apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) -apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage -{-# INLINE apiResponseMessageL #-} - - - --- * ArrayOfArrayOfNumberOnly +-- * AdditionalPropertiesClass + +-- | 'additionalPropertiesClassMapString' Lens +additionalPropertiesClassMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) +additionalPropertiesClassMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapString, ..} ) <$> f additionalPropertiesClassMapString +{-# INLINE additionalPropertiesClassMapStringL #-} + +-- | 'additionalPropertiesClassMapNumber' Lens +additionalPropertiesClassMapNumberL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Double)) +additionalPropertiesClassMapNumberL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapNumber -> AdditionalPropertiesClass { additionalPropertiesClassMapNumber, ..} ) <$> f additionalPropertiesClassMapNumber +{-# INLINE additionalPropertiesClassMapNumberL #-} + +-- | 'additionalPropertiesClassMapInteger' Lens +additionalPropertiesClassMapIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Int)) +additionalPropertiesClassMapIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapInteger, ..} ) <$> f additionalPropertiesClassMapInteger +{-# INLINE additionalPropertiesClassMapIntegerL #-} + +-- | 'additionalPropertiesClassMapBoolean' Lens +additionalPropertiesClassMapBooleanL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Bool)) +additionalPropertiesClassMapBooleanL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapBoolean -> AdditionalPropertiesClass { additionalPropertiesClassMapBoolean, ..} ) <$> f additionalPropertiesClassMapBoolean +{-# INLINE additionalPropertiesClassMapBooleanL #-} --- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens -arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) -arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber -{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} +-- | 'additionalPropertiesClassMapArrayInteger' Lens +additionalPropertiesClassMapArrayIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [Int])) +additionalPropertiesClassMapArrayIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayInteger, ..} ) <$> f additionalPropertiesClassMapArrayInteger +{-# INLINE additionalPropertiesClassMapArrayIntegerL #-} - - --- * ArrayOfNumberOnly - --- | 'arrayOfNumberOnlyArrayNumber' Lens -arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) -arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber -{-# INLINE arrayOfNumberOnlyArrayNumberL #-} - +-- | 'additionalPropertiesClassMapArrayAnytype' Lens +additionalPropertiesClassMapArrayAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [A.Value])) +additionalPropertiesClassMapArrayAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayAnytype, ..} ) <$> f additionalPropertiesClassMapArrayAnytype +{-# INLINE additionalPropertiesClassMapArrayAnytypeL #-} + +-- | 'additionalPropertiesClassMapMapString' Lens +additionalPropertiesClassMapMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) +additionalPropertiesClassMapMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapMapString, ..} ) <$> f additionalPropertiesClassMapMapString +{-# INLINE additionalPropertiesClassMapMapStringL #-} - --- * ArrayTest - --- | 'arrayTestArrayOfString' Lens -arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) -arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString -{-# INLINE arrayTestArrayOfStringL #-} - --- | 'arrayTestArrayArrayOfInteger' Lens -arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]]) -arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger -{-# INLINE arrayTestArrayArrayOfIntegerL #-} - --- | 'arrayTestArrayArrayOfModel' Lens -arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) -arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel -{-# INLINE arrayTestArrayArrayOfModelL #-} - - +-- | 'additionalPropertiesClassMapMapAnytype' Lens +additionalPropertiesClassMapMapAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String A.Value))) +additionalPropertiesClassMapMapAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapMapAnytype, ..} ) <$> f additionalPropertiesClassMapMapAnytype +{-# INLINE additionalPropertiesClassMapMapAnytypeL #-} + +-- | 'additionalPropertiesClassAnytype1' Lens +additionalPropertiesClassAnytype1L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) +additionalPropertiesClassAnytype1L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype1 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype1, ..} ) <$> f additionalPropertiesClassAnytype1 +{-# INLINE additionalPropertiesClassAnytype1L #-} + +-- | 'additionalPropertiesClassAnytype2' Lens +additionalPropertiesClassAnytype2L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) +additionalPropertiesClassAnytype2L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype2 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype2, ..} ) <$> f additionalPropertiesClassAnytype2 +{-# INLINE additionalPropertiesClassAnytype2L #-} + +-- | 'additionalPropertiesClassAnytype3' Lens +additionalPropertiesClassAnytype3L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) +additionalPropertiesClassAnytype3L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype3 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype3, ..} ) <$> f additionalPropertiesClassAnytype3 +{-# INLINE additionalPropertiesClassAnytype3L #-} --- * Capitalization + --- | 'capitalizationSmallCamel' Lens -capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel -{-# INLINE capitalizationSmallCamelL #-} - --- | 'capitalizationCapitalCamel' Lens -capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel -{-# INLINE capitalizationCapitalCamelL #-} - --- | 'capitalizationSmallSnake' Lens -capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake -{-# INLINE capitalizationSmallSnakeL #-} - --- | 'capitalizationCapitalSnake' Lens -capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake -{-# INLINE capitalizationCapitalSnakeL #-} +-- * AdditionalPropertiesInteger + +-- | 'additionalPropertiesIntegerName' Lens +additionalPropertiesIntegerNameL :: Lens_' AdditionalPropertiesInteger (Maybe Text) +additionalPropertiesIntegerNameL f AdditionalPropertiesInteger{..} = (\additionalPropertiesIntegerName -> AdditionalPropertiesInteger { additionalPropertiesIntegerName, ..} ) <$> f additionalPropertiesIntegerName +{-# INLINE additionalPropertiesIntegerNameL #-} + + + +-- * AdditionalPropertiesNumber + +-- | 'additionalPropertiesNumberName' Lens +additionalPropertiesNumberNameL :: Lens_' AdditionalPropertiesNumber (Maybe Text) +additionalPropertiesNumberNameL f AdditionalPropertiesNumber{..} = (\additionalPropertiesNumberName -> AdditionalPropertiesNumber { additionalPropertiesNumberName, ..} ) <$> f additionalPropertiesNumberName +{-# INLINE additionalPropertiesNumberNameL #-} + + + +-- * AdditionalPropertiesObject --- | 'capitalizationScaEthFlowPoints' Lens -capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) -capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints -{-# INLINE capitalizationScaEthFlowPointsL #-} +-- | 'additionalPropertiesObjectName' Lens +additionalPropertiesObjectNameL :: Lens_' AdditionalPropertiesObject (Maybe Text) +additionalPropertiesObjectNameL f AdditionalPropertiesObject{..} = (\additionalPropertiesObjectName -> AdditionalPropertiesObject { additionalPropertiesObjectName, ..} ) <$> f additionalPropertiesObjectName +{-# INLINE additionalPropertiesObjectNameL #-} --- | 'capitalizationAttName' Lens -capitalizationAttNameL :: Lens_' Capitalization (Maybe Text) -capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName -{-# INLINE capitalizationAttNameL #-} - - - --- * Cat + + +-- * AdditionalPropertiesString + +-- | 'additionalPropertiesStringName' Lens +additionalPropertiesStringNameL :: Lens_' AdditionalPropertiesString (Maybe Text) +additionalPropertiesStringNameL f AdditionalPropertiesString{..} = (\additionalPropertiesStringName -> AdditionalPropertiesString { additionalPropertiesStringName, ..} ) <$> f additionalPropertiesStringName +{-# INLINE additionalPropertiesStringNameL #-} --- | 'catClassName' Lens -catClassNameL :: Lens_' Cat (Text) -catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName -{-# INLINE catClassNameL #-} - --- | 'catColor' Lens -catColorL :: Lens_' Cat (Maybe Text) -catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor -{-# INLINE catColorL #-} - --- | 'catDeclawed' Lens -catDeclawedL :: Lens_' Cat (Maybe Bool) -catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed -{-# INLINE catDeclawedL #-} + + +-- * Animal + +-- | 'animalClassName' Lens +animalClassNameL :: Lens_' Animal (Text) +animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName +{-# INLINE animalClassNameL #-} + +-- | 'animalColor' Lens +animalColorL :: Lens_' Animal (Maybe Text) +animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor +{-# INLINE animalColorL #-} + - --- * Category - --- | 'categoryId' Lens -categoryIdL :: Lens_' Category (Maybe Integer) -categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId -{-# INLINE categoryIdL #-} - --- | 'categoryName' Lens -categoryNameL :: Lens_' Category (Text) -categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName -{-# INLINE categoryNameL #-} - - - --- * ClassModel +-- * ApiResponse + +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode +{-# INLINE apiResponseCodeL #-} + +-- | 'apiResponseType' Lens +apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) +apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType +{-# INLINE apiResponseTypeL #-} + +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} --- | 'classModelClass' Lens -classModelClassL :: Lens_' ClassModel (Maybe Text) -classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass -{-# INLINE classModelClassL #-} - - - --- * Client + + +-- * ArrayOfArrayOfNumberOnly + +-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens +arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} --- | 'clientClient' Lens -clientClientL :: Lens_' Client (Maybe Text) -clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient -{-# INLINE clientClientL #-} - - - --- * Dog + + +-- * ArrayOfNumberOnly + +-- | 'arrayOfNumberOnlyArrayNumber' Lens +arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +{-# INLINE arrayOfNumberOnlyArrayNumberL #-} --- | 'dogClassName' Lens -dogClassNameL :: Lens_' Dog (Text) -dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName -{-# INLINE dogClassNameL #-} - --- | 'dogColor' Lens -dogColorL :: Lens_' Dog (Maybe Text) -dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor -{-# INLINE dogColorL #-} - --- | 'dogBreed' Lens -dogBreedL :: Lens_' Dog (Maybe Text) -dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed -{-# INLINE dogBreedL #-} - - - --- * EnumArrays + + +-- * ArrayTest + +-- | 'arrayTestArrayOfString' Lens +arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) +arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString +{-# INLINE arrayTestArrayOfStringL #-} + +-- | 'arrayTestArrayArrayOfInteger' Lens +arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]]) +arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger +{-# INLINE arrayTestArrayArrayOfIntegerL #-} + +-- | 'arrayTestArrayArrayOfModel' Lens +arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +{-# INLINE arrayTestArrayArrayOfModelL #-} --- | 'enumArraysJustSymbol' Lens -enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) -enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol -{-# INLINE enumArraysJustSymbolL #-} - --- | 'enumArraysArrayEnum' Lens -enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum]) -enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum -{-# INLINE enumArraysArrayEnumL #-} - - - --- * EnumClass + + +-- * Capitalization + +-- | 'capitalizationSmallCamel' Lens +capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) +capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel +{-# INLINE capitalizationSmallCamelL #-} + +-- | 'capitalizationCapitalCamel' Lens +capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text) +capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel +{-# INLINE capitalizationCapitalCamelL #-} - - --- * EnumTest - --- | 'enumTestEnumString' Lens -enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString) -enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString -{-# INLINE enumTestEnumStringL #-} - --- | 'enumTestEnumStringRequired' Lens -enumTestEnumStringRequiredL :: Lens_' EnumTest (E'EnumString) -enumTestEnumStringRequiredL f EnumTest{..} = (\enumTestEnumStringRequired -> EnumTest { enumTestEnumStringRequired, ..} ) <$> f enumTestEnumStringRequired -{-# INLINE enumTestEnumStringRequiredL #-} - --- | 'enumTestEnumInteger' Lens -enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger) -enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger -{-# INLINE enumTestEnumIntegerL #-} - --- | 'enumTestEnumNumber' Lens -enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber) -enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber -{-# INLINE enumTestEnumNumberL #-} +-- | 'capitalizationSmallSnake' Lens +capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) +capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake +{-# INLINE capitalizationSmallSnakeL #-} + +-- | 'capitalizationCapitalSnake' Lens +capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text) +capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake +{-# INLINE capitalizationCapitalSnakeL #-} + +-- | 'capitalizationScaEthFlowPoints' Lens +capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) +capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints +{-# INLINE capitalizationScaEthFlowPointsL #-} + +-- | 'capitalizationAttName' Lens +capitalizationAttNameL :: Lens_' Capitalization (Maybe Text) +capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName +{-# INLINE capitalizationAttNameL #-} + + + +-- * Cat --- | 'enumTestOuterEnum' Lens -enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) -enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum -{-# INLINE enumTestOuterEnumL #-} +-- | 'catClassName' Lens +catClassNameL :: Lens_' Cat (Text) +catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName +{-# INLINE catClassNameL #-} - - --- * File - --- | 'fileSourceUri' Lens -fileSourceUriL :: Lens_' File (Maybe Text) -fileSourceUriL f File{..} = (\fileSourceUri -> File { fileSourceUri, ..} ) <$> f fileSourceUri -{-# INLINE fileSourceUriL #-} - +-- | 'catColor' Lens +catColorL :: Lens_' Cat (Maybe Text) +catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor +{-# INLINE catColorL #-} + +-- | 'catDeclawed' Lens +catDeclawedL :: Lens_' Cat (Maybe Bool) +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +{-# INLINE catDeclawedL #-} --- * FileSchemaTestClass - --- | 'fileSchemaTestClassFile' Lens -fileSchemaTestClassFileL :: Lens_' FileSchemaTestClass (Maybe File) -fileSchemaTestClassFileL f FileSchemaTestClass{..} = (\fileSchemaTestClassFile -> FileSchemaTestClass { fileSchemaTestClassFile, ..} ) <$> f fileSchemaTestClassFile -{-# INLINE fileSchemaTestClassFileL #-} - --- | 'fileSchemaTestClassFiles' Lens -fileSchemaTestClassFilesL :: Lens_' FileSchemaTestClass (Maybe [File]) -fileSchemaTestClassFilesL f FileSchemaTestClass{..} = (\fileSchemaTestClassFiles -> FileSchemaTestClass { fileSchemaTestClassFiles, ..} ) <$> f fileSchemaTestClassFiles -{-# INLINE fileSchemaTestClassFilesL #-} + +-- * CatAllOf + +-- | 'catAllOfDeclawed' Lens +catAllOfDeclawedL :: Lens_' CatAllOf (Maybe Bool) +catAllOfDeclawedL f CatAllOf{..} = (\catAllOfDeclawed -> CatAllOf { catAllOfDeclawed, ..} ) <$> f catAllOfDeclawed +{-# INLINE catAllOfDeclawedL #-} + + + +-- * Category - - --- * FormatTest - --- | 'formatTestInteger' Lens -formatTestIntegerL :: Lens_' FormatTest (Maybe Int) -formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger -{-# INLINE formatTestIntegerL #-} - --- | 'formatTestInt32' Lens -formatTestInt32L :: Lens_' FormatTest (Maybe Int) -formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 -{-# INLINE formatTestInt32L #-} +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId +{-# INLINE categoryIdL #-} + +-- | 'categoryName' Lens +categoryNameL :: Lens_' Category (Text) +categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName +{-# INLINE categoryNameL #-} + + + +-- * ClassModel --- | 'formatTestInt64' Lens -formatTestInt64L :: Lens_' FormatTest (Maybe Integer) -formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 -{-# INLINE formatTestInt64L #-} +-- | 'classModelClass' Lens +classModelClassL :: Lens_' ClassModel (Maybe Text) +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +{-# INLINE classModelClassL #-} --- | 'formatTestNumber' Lens -formatTestNumberL :: Lens_' FormatTest (Double) -formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber -{-# INLINE formatTestNumberL #-} - --- | 'formatTestFloat' Lens -formatTestFloatL :: Lens_' FormatTest (Maybe Float) -formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat -{-# INLINE formatTestFloatL #-} + + +-- * Client + +-- | 'clientClient' Lens +clientClientL :: Lens_' Client (Maybe Text) +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +{-# INLINE clientClientL #-} + --- | 'formatTestDouble' Lens -formatTestDoubleL :: Lens_' FormatTest (Maybe Double) -formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble -{-# INLINE formatTestDoubleL #-} - --- | 'formatTestString' Lens -formatTestStringL :: Lens_' FormatTest (Maybe Text) -formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString -{-# INLINE formatTestStringL #-} - --- | 'formatTestByte' Lens -formatTestByteL :: Lens_' FormatTest (ByteArray) -formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte -{-# INLINE formatTestByteL #-} - --- | 'formatTestBinary' Lens -formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath) -formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary -{-# INLINE formatTestBinaryL #-} + +-- * Dog + +-- | 'dogClassName' Lens +dogClassNameL :: Lens_' Dog (Text) +dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName +{-# INLINE dogClassNameL #-} + +-- | 'dogColor' Lens +dogColorL :: Lens_' Dog (Maybe Text) +dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor +{-# INLINE dogColorL #-} + +-- | 'dogBreed' Lens +dogBreedL :: Lens_' Dog (Maybe Text) +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +{-# INLINE dogBreedL #-} + + --- | 'formatTestDate' Lens -formatTestDateL :: Lens_' FormatTest (Date) -formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate -{-# INLINE formatTestDateL #-} - --- | 'formatTestDateTime' Lens -formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime) -formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime -{-# INLINE formatTestDateTimeL #-} - --- | 'formatTestUuid' Lens -formatTestUuidL :: Lens_' FormatTest (Maybe Text) -formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid -{-# INLINE formatTestUuidL #-} - --- | 'formatTestPassword' Lens -formatTestPasswordL :: Lens_' FormatTest (Text) -formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword -{-# INLINE formatTestPasswordL #-} - +-- * DogAllOf + +-- | 'dogAllOfBreed' Lens +dogAllOfBreedL :: Lens_' DogAllOf (Maybe Text) +dogAllOfBreedL f DogAllOf{..} = (\dogAllOfBreed -> DogAllOf { dogAllOfBreed, ..} ) <$> f dogAllOfBreed +{-# INLINE dogAllOfBreedL #-} + + + +-- * EnumArrays + +-- | 'enumArraysJustSymbol' Lens +enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +{-# INLINE enumArraysJustSymbolL #-} + +-- | 'enumArraysArrayEnum' Lens +enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum]) +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +{-# INLINE enumArraysArrayEnumL #-} --- * HasOnlyReadOnly - --- | 'hasOnlyReadOnlyBar' Lens -hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar -{-# INLINE hasOnlyReadOnlyBarL #-} + +-- * EnumClass + + + +-- * EnumTest --- | 'hasOnlyReadOnlyFoo' Lens -hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo -{-# INLINE hasOnlyReadOnlyFooL #-} +-- | 'enumTestEnumString' Lens +enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString) +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +{-# INLINE enumTestEnumStringL #-} - - --- * MapTest - --- | 'mapTestMapMapOfString' Lens -mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) -mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString -{-# INLINE mapTestMapMapOfStringL #-} - --- | 'mapTestMapOfEnumString' Lens -mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String E'Inner)) -mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString -{-# INLINE mapTestMapOfEnumStringL #-} - --- | 'mapTestDirectMap' Lens -mapTestDirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) -mapTestDirectMapL f MapTest{..} = (\mapTestDirectMap -> MapTest { mapTestDirectMap, ..} ) <$> f mapTestDirectMap -{-# INLINE mapTestDirectMapL #-} - --- | 'mapTestIndirectMap' Lens -mapTestIndirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) -mapTestIndirectMapL f MapTest{..} = (\mapTestIndirectMap -> MapTest { mapTestIndirectMap, ..} ) <$> f mapTestIndirectMap -{-# INLINE mapTestIndirectMapL #-} +-- | 'enumTestEnumStringRequired' Lens +enumTestEnumStringRequiredL :: Lens_' EnumTest (E'EnumString) +enumTestEnumStringRequiredL f EnumTest{..} = (\enumTestEnumStringRequired -> EnumTest { enumTestEnumStringRequired, ..} ) <$> f enumTestEnumStringRequired +{-# INLINE enumTestEnumStringRequiredL #-} + +-- | 'enumTestEnumInteger' Lens +enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger) +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +{-# INLINE enumTestEnumIntegerL #-} + +-- | 'enumTestEnumNumber' Lens +enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber) +enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber +{-# INLINE enumTestEnumNumberL #-} + +-- | 'enumTestOuterEnum' Lens +enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) +enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum +{-# INLINE enumTestOuterEnumL #-} + + + +-- * File - - --- * MixedPropertiesAndAdditionalPropertiesClass - --- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens -mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) -mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-} +-- | 'fileSourceUri' Lens +fileSourceUriL :: Lens_' File (Maybe Text) +fileSourceUriL f File{..} = (\fileSourceUri -> File { fileSourceUri, ..} ) <$> f fileSourceUri +{-# INLINE fileSourceUriL #-} + + + +-- * FileSchemaTestClass --- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens -mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime) -mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} +-- | 'fileSchemaTestClassFile' Lens +fileSchemaTestClassFileL :: Lens_' FileSchemaTestClass (Maybe File) +fileSchemaTestClassFileL f FileSchemaTestClass{..} = (\fileSchemaTestClassFile -> FileSchemaTestClass { fileSchemaTestClassFile, ..} ) <$> f fileSchemaTestClassFile +{-# INLINE fileSchemaTestClassFileL #-} --- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens -mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) -mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} +-- | 'fileSchemaTestClassFiles' Lens +fileSchemaTestClassFilesL :: Lens_' FileSchemaTestClass (Maybe [File]) +fileSchemaTestClassFilesL f FileSchemaTestClass{..} = (\fileSchemaTestClassFiles -> FileSchemaTestClass { fileSchemaTestClassFiles, ..} ) <$> f fileSchemaTestClassFiles +{-# INLINE fileSchemaTestClassFilesL #-} --- * Model200Response +-- * FormatTest --- | 'model200ResponseName' Lens -model200ResponseNameL :: Lens_' Model200Response (Maybe Int) -model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName -{-# INLINE model200ResponseNameL #-} +-- | 'formatTestInteger' Lens +formatTestIntegerL :: Lens_' FormatTest (Maybe Int) +formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger +{-# INLINE formatTestIntegerL #-} --- | 'model200ResponseClass' Lens -model200ResponseClassL :: Lens_' Model200Response (Maybe Text) -model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass -{-# INLINE model200ResponseClassL #-} +-- | 'formatTestInt32' Lens +formatTestInt32L :: Lens_' FormatTest (Maybe Int) +formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 +{-# INLINE formatTestInt32L #-} - - --- * ModelList - --- | 'modelList123list' Lens -modelList123listL :: Lens_' ModelList (Maybe Text) -modelList123listL f ModelList{..} = (\modelList123list -> ModelList { modelList123list, ..} ) <$> f modelList123list -{-# INLINE modelList123listL #-} - +-- | 'formatTestInt64' Lens +formatTestInt64L :: Lens_' FormatTest (Maybe Integer) +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +{-# INLINE formatTestInt64L #-} + +-- | 'formatTestNumber' Lens +formatTestNumberL :: Lens_' FormatTest (Double) +formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber +{-# INLINE formatTestNumberL #-} - --- * ModelReturn - --- | 'modelReturnReturn' Lens -modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) -modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn -{-# INLINE modelReturnReturnL #-} - - +-- | 'formatTestFloat' Lens +formatTestFloatL :: Lens_' FormatTest (Maybe Float) +formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat +{-# INLINE formatTestFloatL #-} + +-- | 'formatTestDouble' Lens +formatTestDoubleL :: Lens_' FormatTest (Maybe Double) +formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble +{-# INLINE formatTestDoubleL #-} --- * Name - --- | 'nameName' Lens -nameNameL :: Lens_' Name (Int) -nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName -{-# INLINE nameNameL #-} - --- | 'nameSnakeCase' Lens -nameSnakeCaseL :: Lens_' Name (Maybe Int) -nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase -{-# INLINE nameSnakeCaseL #-} - --- | 'nameProperty' Lens -namePropertyL :: Lens_' Name (Maybe Text) -namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty -{-# INLINE namePropertyL #-} - --- | 'name123number' Lens -name123numberL :: Lens_' Name (Maybe Int) -name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f name123number -{-# INLINE name123numberL #-} - - - --- * NumberOnly - --- | 'numberOnlyJustNumber' Lens -numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) -numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber -{-# INLINE numberOnlyJustNumberL #-} - - - --- * Order +-- | 'formatTestString' Lens +formatTestStringL :: Lens_' FormatTest (Maybe Text) +formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString +{-# INLINE formatTestStringL #-} + +-- | 'formatTestByte' Lens +formatTestByteL :: Lens_' FormatTest (ByteArray) +formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte +{-# INLINE formatTestByteL #-} + +-- | 'formatTestBinary' Lens +formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath) +formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary +{-# INLINE formatTestBinaryL #-} + +-- | 'formatTestDate' Lens +formatTestDateL :: Lens_' FormatTest (Date) +formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate +{-# INLINE formatTestDateL #-} + +-- | 'formatTestDateTime' Lens +formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime) +formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime +{-# INLINE formatTestDateTimeL #-} + +-- | 'formatTestUuid' Lens +formatTestUuidL :: Lens_' FormatTest (Maybe Text) +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +{-# INLINE formatTestUuidL #-} + +-- | 'formatTestPassword' Lens +formatTestPasswordL :: Lens_' FormatTest (Text) +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +{-# INLINE formatTestPasswordL #-} --- | 'orderId' Lens -orderIdL :: Lens_' Order (Maybe Integer) -orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId -{-# INLINE orderIdL #-} - --- | 'orderPetId' Lens -orderPetIdL :: Lens_' Order (Maybe Integer) -orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId -{-# INLINE orderPetIdL #-} - --- | 'orderQuantity' Lens -orderQuantityL :: Lens_' Order (Maybe Int) -orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity -{-# INLINE orderQuantityL #-} + + +-- * HasOnlyReadOnly + +-- | 'hasOnlyReadOnlyBar' Lens +hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) +hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar +{-# INLINE hasOnlyReadOnlyBarL #-} + +-- | 'hasOnlyReadOnlyFoo' Lens +hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text) +hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo +{-# INLINE hasOnlyReadOnlyFooL #-} + --- | 'orderShipDate' Lens -orderShipDateL :: Lens_' Order (Maybe DateTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate -{-# INLINE orderShipDateL #-} - --- | 'orderStatus' Lens -orderStatusL :: Lens_' Order (Maybe E'Status) -orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus -{-# INLINE orderStatusL #-} - --- | 'orderComplete' Lens -orderCompleteL :: Lens_' Order (Maybe Bool) -orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete -{-# INLINE orderCompleteL #-} - - - --- * OuterComposite - --- | 'outerCompositeMyNumber' Lens -outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe Double) -outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber -{-# INLINE outerCompositeMyNumberL #-} + +-- * MapTest + +-- | 'mapTestMapMapOfString' Lens +mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +{-# INLINE mapTestMapMapOfStringL #-} + +-- | 'mapTestMapOfEnumString' Lens +mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String E'Inner)) +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +{-# INLINE mapTestMapOfEnumStringL #-} + +-- | 'mapTestDirectMap' Lens +mapTestDirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) +mapTestDirectMapL f MapTest{..} = (\mapTestDirectMap -> MapTest { mapTestDirectMap, ..} ) <$> f mapTestDirectMap +{-# INLINE mapTestDirectMapL #-} + +-- | 'mapTestIndirectMap' Lens +mapTestIndirectMapL :: Lens_' MapTest (Maybe (Map.Map String Bool)) +mapTestIndirectMapL f MapTest{..} = (\mapTestIndirectMap -> MapTest { mapTestIndirectMap, ..} ) <$> f mapTestIndirectMap +{-# INLINE mapTestIndirectMapL #-} + --- | 'outerCompositeMyString' Lens -outerCompositeMyStringL :: Lens_' OuterComposite (Maybe Text) -outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString -{-# INLINE outerCompositeMyStringL #-} - --- | 'outerCompositeMyBoolean' Lens -outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe Bool) -outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean -{-# INLINE outerCompositeMyBooleanL #-} - - - --- * OuterEnum - - - --- * Pet + +-- * MixedPropertiesAndAdditionalPropertiesClass + +-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens +mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) +mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens +mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime) +mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens +mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} --- | 'petId' Lens -petIdL :: Lens_' Pet (Maybe Integer) -petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId -{-# INLINE petIdL #-} - --- | 'petCategory' Lens -petCategoryL :: Lens_' Pet (Maybe Category) -petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory -{-# INLINE petCategoryL #-} - --- | 'petName' Lens -petNameL :: Lens_' Pet (Text) -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName -{-# INLINE petNameL #-} + + +-- * Model200Response + +-- | 'model200ResponseName' Lens +model200ResponseNameL :: Lens_' Model200Response (Maybe Int) +model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName +{-# INLINE model200ResponseNameL #-} + +-- | 'model200ResponseClass' Lens +model200ResponseClassL :: Lens_' Model200Response (Maybe Text) +model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass +{-# INLINE model200ResponseClassL #-} + --- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet ([Text]) -petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls -{-# INLINE petPhotoUrlsL #-} - --- | 'petTags' Lens -petTagsL :: Lens_' Pet (Maybe [Tag]) -petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags -{-# INLINE petTagsL #-} + +-- * ModelList + +-- | 'modelList123list' Lens +modelList123listL :: Lens_' ModelList (Maybe Text) +modelList123listL f ModelList{..} = (\modelList123list -> ModelList { modelList123list, ..} ) <$> f modelList123list +{-# INLINE modelList123listL #-} + + --- | 'petStatus' Lens -petStatusL :: Lens_' Pet (Maybe E'Status2) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus -{-# INLINE petStatusL #-} - - +-- * ModelReturn + +-- | 'modelReturnReturn' Lens +modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +{-# INLINE modelReturnReturnL #-} --- * ReadOnlyFirst + --- | 'readOnlyFirstBar' Lens -readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar -{-# INLINE readOnlyFirstBarL #-} - --- | 'readOnlyFirstBaz' Lens -readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz -{-# INLINE readOnlyFirstBazL #-} - - +-- * Name + +-- | 'nameName' Lens +nameNameL :: Lens_' Name (Int) +nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName +{-# INLINE nameNameL #-} + +-- | 'nameSnakeCase' Lens +nameSnakeCaseL :: Lens_' Name (Maybe Int) +nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase +{-# INLINE nameSnakeCaseL #-} --- * SpecialModelName - --- | 'specialModelNameSpecialPropertyName' Lens -specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) -specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName -{-# INLINE specialModelNameSpecialPropertyNameL #-} - - - --- * Tag +-- | 'nameProperty' Lens +namePropertyL :: Lens_' Name (Maybe Text) +namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty +{-# INLINE namePropertyL #-} + +-- | 'name123number' Lens +name123numberL :: Lens_' Name (Maybe Int) +name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f name123number +{-# INLINE name123numberL #-} + --- | 'tagId' Lens -tagIdL :: Lens_' Tag (Maybe Integer) -tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId -{-# INLINE tagIdL #-} - --- | 'tagName' Lens -tagNameL :: Lens_' Tag (Maybe Text) -tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName -{-# INLINE tagNameL #-} + +-- * NumberOnly + +-- | 'numberOnlyJustNumber' Lens +numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +{-# INLINE numberOnlyJustNumberL #-} + + - +-- * Order --- * TypeHolderDefault - --- | 'typeHolderDefaultStringItem' Lens -typeHolderDefaultStringItemL :: Lens_' TypeHolderDefault (Text) -typeHolderDefaultStringItemL f TypeHolderDefault{..} = (\typeHolderDefaultStringItem -> TypeHolderDefault { typeHolderDefaultStringItem, ..} ) <$> f typeHolderDefaultStringItem -{-# INLINE typeHolderDefaultStringItemL #-} - --- | 'typeHolderDefaultNumberItem' Lens -typeHolderDefaultNumberItemL :: Lens_' TypeHolderDefault (Double) -typeHolderDefaultNumberItemL f TypeHolderDefault{..} = (\typeHolderDefaultNumberItem -> TypeHolderDefault { typeHolderDefaultNumberItem, ..} ) <$> f typeHolderDefaultNumberItem -{-# INLINE typeHolderDefaultNumberItemL #-} - --- | 'typeHolderDefaultIntegerItem' Lens -typeHolderDefaultIntegerItemL :: Lens_' TypeHolderDefault (Int) -typeHolderDefaultIntegerItemL f TypeHolderDefault{..} = (\typeHolderDefaultIntegerItem -> TypeHolderDefault { typeHolderDefaultIntegerItem, ..} ) <$> f typeHolderDefaultIntegerItem -{-# INLINE typeHolderDefaultIntegerItemL #-} - --- | 'typeHolderDefaultBoolItem' Lens -typeHolderDefaultBoolItemL :: Lens_' TypeHolderDefault (Bool) -typeHolderDefaultBoolItemL f TypeHolderDefault{..} = (\typeHolderDefaultBoolItem -> TypeHolderDefault { typeHolderDefaultBoolItem, ..} ) <$> f typeHolderDefaultBoolItem -{-# INLINE typeHolderDefaultBoolItemL #-} - --- | 'typeHolderDefaultArrayItem' Lens -typeHolderDefaultArrayItemL :: Lens_' TypeHolderDefault ([Int]) -typeHolderDefaultArrayItemL f TypeHolderDefault{..} = (\typeHolderDefaultArrayItem -> TypeHolderDefault { typeHolderDefaultArrayItem, ..} ) <$> f typeHolderDefaultArrayItem -{-# INLINE typeHolderDefaultArrayItemL #-} - - - --- * TypeHolderExample +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId +{-# INLINE orderIdL #-} + +-- | 'orderPetId' Lens +orderPetIdL :: Lens_' Order (Maybe Integer) +orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId +{-# INLINE orderPetIdL #-} + +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +{-# INLINE orderQuantityL #-} + +-- | 'orderShipDate' Lens +orderShipDateL :: Lens_' Order (Maybe DateTime) +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +{-# INLINE orderShipDateL #-} + +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe E'Status) +orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus +{-# INLINE orderStatusL #-} + +-- | 'orderComplete' Lens +orderCompleteL :: Lens_' Order (Maybe Bool) +orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete +{-# INLINE orderCompleteL #-} + --- | 'typeHolderExampleStringItem' Lens -typeHolderExampleStringItemL :: Lens_' TypeHolderExample (Text) -typeHolderExampleStringItemL f TypeHolderExample{..} = (\typeHolderExampleStringItem -> TypeHolderExample { typeHolderExampleStringItem, ..} ) <$> f typeHolderExampleStringItem -{-# INLINE typeHolderExampleStringItemL #-} - --- | 'typeHolderExampleNumberItem' Lens -typeHolderExampleNumberItemL :: Lens_' TypeHolderExample (Double) -typeHolderExampleNumberItemL f TypeHolderExample{..} = (\typeHolderExampleNumberItem -> TypeHolderExample { typeHolderExampleNumberItem, ..} ) <$> f typeHolderExampleNumberItem -{-# INLINE typeHolderExampleNumberItemL #-} - --- | 'typeHolderExampleIntegerItem' Lens -typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample (Int) -typeHolderExampleIntegerItemL f TypeHolderExample{..} = (\typeHolderExampleIntegerItem -> TypeHolderExample { typeHolderExampleIntegerItem, ..} ) <$> f typeHolderExampleIntegerItem -{-# INLINE typeHolderExampleIntegerItemL #-} - --- | 'typeHolderExampleBoolItem' Lens -typeHolderExampleBoolItemL :: Lens_' TypeHolderExample (Bool) -typeHolderExampleBoolItemL f TypeHolderExample{..} = (\typeHolderExampleBoolItem -> TypeHolderExample { typeHolderExampleBoolItem, ..} ) <$> f typeHolderExampleBoolItem -{-# INLINE typeHolderExampleBoolItemL #-} + +-- * OuterComposite + +-- | 'outerCompositeMyNumber' Lens +outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe Double) +outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber +{-# INLINE outerCompositeMyNumberL #-} + +-- | 'outerCompositeMyString' Lens +outerCompositeMyStringL :: Lens_' OuterComposite (Maybe Text) +outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString +{-# INLINE outerCompositeMyStringL #-} + +-- | 'outerCompositeMyBoolean' Lens +outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe Bool) +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +{-# INLINE outerCompositeMyBooleanL #-} + + --- | 'typeHolderExampleArrayItem' Lens -typeHolderExampleArrayItemL :: Lens_' TypeHolderExample ([Int]) -typeHolderExampleArrayItemL f TypeHolderExample{..} = (\typeHolderExampleArrayItem -> TypeHolderExample { typeHolderExampleArrayItem, ..} ) <$> f typeHolderExampleArrayItem -{-# INLINE typeHolderExampleArrayItemL #-} - +-- * OuterEnum + + + +-- * Pet - --- * User - --- | 'userId' Lens -userIdL :: Lens_' User (Maybe Integer) -userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId -{-# INLINE userIdL #-} - --- | 'userUsername' Lens -userUsernameL :: Lens_' User (Maybe Text) -userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername -{-# INLINE userUsernameL #-} - --- | 'userFirstName' Lens -userFirstNameL :: Lens_' User (Maybe Text) -userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName -{-# INLINE userFirstNameL #-} - --- | 'userLastName' Lens -userLastNameL :: Lens_' User (Maybe Text) -userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName -{-# INLINE userLastNameL #-} - --- | 'userEmail' Lens -userEmailL :: Lens_' User (Maybe Text) -userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail -{-# INLINE userEmailL #-} - --- | 'userPassword' Lens -userPasswordL :: Lens_' User (Maybe Text) -userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword -{-# INLINE userPasswordL #-} - --- | 'userPhone' Lens -userPhoneL :: Lens_' User (Maybe Text) -userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone -{-# INLINE userPhoneL #-} - --- | 'userUserStatus' Lens -userUserStatusL :: Lens_' User (Maybe Int) -userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus -{-# INLINE userUserStatusL #-} - +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId +{-# INLINE petIdL #-} + +-- | 'petCategory' Lens +petCategoryL :: Lens_' Pet (Maybe Category) +petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory +{-# INLINE petCategoryL #-} + +-- | 'petName' Lens +petNameL :: Lens_' Pet (Text) +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +{-# INLINE petNameL #-} + +-- | 'petPhotoUrls' Lens +petPhotoUrlsL :: Lens_' Pet ([Text]) +petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls +{-# INLINE petPhotoUrlsL #-} + +-- | 'petTags' Lens +petTagsL :: Lens_' Pet (Maybe [Tag]) +petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags +{-# INLINE petTagsL #-} + +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe E'Status2) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} + + + +-- * ReadOnlyFirst + +-- | 'readOnlyFirstBar' Lens +readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) +readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar +{-# INLINE readOnlyFirstBarL #-} + +-- | 'readOnlyFirstBaz' Lens +readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text) +readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz +{-# INLINE readOnlyFirstBazL #-} --- * XmlItem - --- | 'xmlItemAttributeString' Lens -xmlItemAttributeStringL :: Lens_' XmlItem (Maybe Text) -xmlItemAttributeStringL f XmlItem{..} = (\xmlItemAttributeString -> XmlItem { xmlItemAttributeString, ..} ) <$> f xmlItemAttributeString -{-# INLINE xmlItemAttributeStringL #-} - --- | 'xmlItemAttributeNumber' Lens -xmlItemAttributeNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemAttributeNumberL f XmlItem{..} = (\xmlItemAttributeNumber -> XmlItem { xmlItemAttributeNumber, ..} ) <$> f xmlItemAttributeNumber -{-# INLINE xmlItemAttributeNumberL #-} + +-- * SpecialModelName + +-- | 'specialModelNameSpecialPropertyName' Lens +specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +{-# INLINE specialModelNameSpecialPropertyNameL #-} + + + +-- * Tag --- | 'xmlItemAttributeInteger' Lens -xmlItemAttributeIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemAttributeIntegerL f XmlItem{..} = (\xmlItemAttributeInteger -> XmlItem { xmlItemAttributeInteger, ..} ) <$> f xmlItemAttributeInteger -{-# INLINE xmlItemAttributeIntegerL #-} +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId +{-# INLINE tagIdL #-} --- | 'xmlItemAttributeBoolean' Lens -xmlItemAttributeBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemAttributeBooleanL f XmlItem{..} = (\xmlItemAttributeBoolean -> XmlItem { xmlItemAttributeBoolean, ..} ) <$> f xmlItemAttributeBoolean -{-# INLINE xmlItemAttributeBooleanL #-} +-- | 'tagName' Lens +tagNameL :: Lens_' Tag (Maybe Text) +tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +{-# INLINE tagNameL #-} --- | 'xmlItemWrappedArray' Lens -xmlItemWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemWrappedArrayL f XmlItem{..} = (\xmlItemWrappedArray -> XmlItem { xmlItemWrappedArray, ..} ) <$> f xmlItemWrappedArray -{-# INLINE xmlItemWrappedArrayL #-} - --- | 'xmlItemNameString' Lens -xmlItemNameStringL :: Lens_' XmlItem (Maybe Text) -xmlItemNameStringL f XmlItem{..} = (\xmlItemNameString -> XmlItem { xmlItemNameString, ..} ) <$> f xmlItemNameString -{-# INLINE xmlItemNameStringL #-} - --- | 'xmlItemNameNumber' Lens -xmlItemNameNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemNameNumberL f XmlItem{..} = (\xmlItemNameNumber -> XmlItem { xmlItemNameNumber, ..} ) <$> f xmlItemNameNumber -{-# INLINE xmlItemNameNumberL #-} - --- | 'xmlItemNameInteger' Lens -xmlItemNameIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemNameIntegerL f XmlItem{..} = (\xmlItemNameInteger -> XmlItem { xmlItemNameInteger, ..} ) <$> f xmlItemNameInteger -{-# INLINE xmlItemNameIntegerL #-} - --- | 'xmlItemNameBoolean' Lens -xmlItemNameBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemNameBooleanL f XmlItem{..} = (\xmlItemNameBoolean -> XmlItem { xmlItemNameBoolean, ..} ) <$> f xmlItemNameBoolean -{-# INLINE xmlItemNameBooleanL #-} - --- | 'xmlItemNameArray' Lens -xmlItemNameArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNameArrayL f XmlItem{..} = (\xmlItemNameArray -> XmlItem { xmlItemNameArray, ..} ) <$> f xmlItemNameArray -{-# INLINE xmlItemNameArrayL #-} + + +-- * TypeHolderDefault + +-- | 'typeHolderDefaultStringItem' Lens +typeHolderDefaultStringItemL :: Lens_' TypeHolderDefault (Text) +typeHolderDefaultStringItemL f TypeHolderDefault{..} = (\typeHolderDefaultStringItem -> TypeHolderDefault { typeHolderDefaultStringItem, ..} ) <$> f typeHolderDefaultStringItem +{-# INLINE typeHolderDefaultStringItemL #-} + +-- | 'typeHolderDefaultNumberItem' Lens +typeHolderDefaultNumberItemL :: Lens_' TypeHolderDefault (Double) +typeHolderDefaultNumberItemL f TypeHolderDefault{..} = (\typeHolderDefaultNumberItem -> TypeHolderDefault { typeHolderDefaultNumberItem, ..} ) <$> f typeHolderDefaultNumberItem +{-# INLINE typeHolderDefaultNumberItemL #-} + +-- | 'typeHolderDefaultIntegerItem' Lens +typeHolderDefaultIntegerItemL :: Lens_' TypeHolderDefault (Int) +typeHolderDefaultIntegerItemL f TypeHolderDefault{..} = (\typeHolderDefaultIntegerItem -> TypeHolderDefault { typeHolderDefaultIntegerItem, ..} ) <$> f typeHolderDefaultIntegerItem +{-# INLINE typeHolderDefaultIntegerItemL #-} + +-- | 'typeHolderDefaultBoolItem' Lens +typeHolderDefaultBoolItemL :: Lens_' TypeHolderDefault (Bool) +typeHolderDefaultBoolItemL f TypeHolderDefault{..} = (\typeHolderDefaultBoolItem -> TypeHolderDefault { typeHolderDefaultBoolItem, ..} ) <$> f typeHolderDefaultBoolItem +{-# INLINE typeHolderDefaultBoolItemL #-} + +-- | 'typeHolderDefaultArrayItem' Lens +typeHolderDefaultArrayItemL :: Lens_' TypeHolderDefault ([Int]) +typeHolderDefaultArrayItemL f TypeHolderDefault{..} = (\typeHolderDefaultArrayItem -> TypeHolderDefault { typeHolderDefaultArrayItem, ..} ) <$> f typeHolderDefaultArrayItem +{-# INLINE typeHolderDefaultArrayItemL #-} + --- | 'xmlItemNameWrappedArray' Lens -xmlItemNameWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNameWrappedArrayL f XmlItem{..} = (\xmlItemNameWrappedArray -> XmlItem { xmlItemNameWrappedArray, ..} ) <$> f xmlItemNameWrappedArray -{-# INLINE xmlItemNameWrappedArrayL #-} - --- | 'xmlItemPrefixString' Lens -xmlItemPrefixStringL :: Lens_' XmlItem (Maybe Text) -xmlItemPrefixStringL f XmlItem{..} = (\xmlItemPrefixString -> XmlItem { xmlItemPrefixString, ..} ) <$> f xmlItemPrefixString -{-# INLINE xmlItemPrefixStringL #-} - --- | 'xmlItemPrefixNumber' Lens -xmlItemPrefixNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemPrefixNumberL f XmlItem{..} = (\xmlItemPrefixNumber -> XmlItem { xmlItemPrefixNumber, ..} ) <$> f xmlItemPrefixNumber -{-# INLINE xmlItemPrefixNumberL #-} - --- | 'xmlItemPrefixInteger' Lens -xmlItemPrefixIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemPrefixIntegerL f XmlItem{..} = (\xmlItemPrefixInteger -> XmlItem { xmlItemPrefixInteger, ..} ) <$> f xmlItemPrefixInteger -{-# INLINE xmlItemPrefixIntegerL #-} - --- | 'xmlItemPrefixBoolean' Lens -xmlItemPrefixBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemPrefixBooleanL f XmlItem{..} = (\xmlItemPrefixBoolean -> XmlItem { xmlItemPrefixBoolean, ..} ) <$> f xmlItemPrefixBoolean -{-# INLINE xmlItemPrefixBooleanL #-} - --- | 'xmlItemPrefixArray' Lens -xmlItemPrefixArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixArrayL f XmlItem{..} = (\xmlItemPrefixArray -> XmlItem { xmlItemPrefixArray, ..} ) <$> f xmlItemPrefixArray -{-# INLINE xmlItemPrefixArrayL #-} + +-- * TypeHolderExample + +-- | 'typeHolderExampleStringItem' Lens +typeHolderExampleStringItemL :: Lens_' TypeHolderExample (Text) +typeHolderExampleStringItemL f TypeHolderExample{..} = (\typeHolderExampleStringItem -> TypeHolderExample { typeHolderExampleStringItem, ..} ) <$> f typeHolderExampleStringItem +{-# INLINE typeHolderExampleStringItemL #-} + +-- | 'typeHolderExampleNumberItem' Lens +typeHolderExampleNumberItemL :: Lens_' TypeHolderExample (Double) +typeHolderExampleNumberItemL f TypeHolderExample{..} = (\typeHolderExampleNumberItem -> TypeHolderExample { typeHolderExampleNumberItem, ..} ) <$> f typeHolderExampleNumberItem +{-# INLINE typeHolderExampleNumberItemL #-} + +-- | 'typeHolderExampleIntegerItem' Lens +typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample (Int) +typeHolderExampleIntegerItemL f TypeHolderExample{..} = (\typeHolderExampleIntegerItem -> TypeHolderExample { typeHolderExampleIntegerItem, ..} ) <$> f typeHolderExampleIntegerItem +{-# INLINE typeHolderExampleIntegerItemL #-} + +-- | 'typeHolderExampleBoolItem' Lens +typeHolderExampleBoolItemL :: Lens_' TypeHolderExample (Bool) +typeHolderExampleBoolItemL f TypeHolderExample{..} = (\typeHolderExampleBoolItem -> TypeHolderExample { typeHolderExampleBoolItem, ..} ) <$> f typeHolderExampleBoolItem +{-# INLINE typeHolderExampleBoolItemL #-} + +-- | 'typeHolderExampleArrayItem' Lens +typeHolderExampleArrayItemL :: Lens_' TypeHolderExample ([Int]) +typeHolderExampleArrayItemL f TypeHolderExample{..} = (\typeHolderExampleArrayItem -> TypeHolderExample { typeHolderExampleArrayItem, ..} ) <$> f typeHolderExampleArrayItem +{-# INLINE typeHolderExampleArrayItemL #-} + + --- | 'xmlItemPrefixWrappedArray' Lens -xmlItemPrefixWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixWrappedArrayL f XmlItem{..} = (\xmlItemPrefixWrappedArray -> XmlItem { xmlItemPrefixWrappedArray, ..} ) <$> f xmlItemPrefixWrappedArray -{-# INLINE xmlItemPrefixWrappedArrayL #-} - --- | 'xmlItemNamespaceString' Lens -xmlItemNamespaceStringL :: Lens_' XmlItem (Maybe Text) -xmlItemNamespaceStringL f XmlItem{..} = (\xmlItemNamespaceString -> XmlItem { xmlItemNamespaceString, ..} ) <$> f xmlItemNamespaceString -{-# INLINE xmlItemNamespaceStringL #-} - --- | 'xmlItemNamespaceNumber' Lens -xmlItemNamespaceNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemNamespaceNumberL f XmlItem{..} = (\xmlItemNamespaceNumber -> XmlItem { xmlItemNamespaceNumber, ..} ) <$> f xmlItemNamespaceNumber -{-# INLINE xmlItemNamespaceNumberL #-} - --- | 'xmlItemNamespaceInteger' Lens -xmlItemNamespaceIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemNamespaceIntegerL f XmlItem{..} = (\xmlItemNamespaceInteger -> XmlItem { xmlItemNamespaceInteger, ..} ) <$> f xmlItemNamespaceInteger -{-# INLINE xmlItemNamespaceIntegerL #-} - --- | 'xmlItemNamespaceBoolean' Lens -xmlItemNamespaceBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemNamespaceBooleanL f XmlItem{..} = (\xmlItemNamespaceBoolean -> XmlItem { xmlItemNamespaceBoolean, ..} ) <$> f xmlItemNamespaceBoolean -{-# INLINE xmlItemNamespaceBooleanL #-} - --- | 'xmlItemNamespaceArray' Lens -xmlItemNamespaceArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNamespaceArrayL f XmlItem{..} = (\xmlItemNamespaceArray -> XmlItem { xmlItemNamespaceArray, ..} ) <$> f xmlItemNamespaceArray -{-# INLINE xmlItemNamespaceArrayL #-} - --- | 'xmlItemNamespaceWrappedArray' Lens -xmlItemNamespaceWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNamespaceWrappedArrayL f XmlItem{..} = (\xmlItemNamespaceWrappedArray -> XmlItem { xmlItemNamespaceWrappedArray, ..} ) <$> f xmlItemNamespaceWrappedArray -{-# INLINE xmlItemNamespaceWrappedArrayL #-} - --- | 'xmlItemPrefixNsString' Lens -xmlItemPrefixNsStringL :: Lens_' XmlItem (Maybe Text) -xmlItemPrefixNsStringL f XmlItem{..} = (\xmlItemPrefixNsString -> XmlItem { xmlItemPrefixNsString, ..} ) <$> f xmlItemPrefixNsString -{-# INLINE xmlItemPrefixNsStringL #-} - --- | 'xmlItemPrefixNsNumber' Lens -xmlItemPrefixNsNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemPrefixNsNumberL f XmlItem{..} = (\xmlItemPrefixNsNumber -> XmlItem { xmlItemPrefixNsNumber, ..} ) <$> f xmlItemPrefixNsNumber -{-# INLINE xmlItemPrefixNsNumberL #-} - --- | 'xmlItemPrefixNsInteger' Lens -xmlItemPrefixNsIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemPrefixNsIntegerL f XmlItem{..} = (\xmlItemPrefixNsInteger -> XmlItem { xmlItemPrefixNsInteger, ..} ) <$> f xmlItemPrefixNsInteger -{-# INLINE xmlItemPrefixNsIntegerL #-} - --- | 'xmlItemPrefixNsBoolean' Lens -xmlItemPrefixNsBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemPrefixNsBooleanL f XmlItem{..} = (\xmlItemPrefixNsBoolean -> XmlItem { xmlItemPrefixNsBoolean, ..} ) <$> f xmlItemPrefixNsBoolean -{-# INLINE xmlItemPrefixNsBooleanL #-} - --- | 'xmlItemPrefixNsArray' Lens -xmlItemPrefixNsArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixNsArrayL f XmlItem{..} = (\xmlItemPrefixNsArray -> XmlItem { xmlItemPrefixNsArray, ..} ) <$> f xmlItemPrefixNsArray -{-# INLINE xmlItemPrefixNsArrayL #-} - --- | 'xmlItemPrefixNsWrappedArray' Lens -xmlItemPrefixNsWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixNsWrappedArrayL f XmlItem{..} = (\xmlItemPrefixNsWrappedArray -> XmlItem { xmlItemPrefixNsWrappedArray, ..} ) <$> f xmlItemPrefixNsWrappedArray -{-# INLINE xmlItemPrefixNsWrappedArrayL #-} - +-- * User + +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId +{-# INLINE userIdL #-} + +-- | 'userUsername' Lens +userUsernameL :: Lens_' User (Maybe Text) +userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername +{-# INLINE userUsernameL #-} + +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName +{-# INLINE userFirstNameL #-} + +-- | 'userLastName' Lens +userLastNameL :: Lens_' User (Maybe Text) +userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName +{-# INLINE userLastNameL #-} + +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail +{-# INLINE userEmailL #-} + +-- | 'userPassword' Lens +userPasswordL :: Lens_' User (Maybe Text) +userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword +{-# INLINE userPasswordL #-} + +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone +{-# INLINE userPhoneL #-} + +-- | 'userUserStatus' Lens +userUserStatusL :: Lens_' User (Maybe Int) +userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus +{-# INLINE userUserStatusL #-} + + + +-- * XmlItem + +-- | 'xmlItemAttributeString' Lens +xmlItemAttributeStringL :: Lens_' XmlItem (Maybe Text) +xmlItemAttributeStringL f XmlItem{..} = (\xmlItemAttributeString -> XmlItem { xmlItemAttributeString, ..} ) <$> f xmlItemAttributeString +{-# INLINE xmlItemAttributeStringL #-} + +-- | 'xmlItemAttributeNumber' Lens +xmlItemAttributeNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemAttributeNumberL f XmlItem{..} = (\xmlItemAttributeNumber -> XmlItem { xmlItemAttributeNumber, ..} ) <$> f xmlItemAttributeNumber +{-# INLINE xmlItemAttributeNumberL #-} + +-- | 'xmlItemAttributeInteger' Lens +xmlItemAttributeIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemAttributeIntegerL f XmlItem{..} = (\xmlItemAttributeInteger -> XmlItem { xmlItemAttributeInteger, ..} ) <$> f xmlItemAttributeInteger +{-# INLINE xmlItemAttributeIntegerL #-} + +-- | 'xmlItemAttributeBoolean' Lens +xmlItemAttributeBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemAttributeBooleanL f XmlItem{..} = (\xmlItemAttributeBoolean -> XmlItem { xmlItemAttributeBoolean, ..} ) <$> f xmlItemAttributeBoolean +{-# INLINE xmlItemAttributeBooleanL #-} - \ No newline at end of file +-- | 'xmlItemWrappedArray' Lens +xmlItemWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemWrappedArrayL f XmlItem{..} = (\xmlItemWrappedArray -> XmlItem { xmlItemWrappedArray, ..} ) <$> f xmlItemWrappedArray +{-# INLINE xmlItemWrappedArrayL #-} + +-- | 'xmlItemNameString' Lens +xmlItemNameStringL :: Lens_' XmlItem (Maybe Text) +xmlItemNameStringL f XmlItem{..} = (\xmlItemNameString -> XmlItem { xmlItemNameString, ..} ) <$> f xmlItemNameString +{-# INLINE xmlItemNameStringL #-} + +-- | 'xmlItemNameNumber' Lens +xmlItemNameNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemNameNumberL f XmlItem{..} = (\xmlItemNameNumber -> XmlItem { xmlItemNameNumber, ..} ) <$> f xmlItemNameNumber +{-# INLINE xmlItemNameNumberL #-} + +-- | 'xmlItemNameInteger' Lens +xmlItemNameIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemNameIntegerL f XmlItem{..} = (\xmlItemNameInteger -> XmlItem { xmlItemNameInteger, ..} ) <$> f xmlItemNameInteger +{-# INLINE xmlItemNameIntegerL #-} + +-- | 'xmlItemNameBoolean' Lens +xmlItemNameBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemNameBooleanL f XmlItem{..} = (\xmlItemNameBoolean -> XmlItem { xmlItemNameBoolean, ..} ) <$> f xmlItemNameBoolean +{-# INLINE xmlItemNameBooleanL #-} + +-- | 'xmlItemNameArray' Lens +xmlItemNameArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNameArrayL f XmlItem{..} = (\xmlItemNameArray -> XmlItem { xmlItemNameArray, ..} ) <$> f xmlItemNameArray +{-# INLINE xmlItemNameArrayL #-} + +-- | 'xmlItemNameWrappedArray' Lens +xmlItemNameWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNameWrappedArrayL f XmlItem{..} = (\xmlItemNameWrappedArray -> XmlItem { xmlItemNameWrappedArray, ..} ) <$> f xmlItemNameWrappedArray +{-# INLINE xmlItemNameWrappedArrayL #-} + +-- | 'xmlItemPrefixString' Lens +xmlItemPrefixStringL :: Lens_' XmlItem (Maybe Text) +xmlItemPrefixStringL f XmlItem{..} = (\xmlItemPrefixString -> XmlItem { xmlItemPrefixString, ..} ) <$> f xmlItemPrefixString +{-# INLINE xmlItemPrefixStringL #-} + +-- | 'xmlItemPrefixNumber' Lens +xmlItemPrefixNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemPrefixNumberL f XmlItem{..} = (\xmlItemPrefixNumber -> XmlItem { xmlItemPrefixNumber, ..} ) <$> f xmlItemPrefixNumber +{-# INLINE xmlItemPrefixNumberL #-} + +-- | 'xmlItemPrefixInteger' Lens +xmlItemPrefixIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemPrefixIntegerL f XmlItem{..} = (\xmlItemPrefixInteger -> XmlItem { xmlItemPrefixInteger, ..} ) <$> f xmlItemPrefixInteger +{-# INLINE xmlItemPrefixIntegerL #-} + +-- | 'xmlItemPrefixBoolean' Lens +xmlItemPrefixBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemPrefixBooleanL f XmlItem{..} = (\xmlItemPrefixBoolean -> XmlItem { xmlItemPrefixBoolean, ..} ) <$> f xmlItemPrefixBoolean +{-# INLINE xmlItemPrefixBooleanL #-} + +-- | 'xmlItemPrefixArray' Lens +xmlItemPrefixArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixArrayL f XmlItem{..} = (\xmlItemPrefixArray -> XmlItem { xmlItemPrefixArray, ..} ) <$> f xmlItemPrefixArray +{-# INLINE xmlItemPrefixArrayL #-} + +-- | 'xmlItemPrefixWrappedArray' Lens +xmlItemPrefixWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixWrappedArrayL f XmlItem{..} = (\xmlItemPrefixWrappedArray -> XmlItem { xmlItemPrefixWrappedArray, ..} ) <$> f xmlItemPrefixWrappedArray +{-# INLINE xmlItemPrefixWrappedArrayL #-} + +-- | 'xmlItemNamespaceString' Lens +xmlItemNamespaceStringL :: Lens_' XmlItem (Maybe Text) +xmlItemNamespaceStringL f XmlItem{..} = (\xmlItemNamespaceString -> XmlItem { xmlItemNamespaceString, ..} ) <$> f xmlItemNamespaceString +{-# INLINE xmlItemNamespaceStringL #-} + +-- | 'xmlItemNamespaceNumber' Lens +xmlItemNamespaceNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemNamespaceNumberL f XmlItem{..} = (\xmlItemNamespaceNumber -> XmlItem { xmlItemNamespaceNumber, ..} ) <$> f xmlItemNamespaceNumber +{-# INLINE xmlItemNamespaceNumberL #-} + +-- | 'xmlItemNamespaceInteger' Lens +xmlItemNamespaceIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemNamespaceIntegerL f XmlItem{..} = (\xmlItemNamespaceInteger -> XmlItem { xmlItemNamespaceInteger, ..} ) <$> f xmlItemNamespaceInteger +{-# INLINE xmlItemNamespaceIntegerL #-} + +-- | 'xmlItemNamespaceBoolean' Lens +xmlItemNamespaceBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemNamespaceBooleanL f XmlItem{..} = (\xmlItemNamespaceBoolean -> XmlItem { xmlItemNamespaceBoolean, ..} ) <$> f xmlItemNamespaceBoolean +{-# INLINE xmlItemNamespaceBooleanL #-} + +-- | 'xmlItemNamespaceArray' Lens +xmlItemNamespaceArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNamespaceArrayL f XmlItem{..} = (\xmlItemNamespaceArray -> XmlItem { xmlItemNamespaceArray, ..} ) <$> f xmlItemNamespaceArray +{-# INLINE xmlItemNamespaceArrayL #-} + +-- | 'xmlItemNamespaceWrappedArray' Lens +xmlItemNamespaceWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemNamespaceWrappedArrayL f XmlItem{..} = (\xmlItemNamespaceWrappedArray -> XmlItem { xmlItemNamespaceWrappedArray, ..} ) <$> f xmlItemNamespaceWrappedArray +{-# INLINE xmlItemNamespaceWrappedArrayL #-} + +-- | 'xmlItemPrefixNsString' Lens +xmlItemPrefixNsStringL :: Lens_' XmlItem (Maybe Text) +xmlItemPrefixNsStringL f XmlItem{..} = (\xmlItemPrefixNsString -> XmlItem { xmlItemPrefixNsString, ..} ) <$> f xmlItemPrefixNsString +{-# INLINE xmlItemPrefixNsStringL #-} + +-- | 'xmlItemPrefixNsNumber' Lens +xmlItemPrefixNsNumberL :: Lens_' XmlItem (Maybe Double) +xmlItemPrefixNsNumberL f XmlItem{..} = (\xmlItemPrefixNsNumber -> XmlItem { xmlItemPrefixNsNumber, ..} ) <$> f xmlItemPrefixNsNumber +{-# INLINE xmlItemPrefixNsNumberL #-} + +-- | 'xmlItemPrefixNsInteger' Lens +xmlItemPrefixNsIntegerL :: Lens_' XmlItem (Maybe Int) +xmlItemPrefixNsIntegerL f XmlItem{..} = (\xmlItemPrefixNsInteger -> XmlItem { xmlItemPrefixNsInteger, ..} ) <$> f xmlItemPrefixNsInteger +{-# INLINE xmlItemPrefixNsIntegerL #-} + +-- | 'xmlItemPrefixNsBoolean' Lens +xmlItemPrefixNsBooleanL :: Lens_' XmlItem (Maybe Bool) +xmlItemPrefixNsBooleanL f XmlItem{..} = (\xmlItemPrefixNsBoolean -> XmlItem { xmlItemPrefixNsBoolean, ..} ) <$> f xmlItemPrefixNsBoolean +{-# INLINE xmlItemPrefixNsBooleanL #-} + +-- | 'xmlItemPrefixNsArray' Lens +xmlItemPrefixNsArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixNsArrayL f XmlItem{..} = (\xmlItemPrefixNsArray -> XmlItem { xmlItemPrefixNsArray, ..} ) <$> f xmlItemPrefixNsArray +{-# INLINE xmlItemPrefixNsArrayL #-} + +-- | 'xmlItemPrefixNsWrappedArray' Lens +xmlItemPrefixNsWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) +xmlItemPrefixNsWrappedArrayL f XmlItem{..} = (\xmlItemPrefixNsWrappedArray -> XmlItem { xmlItemPrefixNsWrappedArray, ..} ) <$> f xmlItemPrefixNsWrappedArray +{-# INLINE xmlItemPrefixNsWrappedArrayL #-} + + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html index e342b7f8d55a..1e69c03e4889 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -29,12 +29,12 @@ version = Version [0,1,0,0] [] bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath -bindir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/lts-13.9/8.6.3/bin" -libdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/lts-13.9/8.6.3/lib/x86_64-linux-ghc-8.6.3/openapi-petstore-0.1.0.0-6yC7i1RbMwkHQhaNDv53Sh" -dynlibdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/lts-13.9/8.6.3/lib/x86_64-linux-ghc-8.6.3" -datadir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/lts-13.9/8.6.3/share/x86_64-linux-ghc-8.6.3/openapi-petstore-0.1.0.0" -libexecdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/lts-13.9/8.6.3/libexec/x86_64-linux-ghc-8.6.3/openapi-petstore-0.1.0.0" -sysconfdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/lts-13.9/8.6.3/etc" +bindir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/0e55b588a6e0f73d5281a0e79ff90ed1a2f68be7e90de0d4415c83e0146eb843/8.6.5/bin" +libdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/0e55b588a6e0f73d5281a0e79ff90ed1a2f68be7e90de0d4415c83e0146eb843/8.6.5/lib/x86_64-linux-ghc-8.6.5/openapi-petstore-0.1.0.0-AOImxrOgHINA0WeGn39wyO" +dynlibdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/0e55b588a6e0f73d5281a0e79ff90ed1a2f68be7e90de0d4415c83e0146eb843/8.6.5/lib/x86_64-linux-ghc-8.6.5" +datadir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/0e55b588a6e0f73d5281a0e79ff90ed1a2f68be7e90de0d4415c83e0146eb843/8.6.5/share/x86_64-linux-ghc-8.6.5/openapi-petstore-0.1.0.0" +libexecdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/0e55b588a6e0f73d5281a0e79ff90ed1a2f68be7e90de0d4415c83e0146eb843/8.6.5/libexec/x86_64-linux-ghc-8.6.5/openapi-petstore-0.1.0.0" +sysconfdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-tinfo6/0e55b588a6e0f73d5281a0e79ff90ed1a2f68be7e90de0d4415c83e0146eb843/8.6.5/etc" getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath getBinDir = catchIO (getEnv "openapi_petstore_bindir") (\_ -> return bindir) @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "openapi_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal b/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal index c16f97234cc7..ea592492f6da 100644 --- a/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal +++ b/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal @@ -32,9 +32,9 @@ executable openapi-petstore-app , case-insensitive , containers >=0.5.0.0 && <0.8 , http-api-data >=0.3.4 && <0.5 - , http-client >=0.5 && <0.6 + , http-client >=0.5 && <0.7 , http-client-tls - , http-media >=0.4 && <0.8 + , http-media >=0.4 && <0.9 , http-types >=0.8 && <0.13 , microlens >=0.4.3 && <0.5 , mtl >=2.2.1 diff --git a/samples/client/petstore/haskell-http-client/example-app/stack.yaml b/samples/client/petstore/haskell-http-client/example-app/stack.yaml index c6bf88f6cf70..31ae84e5f2b0 100644 --- a/samples/client/petstore/haskell-http-client/example-app/stack.yaml +++ b/samples/client/petstore/haskell-http-client/example-app/stack.yaml @@ -1,6 +1,2 @@ -resolver: lts-13.9 -extra-deps: [ katip-0.8.0.0 ] -packages: - - location: '.' - - location: '..' - extra-dep: true +resolver: lts-14.3 +extra-deps: [ '..', katip-0.8.3.0 ] diff --git a/samples/client/petstore/haskell-http-client/example-app/stack.yaml.lock b/samples/client/petstore/haskell-http-client/example-app/stack.yaml.lock new file mode 100644 index 000000000000..d4ba7488f112 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/example-app/stack.yaml.lock @@ -0,0 +1,19 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: katip-0.8.3.0@sha256:8a67c0aec3ba1f0eabcfae443cb909e4cf9405e29bac99ccf1420f1f1bbda9c4,4097 + pantry-tree: + size: 1140 + sha256: cad8c67256ec85819309d77bdcbc15b67885940ef76f2b850c8be20c2efd0149 + original: + hackage: katip-0.8.3.0 +snapshots: +- completed: + size: 523878 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/3.yaml + sha256: 470c46c27746a48c7c50f829efc0cf00112787a7804ee4ac7a27754658f6d92c + original: lts-14.3 diff --git a/samples/client/petstore/haskell-http-client/git_push.sh b/samples/client/petstore/haskell-http-client/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/haskell-http-client/git_push.sh +++ b/samples/client/petstore/haskell-http-client/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs index 9e8a52b25223..04497a97bdcd 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs @@ -504,3 +504,28 @@ instance Consumes TestJsonFormData MimeFormUrlEncoded instance Produces TestJsonFormData MimeNoContent + +-- *** testQueryParameterCollectionFormat + +-- | @PUT \/fake\/test-query-paramters@ +-- +-- To test the collection format in query parameters +-- +testQueryParameterCollectionFormat + :: Pipe -- ^ "pipe" + -> Ioutil -- ^ "ioutil" + -> Http -- ^ "http" + -> Url -- ^ "url" + -> Context -- ^ "context" + -> OpenAPIPetstoreRequest TestQueryParameterCollectionFormat MimeNoContent NoContent MimeNoContent +testQueryParameterCollectionFormat (Pipe pipe) (Ioutil ioutil) (Http http) (Url url) (Context context) = + _mkRequest "PUT" ["/fake/test-query-paramters"] + `setQuery` toQueryColl CommaSeparated ("pipe", Just pipe) + `setQuery` toQueryColl CommaSeparated ("ioutil", Just ioutil) + `setQuery` toQueryColl SpaceSeparated ("http", Just http) + `setQuery` toQueryColl CommaSeparated ("url", Just url) + `setQuery` toQueryColl MultiParamArray ("context", Just context) + +data TestQueryParameterCollectionFormat +instance Produces TestQueryParameterCollectionFormat MimeNoContent + diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 8c0e231b0edd..46623d752c28 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -93,6 +93,9 @@ newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) -- ** Callback newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) +-- ** Context +newtype Context = Context { unContext :: [Text] } deriving (P.Eq, P.Show) + -- ** EnumFormString newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) @@ -120,6 +123,9 @@ newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: -- ** File2 newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show) +-- ** Http +newtype Http = Http { unHttp :: [Text] } deriving (P.Eq, P.Show) + -- ** Int32 newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) @@ -129,6 +135,9 @@ newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) -- ** Int64Group newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show) +-- ** Ioutil +newtype Ioutil = Ioutil { unIoutil :: [Text] } deriving (P.Eq, P.Show) + -- ** Name2 newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) @@ -180,6 +189,9 @@ newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDeli -- ** PetId newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) +-- ** Pipe +newtype Pipe = Pipe { unPipe :: [Text] } deriving (P.Eq, P.Show) + -- ** Query newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) @@ -207,6 +219,9 @@ newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Sho -- ** Tags newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) +-- ** Url +newtype Url = Url { unUrl :: [Text] } deriving (P.Eq, P.Show) + -- ** Username newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) @@ -1672,6 +1687,7 @@ mkTypeHolderDefault typeHolderDefaultStringItem typeHolderDefaultNumberItem type data TypeHolderExample = TypeHolderExample { typeHolderExampleStringItem :: !(Text) -- ^ /Required/ "string_item" , typeHolderExampleNumberItem :: !(Double) -- ^ /Required/ "number_item" + , typeHolderExampleFloatItem :: !(Float) -- ^ /Required/ "float_item" , typeHolderExampleIntegerItem :: !(Int) -- ^ /Required/ "integer_item" , typeHolderExampleBoolItem :: !(Bool) -- ^ /Required/ "bool_item" , typeHolderExampleArrayItem :: !([Int]) -- ^ /Required/ "array_item" @@ -1683,6 +1699,7 @@ instance A.FromJSON TypeHolderExample where TypeHolderExample <$> (o .: "string_item") <*> (o .: "number_item") + <*> (o .: "float_item") <*> (o .: "integer_item") <*> (o .: "bool_item") <*> (o .: "array_item") @@ -1693,6 +1710,7 @@ instance A.ToJSON TypeHolderExample where _omitNulls [ "string_item" .= typeHolderExampleStringItem , "number_item" .= typeHolderExampleNumberItem + , "float_item" .= typeHolderExampleFloatItem , "integer_item" .= typeHolderExampleIntegerItem , "bool_item" .= typeHolderExampleBoolItem , "array_item" .= typeHolderExampleArrayItem @@ -1703,14 +1721,16 @@ instance A.ToJSON TypeHolderExample where mkTypeHolderExample :: Text -- ^ 'typeHolderExampleStringItem' -> Double -- ^ 'typeHolderExampleNumberItem' + -> Float -- ^ 'typeHolderExampleFloatItem' -> Int -- ^ 'typeHolderExampleIntegerItem' -> Bool -- ^ 'typeHolderExampleBoolItem' -> [Int] -- ^ 'typeHolderExampleArrayItem' -> TypeHolderExample -mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = +mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleFloatItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = TypeHolderExample { typeHolderExampleStringItem , typeHolderExampleNumberItem + , typeHolderExampleFloatItem , typeHolderExampleIntegerItem , typeHolderExampleBoolItem , typeHolderExampleArrayItem diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 353dacb6e6f0..5908865df53a 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -780,6 +780,11 @@ typeHolderExampleNumberItemL :: Lens_' TypeHolderExample (Double) typeHolderExampleNumberItemL f TypeHolderExample{..} = (\typeHolderExampleNumberItem -> TypeHolderExample { typeHolderExampleNumberItem, ..} ) <$> f typeHolderExampleNumberItem {-# INLINE typeHolderExampleNumberItemL #-} +-- | 'typeHolderExampleFloatItem' Lens +typeHolderExampleFloatItemL :: Lens_' TypeHolderExample (Float) +typeHolderExampleFloatItemL f TypeHolderExample{..} = (\typeHolderExampleFloatItem -> TypeHolderExample { typeHolderExampleFloatItem, ..} ) <$> f typeHolderExampleFloatItem +{-# INLINE typeHolderExampleFloatItemL #-} + -- | 'typeHolderExampleIntegerItem' Lens typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample (Int) typeHolderExampleIntegerItemL f TypeHolderExample{..} = (\typeHolderExampleIntegerItem -> TypeHolderExample { typeHolderExampleIntegerItem, ..} ) <$> f typeHolderExampleIntegerItem diff --git a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal index dc5fae3a2894..aa87a86aa739 100644 --- a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal @@ -44,9 +44,9 @@ library , deepseq >= 1.4 && <1.6 , exceptions >= 0.4 , http-api-data >= 0.3.4 && <0.5 - , http-client >=0.5 && <0.6 + , http-client >=0.5 && <0.7 , http-client-tls - , http-media >= 0.4 && < 0.8 + , http-media >= 0.4 && < 0.9 , http-types >=0.8 && <0.13 , iso8601-time >=0.1.3 && <0.2.0 , microlens >= 0.4.3 && <0.5 diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 5a020a1d0ab8..37a46abf4feb 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -791,6 +791,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1100,6 +1101,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1815,6 +1869,10 @@ components: number_item: example: 1.234 type: number + float_item: + example: 1.234 + format: float + type: number integer_item: example: -2 type: integer @@ -1833,6 +1891,7 @@ components: required: - array_item - bool_item + - float_item - integer_item - number_item - string_item diff --git a/samples/client/petstore/haskell-http-client/stack.yaml b/samples/client/petstore/haskell-http-client/stack.yaml index f1bb05947c87..ef3c63b223ee 100644 --- a/samples/client/petstore/haskell-http-client/stack.yaml +++ b/samples/client/petstore/haskell-http-client/stack.yaml @@ -1,8 +1,8 @@ -resolver: lts-13.9 +resolver: lts-14.3 build: haddock-arguments: haddock-args: - "--odir=./docs" -extra-deps: [ katip-0.8.0.0 ] +extra-deps: [ katip-0.8.3.0 ] packages: - '.' diff --git a/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal b/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal index 439625767d88..d606f362919b 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal +++ b/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal @@ -1,10 +1,10 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.1. +-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack -- --- hash: 72a832d3a374148c4fc68b1129bd71c249795ff82f0df3036b7963e26ae5750e +-- hash: 1de2469e3014acffdfb079309edd15dc88ec7f5acce21f1062b61a1b002418fd name: openapi-petstore-tests-integration version: 0.1.0.0 @@ -39,9 +39,9 @@ test-suite tests , exceptions >=0.4 , hspec >=1.8 , http-api-data >=0.3.4 && <0.5 - , http-client >=0.5 && <0.6 + , http-client >=0.5 && <0.7 , http-client-tls - , http-media >=0.4 && <0.8 + , http-media >=0.4 && <0.9 , http-types >=0.8 && <0.13 , iso8601-time , microlens >=0.4.3 && <0.5 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml index 90f9842fe534..bd2962fb5894 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -22,10 +22,10 @@ dependencies: - aeson >=1.0 && <2.0 - bytestring >=0.10.0 && <0.11 - http-types >=0.8 && <0.13 -- http-client >=0.5 && <0.6 +- http-client >=0.5 && <0.7 - http-client-tls - http-api-data >= 0.3.4 && <0.5 -- http-media >= 0.4 && < 0.8 +- http-media >= 0.4 && < 0.9 - text >=0.11 && <1.3 - time >=1.5 && <1.9 - vector >=0.10.9 && <0.13 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml b/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml index c6bf88f6cf70..31ae84e5f2b0 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml @@ -1,6 +1,2 @@ -resolver: lts-13.9 -extra-deps: [ katip-0.8.0.0 ] -packages: - - location: '.' - - location: '..' - extra-dep: true +resolver: lts-14.3 +extra-deps: [ '..', katip-0.8.3.0 ] diff --git a/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml.lock b/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml.lock new file mode 100644 index 000000000000..d4ba7488f112 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/tests-integration/stack.yaml.lock @@ -0,0 +1,19 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: katip-0.8.3.0@sha256:8a67c0aec3ba1f0eabcfae443cb909e4cf9405e29bac99ccf1420f1f1bbda9c4,4097 + pantry-tree: + size: 1140 + sha256: cad8c67256ec85819309d77bdcbc15b67885940ef76f2b850c8be20c2efd0149 + original: + hackage: katip-0.8.3.0 +snapshots: +- completed: + size: 523878 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/3.yaml + sha256: 470c46c27746a48c7c50f829efc0cf00112787a7804ee4ac7a27754658f6d92c + original: lts-14.3 diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 8926e3e4ed71..c4b9395d4b6e 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -511,6 +511,7 @@ genTypeHolderExample n = TypeHolderExample <$> arbitrary -- typeHolderExampleStringItem :: Text <*> arbitrary -- typeHolderExampleNumberItem :: Double + <*> arbitrary -- typeHolderExampleFloatItem :: Float <*> arbitrary -- typeHolderExampleIntegerItem :: Int <*> arbitrary -- typeHolderExampleBoolItem :: Bool <*> arbitrary -- typeHolderExampleArrayItem :: [Int] diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.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/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index f05dc55cd7ae..94d0029825aa 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -96,8 +96,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" threepane_version = "2.6.4" feign_version = "9.7.0" feign_form_version = "2.1.0" @@ -115,6 +116,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threepane_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index f7b902d09008..ea30abac90a5 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -14,9 +14,9 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-jackson" % "9.7.0" % "compile", "io.github.openfeign" % "feign-slf4j" % "9.7.0" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.datatype" % "jackson-datatype-joda" % "2.9.9" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", diff --git a/samples/client/petstore/java/feign/git_push.sh b/samples/client/petstore/java/feign/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/feign/git_push.sh +++ b/samples/client/petstore/java/feign/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index a55c44d65469..7004da878434 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -236,6 +236,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.github.joschi.jackson @@ -276,8 +281,9 @@ 1.5.21 9.7.0 2.1.0 - 2.9.9 - 2.9.9 + 2.9.10 + 0.2.0 + 2.9.10 2.6.4 4.12 1.0.0 diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 95f82ac14c7d..26dcada607e6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import feign.Feign; @@ -143,6 +144,8 @@ private ObjectMapper createObjectMapper() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); objectMapper.registerModule(module); + JsonNullableModule jnm = new JsonNullableModule(); + objectMapper.registerModule(jnm); return objectMapper; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/EncodingUtils.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/EncodingUtils.java index 1b061a1972f1..c5a76a97857a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/EncodingUtils.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/EncodingUtils.java @@ -77,7 +77,7 @@ public static String encode(Object parameter) { return null; } try { - return URLEncoder.encode(parameter.toString(), "UTF-8"); + return URLEncoder.encode(parameter.toString(), "UTF-8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { // Should never happen, UTF-8 is always supported throw new RuntimeException(e); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index d77963bac457..601e2527eedb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -353,4 +353,70 @@ public TestGroupParametersQueryParams int64Group(final Long value) { "Accept: application/json", }) void testJsonFormData(@Param("param") String param, @Param("param2") String param2); + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @Headers({ + "Accept: application/json", + }) + void testQueryParameterCollectionFormat(@Param("pipe") List pipe, @Param("ioutil") List ioutil, @Param("http") List http, @Param("url") List url, @Param("context") List context); + + /** + * + * To test the collection format in query parameters + * Note, this is equivalent to the other testQueryParameterCollectionFormat method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link TestQueryParameterCollectionFormatQueryParams} class that allows for + * building up this map in a fluent style. + * @param queryParams Map of query parameters as name-value pairs + *

    The following elements may be specified in the query map:

    + *
      + *
    • pipe - (required)
    • + *
    • ioutil - (required)
    • + *
    • http - (required)
    • + *
    • url - (required)
    • + *
    • context - (required)
    • + *
    + */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @Headers({ + "Accept: application/json", + }) + void testQueryParameterCollectionFormat(@QueryMap(encoded=true) Map queryParams); + + /** + * A convenience class for generating query parameters for the + * testQueryParameterCollectionFormat method in a fluent style. + */ + public static class TestQueryParameterCollectionFormatQueryParams extends HashMap { + public TestQueryParameterCollectionFormatQueryParams pipe(final List value) { + put("pipe", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams ioutil(final List value) { + put("ioutil", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams http(final List value) { + put("http", EncodingUtils.encodeCollection(value, "space")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams url(final List value) { + put("url", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams context(final List value) { + put("context", EncodingUtils.encodeCollection(value, "multi")); + return this; + } + } } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index d43f2333bc9b..80919c260367 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index ba49e716c4ed..b5b50650e8d0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index b0d37534e890..edaf45e84eba 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index edde668a2ad3..5b261fff9ab6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 75ddd671fa89..1a43b27355f7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 79a56d1ac73e..0e96a6db8cc8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java index 9e83466d321a..a1ab7c497a0e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign10x/.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/client/petstore/java/feign10x/build.gradle b/samples/client/petstore/java/feign10x/build.gradle index 39c274690548..7aaee78ff4bf 100644 --- a/samples/client/petstore/java/feign10x/build.gradle +++ b/samples/client/petstore/java/feign10x/build.gradle @@ -96,8 +96,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" threepane_version = "2.6.4" feign_version = "10.2.3" feign_form_version = "2.1.0" @@ -115,6 +116,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threepane_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/feign10x/build.sbt b/samples/client/petstore/java/feign10x/build.sbt index d7f942bda871..dd361e262c90 100644 --- a/samples/client/petstore/java/feign10x/build.sbt +++ b/samples/client/petstore/java/feign10x/build.sbt @@ -14,9 +14,9 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-jackson" % "10.2.3" % "compile", "io.github.openfeign" % "feign-slf4j" % "10.2.3" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.datatype" % "jackson-datatype-joda" % "2.9.9" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", diff --git a/samples/client/petstore/java/feign10x/git_push.sh b/samples/client/petstore/java/feign10x/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/feign10x/git_push.sh +++ b/samples/client/petstore/java/feign10x/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/feign10x/pom.xml b/samples/client/petstore/java/feign10x/pom.xml index 0bf621890ffc..caccc26d76cd 100644 --- a/samples/client/petstore/java/feign10x/pom.xml +++ b/samples/client/petstore/java/feign10x/pom.xml @@ -236,6 +236,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.github.joschi.jackson @@ -276,8 +281,9 @@ 1.5.21 10.2.3 2.1.0 - 2.9.9 - 2.9.9 + 2.9.10 + 0.2.0 + 2.9.10 2.6.4 4.12 1.0.0 diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/ApiClient.java index 95f82ac14c7d..26dcada607e6 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/ApiClient.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import feign.Feign; @@ -143,6 +144,8 @@ private ObjectMapper createObjectMapper() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); objectMapper.registerModule(module); + JsonNullableModule jnm = new JsonNullableModule(); + objectMapper.registerModule(jnm); return objectMapper; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/EncodingUtils.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/EncodingUtils.java index 1b061a1972f1..c5a76a97857a 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/EncodingUtils.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/EncodingUtils.java @@ -77,7 +77,7 @@ public static String encode(Object parameter) { return null; } try { - return URLEncoder.encode(parameter.toString(), "UTF-8"); + return URLEncoder.encode(parameter.toString(), "UTF-8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { // Should never happen, UTF-8 is always supported throw new RuntimeException(e); diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index d77963bac457..601e2527eedb 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -353,4 +353,70 @@ public TestGroupParametersQueryParams int64Group(final Long value) { "Accept: application/json", }) void testJsonFormData(@Param("param") String param, @Param("param2") String param2); + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @Headers({ + "Accept: application/json", + }) + void testQueryParameterCollectionFormat(@Param("pipe") List pipe, @Param("ioutil") List ioutil, @Param("http") List http, @Param("url") List url, @Param("context") List context); + + /** + * + * To test the collection format in query parameters + * Note, this is equivalent to the other testQueryParameterCollectionFormat method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link TestQueryParameterCollectionFormatQueryParams} class that allows for + * building up this map in a fluent style. + * @param queryParams Map of query parameters as name-value pairs + *

    The following elements may be specified in the query map:

    + *
      + *
    • pipe - (required)
    • + *
    • ioutil - (required)
    • + *
    • http - (required)
    • + *
    • url - (required)
    • + *
    • context - (required)
    • + *
    + */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @Headers({ + "Accept: application/json", + }) + void testQueryParameterCollectionFormat(@QueryMap(encoded=true) Map queryParams); + + /** + * A convenience class for generating query parameters for the + * testQueryParameterCollectionFormat method in a fluent style. + */ + public static class TestQueryParameterCollectionFormatQueryParams extends HashMap { + public TestQueryParameterCollectionFormatQueryParams pipe(final List value) { + put("pipe", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams ioutil(final List value) { + put("ioutil", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams http(final List value) { + put("http", EncodingUtils.encodeCollection(value, "space")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams url(final List value) { + put("url", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams context(final List value) { + put("context", EncodingUtils.encodeCollection(value, "multi")); + return this; + } + } } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java index d43f2333bc9b..80919c260367 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java index ba49e716c4ed..b5b50650e8d0 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java index b0d37534e890..edaf45e84eba 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java index edde668a2ad3..5b261fff9ab6 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 75ddd671fa89..1a43b27355f7 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 79a56d1ac73e..0e96a6db8cc8 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java index 9e83466d321a..a1ab7c497a0e 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index ea26f6875256..208d7a57dc08 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -96,8 +96,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" google_api_client_version = "1.23.0" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" @@ -114,6 +115,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index b4d7458b4b03..1450018366b0 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/google-api-client/docs/FakeApi.md b/samples/client/petstore/java/google-api-client/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/google-api-client/docs/FakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/google-api-client/docs/TypeHolderExample.md b/samples/client/petstore/java/google-api-client/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/google-api-client/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/google-api-client/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/google-api-client/docs/UserApi.md b/samples/client/petstore/java/google-api-client/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/google-api-client/docs/UserApi.md +++ b/samples/client/petstore/java/google-api-client/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/google-api-client/git_push.sh b/samples/client/petstore/java/google-api-client/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/google-api-client/git_push.sh +++ b/samples/client/petstore/java/google-api-client/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index 314ca642337b..6b29ee3a8a10 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -233,6 +233,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.github.joschi.jackson @@ -251,10 +256,11 @@ UTF-8 1.5.22 - 1.23.0 + 1.30.2 2.25.1 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 2.6.4 1.0.0 4.12 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java index 62ead482d512..9dd0fcc8c6cb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ApiClient.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import org.threeten.bp.*; import com.google.api.client.googleapis.util.Utils; @@ -35,6 +36,8 @@ private static ObjectMapper createDefaultObjectMapper() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); objectMapper.registerModule(module); + JsonNullableModule jnm = new JsonNullableModule(); + objectMapper.registerModule(jnm); return objectMapper; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index b17ee1bb9548..f5ef6820a7f3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.Client; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -76,8 +77,8 @@ public HttpResponse call123testSpecialTagsForHttpResponse(Client body) throws IO } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); @@ -90,8 +91,8 @@ public HttpResponse call123testSpecialTagsForHttpResponse(java.io.InputStream bo } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -124,8 +125,8 @@ public HttpResponse call123testSpecialTagsForHttpResponse(Client body, Map enumHeaderStr } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -958,8 +959,8 @@ public HttpResponse testEnumParametersForHttpResponse(Map params } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -1050,8 +1051,8 @@ public HttpResponse testGroupParametersForHttpResponse(Integer requiredStringGro } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -1092,8 +1093,8 @@ public HttpResponse testGroupParametersForHttpResponse(Integer requiredStringGro } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -1128,8 +1129,8 @@ public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Map200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws IOException { + testQueryParameterCollectionFormatForHttpResponse(pipe, ioutil, http, url, context); + } + + /** + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Map params) throws IOException { + testQueryParameterCollectionFormatForHttpResponse(pipe, ioutil, http, url, context, params); + } + + public HttpResponse testQueryParameterCollectionFormatForHttpResponse(List pipe, List ioutil, List http, List url, List context) throws IOException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new IllegalArgumentException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new IllegalArgumentException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'http' is set + if (http == null) { + throw new IllegalArgumentException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'url' is set + if (url == null) { + throw new IllegalArgumentException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'context' is set + if (context == null) { + throw new IllegalArgumentException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/test-query-paramters"); + if (pipe != null) { + String key = "pipe"; + Object value = pipe; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (ioutil != null) { + String key = "ioutil"; + Object value = ioutil; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (http != null) { + String key = "http"; + Object value = http; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (url != null) { + String key = "url"; + Object value = url; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (context != null) { + String key = "context"; + Object value = context; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); + + HttpContent content = new EmptyContent(); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + public HttpResponse testQueryParameterCollectionFormatForHttpResponse(List pipe, List ioutil, List http, List url, List context, Map params) throws IOException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new IllegalArgumentException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new IllegalArgumentException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'http' is set + if (http == null) { + throw new IllegalArgumentException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'url' is set + if (url == null) { + throw new IllegalArgumentException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'context' is set + if (context == null) { + throw new IllegalArgumentException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/test-query-paramters"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'pipe' to the map of query params + allParams.put("pipe", pipe); + // Add the required query param 'ioutil' to the map of query params + allParams.put("ioutil", ioutil); + // Add the required query param 'http' to the map of query params + allParams.put("http", http); + // Add the required query param 'url' to the map of query params + allParams.put("url", url); + // Add the required query param 'context' to the map of query params + allParams.put("context", context); + + for (Map.Entry entry: allParams.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); + + HttpContent content = new EmptyContent(); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 71e359d24875..6ff01d102b4c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.Client; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -76,8 +77,8 @@ public HttpResponse testClassnameForHttpResponse(Client body) throws IOException } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); @@ -90,8 +91,8 @@ public HttpResponse testClassnameForHttpResponse(java.io.InputStream body, Strin } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -124,8 +125,8 @@ public HttpResponse testClassnameForHttpResponse(Client body, Map params) } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -162,8 +163,8 @@ public HttpResponse deletePetForHttpResponse(Long petId, String apiKey) throws I uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -197,8 +198,8 @@ public HttpResponse deletePetForHttpResponse(Long petId, Map par } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -254,8 +255,8 @@ public HttpResponse findPetsByStatusForHttpResponse(List status) throws } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -288,8 +289,8 @@ public HttpResponse findPetsByStatusForHttpResponse(List status, Map tags) throws IOEx } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -379,8 +380,8 @@ public HttpResponse findPetsByTagsForHttpResponse(List tags, Map pa } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -507,8 +508,8 @@ public HttpResponse updatePetForHttpResponse(Pet body) throws IOException { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -521,8 +522,8 @@ public HttpResponse updatePetForHttpResponse(java.io.InputStream body, String me } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -555,8 +556,8 @@ public HttpResponse updatePetForHttpResponse(Pet body, Map param } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -596,10 +597,10 @@ public HttpResponse updatePetWithFormForHttpResponse(Long petId, String name, St uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -631,10 +632,10 @@ public HttpResponse updatePetWithFormForHttpResponse(Long petId, Map pa } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -764,10 +765,10 @@ public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File r uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/{petId}/uploadImageWithRequiredFile"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -802,10 +803,10 @@ public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File r } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java index 403039f991ae..78fc7b3960d2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.Order; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -75,8 +76,8 @@ public HttpResponse deleteOrderForHttpResponse(String orderId) throws IOExceptio uriVariables.put("order_id", orderId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -110,8 +111,8 @@ public HttpResponse deleteOrderForHttpResponse(String orderId, Map params) thro } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -229,8 +230,8 @@ public HttpResponse getOrderByIdForHttpResponse(Long orderId) throws IOException uriVariables.put("order_id", orderId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -264,8 +265,8 @@ public HttpResponse getOrderByIdForHttpResponse(Long orderId, Map pa } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java index 21b7c004ed2b..ee22d3ae0969 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -70,8 +71,8 @@ public HttpResponse createUserForHttpResponse(User body) throws IOException { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -84,8 +85,8 @@ public HttpResponse createUserForHttpResponse(java.io.InputStream body, String m } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -118,8 +119,8 @@ public HttpResponse createUserForHttpResponse(User body, Map par } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -154,8 +155,8 @@ public HttpResponse createUsersWithArrayInputForHttpResponse(List body) th } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -168,8 +169,8 @@ public HttpResponse createUsersWithArrayInputForHttpResponse(java.io.InputStream } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -202,8 +203,8 @@ public HttpResponse createUsersWithArrayInputForHttpResponse(List body, Ma } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -238,8 +239,8 @@ public HttpResponse createUsersWithListInputForHttpResponse(List body) thr } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -252,8 +253,8 @@ public HttpResponse createUsersWithListInputForHttpResponse(java.io.InputStream } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -286,8 +287,8 @@ public HttpResponse createUsersWithListInputForHttpResponse(List body, Map } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -329,8 +330,8 @@ public HttpResponse deleteUserForHttpResponse(String username) throws IOExceptio uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -364,8 +365,8 @@ public HttpResponse deleteUserForHttpResponse(String username, Map params) throws } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -665,8 +666,8 @@ public HttpResponse updateUserForHttpResponse(String username, User body) throws uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -685,8 +686,8 @@ public HttpResponse updateUserForHttpResponse(String username, java.io.InputStre uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -725,8 +726,8 @@ public HttpResponse updateUserForHttpResponse(String username, User body, Map { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index 0d6bc154e463..dabd18a06a1d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0961f776fb02..c9bb8bcebec9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 3617c5c16b2d..32a4d8bb6e4a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index 151939d60542..75b1edce8d9a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.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/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index 111b509b380f..d372e0398872 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -114,6 +114,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.6.4" jackson_databind_version = "2.6.4" + jackson-databind-nullable-version = "0.2.0" jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.12" @@ -128,6 +129,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version" compile "com.brsanthu:migbase64:2.2" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey1/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey1/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/jersey1/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/jersey1/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/jersey1/docs/UserApi.md b/samples/client/petstore/java/jersey1/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/jersey1/docs/UserApi.md +++ b/samples/client/petstore/java/jersey1/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey1/git_push.sh b/samples/client/petstore/java/jersey1/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/jersey1/git_push.sh +++ b/samples/client/petstore/java/jersey1/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index dfef1d7bd4d9..c984d269bd79 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -684,4 +684,74 @@ public void testJsonFormData(String param, String param2) throws ApiException { apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index 0d6bc154e463..dabd18a06a1d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0961f776fb02..c9bb8bcebec9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 3617c5c16b2d..32a4d8bb6e4a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index 151939d60542..75b1edce8d9a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.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/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt index aa99cf804283..3e8fa6564731 100644 --- a/samples/client/petstore/java/jersey2-java6/build.sbt +++ b/samples/client/petstore/java/jersey2-java6/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.6", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.6", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "com.brsanthu" % "migbase64" % "2.2", "org.apache.commons" % "commons-lang3" % "3.6", diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2-java6/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey2-java6/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/jersey2-java6/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey2-java6/git_push.sh b/samples/client/petstore/java/jersey2-java6/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/jersey2-java6/git_push.sh +++ b/samples/client/petstore/java/jersey2-java6/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index 7f29de9bf660..a23046886f2c 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -249,6 +249,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.github.joschi.jackson @@ -285,8 +290,9 @@ 2.6 2.5 3.6 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 2.6.4 1.0.0 4.12 diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java index 2c65b8884f04..3ac9d1688ce8 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java @@ -688,7 +688,7 @@ public ApiResponse invokeAPI(String path, String method, List query } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -700,11 +700,15 @@ public ApiResponse invokeAPI(String path, String method, List query } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); } else { throw new ApiException(500, "unknown method type " + method); } @@ -756,8 +760,13 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/JSON.java index 2df3c2868c40..4e267b9a3611 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/JSON.java @@ -3,6 +3,7 @@ import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import java.text.DateFormat; @@ -27,6 +28,8 @@ public JSON() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper.registerModule(module); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); } /** diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 70b4c329d610..267830f13ed4 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -584,7 +584,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat */ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -705,7 +705,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -784,7 +784,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo */ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -928,7 +928,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -970,4 +970,99 @@ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java index 22a80aefe3a1..9e59435a5f17 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java @@ -134,7 +134,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -201,7 +201,7 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -270,7 +270,7 @@ public List findPetsByTags(List tags) throws ApiException { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -337,7 +337,7 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -472,7 +472,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -543,7 +543,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -614,7 +614,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java index 84c59b439eb0..5093a9d41165 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java @@ -66,7 +66,7 @@ public void deleteOrder(String orderId) throws ApiException { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -127,7 +127,7 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -188,7 +188,7 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java index 1573bbde1ca6..78b37fbceab9 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java @@ -252,7 +252,7 @@ public void deleteUser(String username) throws ApiException { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -319,7 +319,7 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -386,7 +386,7 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -453,7 +453,7 @@ public void logoutUser() throws ApiException { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0bfee143bd0e..70bde457ccb7 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -42,10 +48,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index f51b8f38d8c0..0faa25399f2e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 53ebe2970a86..0ea3a88551b4 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -42,10 +48,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b7c42f156b01..ddec5a7634b7 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,57 +24,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -92,15 +98,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -119,15 +132,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -146,15 +166,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -173,15 +200,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -200,15 +234,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -227,15 +268,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -254,15 +302,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -281,15 +336,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -300,15 +362,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -319,15 +388,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -338,10 +414,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index ccac73ddc492..64836ad8d0e4 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -42,10 +48,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 4dd532b0cbed..191fee93963f 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index d195a95e58a1..54eec28ca31d 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -42,10 +48,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 018ad67c0c08..0b8195860f17 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -42,10 +48,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java index 71f7e8f78b76..32f9232bd15e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -21,10 +22,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -34,14 +40,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +57,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +83,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 176df67c4081..d026e797b75c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -51,10 +57,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 22639d70847c..2f7d61a00c98 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -51,10 +57,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java index 27812394026a..32d960da78c2 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,25 +23,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -59,15 +65,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -86,15 +99,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -113,10 +133,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java index 6aa53f91bd31..947f2eb78220 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java @@ -14,42 +14,48 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -60,15 +66,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -79,15 +92,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -98,15 +118,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -117,15 +144,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -136,15 +170,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -155,10 +196,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java index 2569c2291e70..9643935a3df5 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -42,10 +48,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java index 756bf15de7a7..4e8b2a07a1f6 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -14,22 +14,28 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -40,10 +46,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java index f03394e6706f..36430e915a98 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java @@ -14,26 +14,32 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -44,15 +50,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -62,10 +75,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java index 44306019f165..6108498d4b0e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java @@ -14,23 +14,29 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -41,10 +47,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java index 7458e3c2e091..126f9fa5e95a 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java @@ -14,22 +14,28 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -40,10 +46,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java index 4c285963ab58..259243417ef7 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,17 +22,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -42,10 +48,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java index 455ed741f88e..a83c0c8f5345 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -14,22 +14,28 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -40,10 +46,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java index 28a1f53dfe60..6c7e9898226e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,10 +22,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -63,7 +69,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -102,10 +107,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -116,15 +122,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -143,10 +156,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumClass.java index 662427bb0ade..4cc4cfa91066 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumClass.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java index 5269ae8dc175..6a0fd85bb683 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java @@ -14,16 +14,25 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -64,7 +73,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -105,7 +113,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -144,7 +151,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -183,14 +189,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -201,15 +207,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -219,15 +232,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -238,15 +258,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -257,15 +284,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -276,10 +310,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 3d72f2566066..cefda17732ff 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,21 +22,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -46,15 +52,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -73,10 +86,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java index d8de4d3ee260..cfc1aeade6fe 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,65 +25,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -95,15 +101,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -116,15 +129,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -135,15 +155,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -155,15 +182,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -176,15 +210,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -197,15 +238,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -216,15 +264,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -234,15 +289,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -253,15 +315,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -271,15 +340,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -290,15 +366,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -309,15 +392,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -327,10 +417,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index fb81f00f744e..4ef535d0ced6 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -14,46 +14,62 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java index 3571c0ba8fb9..74d3dd14f27b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,15 +23,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -68,18 +75,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -98,15 +104,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -125,15 +138,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -152,15 +172,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -179,10 +206,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0d0720454308..4af92dc91dfa 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,25 +26,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -54,15 +60,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -73,15 +86,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -100,10 +120,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java index 7164ae194c21..2416c1eb2793 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java @@ -14,27 +14,33 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -45,15 +51,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -64,10 +77,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 470ca0c20170..bfe12319eb9c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -14,30 +14,36 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -48,15 +54,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -67,15 +80,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -86,10 +106,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java index fe8184f4b8e1..cc33376f8457 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -14,23 +14,29 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -41,10 +47,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java index 1eeadbba2730..497338ea91be 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java @@ -14,35 +14,41 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -52,25 +58,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -81,25 +100,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java index c6540f9f4dbc..75539a6ba18d 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -14,23 +14,29 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -41,10 +47,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java index d8976f540b18..fee7b19880fb 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java @@ -14,32 +14,38 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -80,14 +86,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -98,15 +104,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -117,15 +130,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -136,15 +156,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -155,15 +182,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -174,15 +208,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -193,10 +234,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java index 34bb1dd5d259..4f695eb6e108 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -14,31 +14,37 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -49,15 +55,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -68,15 +81,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -87,10 +107,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterEnum.java index 46c0003b4e61..6618d1f9c5f5 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java index bd7afd3acdfb..5974b1c014df 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,31 +24,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -87,10 +92,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -101,15 +107,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -120,15 +133,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -138,15 +158,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -161,15 +188,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -188,15 +222,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -207,10 +248,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 24177a70be5e..e3cff629be48 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -14,36 +14,48 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -54,10 +66,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java index 30d01ba0b894..296938f26320 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -14,22 +14,28 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -40,10 +46,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java index 2fe5dce35856..40249f403144 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java @@ -14,26 +14,32 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -44,15 +50,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 4160934f7350..9e406ce6c7d4 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,33 +23,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -58,15 +64,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -76,15 +89,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -94,15 +114,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -112,15 +139,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -135,10 +169,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 4b517c141b0b..e4973ba1f49b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,33 +23,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -58,15 +68,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -76,15 +93,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -94,15 +143,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -112,15 +168,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -135,10 +198,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -155,6 +223,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return ObjectUtils.equals(this.stringItem, typeHolderExample.stringItem) && ObjectUtils.equals(this.numberItem, typeHolderExample.numberItem) && + ObjectUtils.equals(this.floatItem, typeHolderExample.floatItem) && ObjectUtils.equals(this.integerItem, typeHolderExample.integerItem) && ObjectUtils.equals(this.boolItem, typeHolderExample.boolItem) && ObjectUtils.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -162,7 +231,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(stringItem, numberItem, integerItem, boolItem, arrayItem); + return ObjectUtils.hashCodeMulti(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -172,6 +241,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java index e97f002a2ff7..e11486610c30 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java @@ -14,50 +14,56 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -68,15 +74,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -87,15 +100,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -106,15 +126,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -125,15 +152,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -144,15 +178,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -163,15 +204,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -182,15 +230,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -201,10 +256,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java index 3b81f60d6d29..3a1fd9f0b467 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java @@ -14,6 +14,7 @@ package org.openapitools.client.model; import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,129 +23,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -155,15 +161,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -174,15 +187,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -193,15 +213,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -212,15 +239,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -239,15 +273,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -258,15 +299,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -277,15 +325,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -296,15 +351,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -315,15 +377,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -342,15 +411,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -369,15 +445,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -388,15 +471,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -407,15 +497,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -426,15 +523,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -445,15 +549,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -472,15 +583,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -499,15 +617,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -518,15 +643,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -537,15 +669,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -556,15 +695,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -575,15 +721,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -602,15 +755,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -629,15 +789,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -648,15 +815,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -667,15 +841,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -686,15 +867,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -705,15 +893,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean isPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -732,15 +927,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -759,10 +961,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.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/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index b3382a0779ef..44798b9125fb 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -95,8 +95,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" jersey_version = "2.27" junit_version = "4.12" } @@ -110,6 +111,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 84bd1b57eb5e..8fcc9ffc1d2b 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.datatype" % "jackson-datatype-jsr310" % "2.9.9" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2-java8/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey2-java8/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/jersey2-java8/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey2-java8/git_push.sh b/samples/client/petstore/java/jersey2-java8/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/jersey2-java8/git_push.sh +++ b/samples/client/petstore/java/jersey2-java8/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 5d62f179fe71..b81f6e210a3c 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -254,6 +254,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.fasterxml.jackson.datatype @@ -272,8 +277,9 @@ UTF-8 1.5.22 2.27 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 1.0.0 4.12 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 4a03feb3b8fa..a06ca6f8d63d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -688,7 +688,7 @@ public ApiResponse invokeAPI(String path, String method, List query } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -700,11 +700,15 @@ public ApiResponse invokeAPI(String path, String method, List query } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); } else { throw new ApiException(500, "unknown method type " + method); } @@ -756,11 +760,16 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index f897160320c2..e2d3f17b20a0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.text.DateFormat; @@ -22,6 +23,8 @@ public JSON() { mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); mapper.registerModule(new JavaTimeModule()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); } /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index ec5b45d4ec38..8324e74ea04b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -584,7 +584,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat */ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -705,7 +705,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -784,7 +784,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo */ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -928,7 +928,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -970,4 +970,99 @@ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java index 22a80aefe3a1..9e59435a5f17 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java @@ -134,7 +134,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -201,7 +201,7 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -270,7 +270,7 @@ public List findPetsByTags(List tags) throws ApiException { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -337,7 +337,7 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -472,7 +472,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -543,7 +543,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -614,7 +614,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java index 84c59b439eb0..5093a9d41165 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java @@ -66,7 +66,7 @@ public void deleteOrder(String orderId) throws ApiException { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -127,7 +127,7 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -188,7 +188,7 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index 1573bbde1ca6..78b37fbceab9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -252,7 +252,7 @@ public void deleteUser(String username) throws ApiException { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -319,7 +319,7 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -386,7 +386,7 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -453,7 +453,7 @@ public void logoutUser() throws ApiException { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dc8ea1e9ec3b..0b590e6f976e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index ce83908187aa..42cb666ee58a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ad502738c107..183ed21ce31a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index d0c2fc409c55..d18e80986aaf 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 2db426ab8bf8..16d4f8bc2fff 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2c247d819cee..8d9d9801c23e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 1b9426d9ab62..ff59c313fc1a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 021d59d2570c..3f48b4f8a065 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ad173f004a1c..110378778074 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 0730133f9cbd..ffea4083f904 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index b8e18631bf1a..30bd83db599a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3f3030998f13..85e9389c1eea 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 99ddaa8d2eb8..158636a401fe 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index 66404193208f..da87f2d68304 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2/.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/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle index 0c9c756cdcc1..9f9ce6cdf768 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -95,8 +95,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" jersey_version = "2.27" junit_version = "4.12" threetenbp_version = "2.6.4" @@ -111,6 +112,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" compile "com.brsanthu:migbase64:2.2" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/jersey2/build.sbt b/samples/client/petstore/java/jersey2/build.sbt index a5f01ab6f066..35031940ba2d 100644 --- a/samples/client/petstore/java/jersey2/build.sbt +++ b/samples/client/petstore/java/jersey2/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "com.brsanthu" % "migbase64" % "2.2", "junit" % "junit" % "4.12" % "test", diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/jersey2/docs/UserApi.md b/samples/client/petstore/java/jersey2/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/jersey2/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey2/git_push.sh b/samples/client/petstore/java/jersey2/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/jersey2/git_push.sh +++ b/samples/client/petstore/java/jersey2/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index d162686c0c3e..33a470f9386d 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -254,6 +254,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.github.joschi.jackson @@ -278,8 +283,9 @@ UTF-8 1.5.22 2.27 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 2.6.4 1.0.0 4.12 diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java index 4a03feb3b8fa..a06ca6f8d63d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java @@ -688,7 +688,7 @@ public ApiResponse invokeAPI(String path, String method, List query } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -700,11 +700,15 @@ public ApiResponse invokeAPI(String path, String method, List query } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); } else { throw new ApiException(500, "unknown method type " + method); } @@ -756,11 +760,16 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/JSON.java index 2df3c2868c40..4e267b9a3611 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/JSON.java @@ -3,6 +3,7 @@ import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import java.text.DateFormat; @@ -27,6 +28,8 @@ public JSON() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper.registerModule(module); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); } /** diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java index 70b4c329d610..267830f13ed4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -584,7 +584,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat */ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -705,7 +705,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -784,7 +784,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo */ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -928,7 +928,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -970,4 +970,99 @@ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java index 22a80aefe3a1..9e59435a5f17 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java @@ -134,7 +134,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -201,7 +201,7 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -270,7 +270,7 @@ public List findPetsByTags(List tags) throws ApiException { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -337,7 +337,7 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -472,7 +472,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -543,7 +543,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -614,7 +614,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java index 84c59b439eb0..5093a9d41165 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java @@ -66,7 +66,7 @@ public void deleteOrder(String orderId) throws ApiException { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -127,7 +127,7 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -188,7 +188,7 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java index 1573bbde1ca6..78b37fbceab9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java @@ -252,7 +252,7 @@ public void deleteUser(String username) throws ApiException { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -319,7 +319,7 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -386,7 +386,7 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -453,7 +453,7 @@ public void logoutUser() throws ApiException { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java index 0d6bc154e463..dabd18a06a1d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0961f776fb02..c9bb8bcebec9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 3617c5c16b2d..32a4d8bb6e4a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java index 151939d60542..75b1edce8d9a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.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/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/native/docs/TypeHolderExample.md b/samples/client/petstore/java/native/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/native/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/native/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/native/docs/UserApi.md b/samples/client/petstore/java/native/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/native/docs/UserApi.md +++ b/samples/client/petstore/java/native/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/native/git_push.sh b/samples/client/petstore/java/native/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/native/git_push.sh +++ b/samples/client/petstore/java/native/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index 522945ca750c..273a741e0ed5 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -181,6 +181,11 @@ jackson-datatype-jsr310 ${jackson-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + @@ -203,6 +208,7 @@ 11 11 2.9.9 + 0.2.0 4.12 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index d09776ee9f0f..8652fda47bf9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import java.net.URI; import java.net.URLEncoder; @@ -162,6 +163,8 @@ public ApiClient() { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.registerModule(new JavaTimeModule()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); URI baseURI = URI.create("http://petstore.swagger.io:80/v2"); scheme = baseURI.getScheme(); host = baseURI.getHost(); @@ -260,6 +263,17 @@ public String getBaseUri() { return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + /** * Set a custom request interceptor. * 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 740a9719ca4c..1fff23d16e96 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 @@ -730,4 +730,80 @@ public void testJsonFormData(String param, String param2) throws ApiException { throw new ApiException(e); } } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/test-query-paramters"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + try { + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (localVarResponse.statusCode()/ 100 != 2) { + throw new ApiException(localVarResponse.statusCode(), + "testQueryParameterCollectionFormat call received non-success response", + localVarResponse.headers(), + localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); + } + + } catch (IOException | InterruptedException e) { + throw new ApiException(e); + } + } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dc8ea1e9ec3b..0b590e6f976e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index ce83908187aa..42cb666ee58a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ad502738c107..183ed21ce31a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index d0c2fc409c55..d18e80986aaf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index 2db426ab8bf8..16d4f8bc2fff 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2c247d819cee..8d9d9801c23e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index 1b9426d9ab62..ff59c313fc1a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index 021d59d2570c..3f48b4f8a065 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ad173f004a1c..110378778074 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index 0730133f9cbd..ffea4083f904 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index b8e18631bf1a..30bd83db599a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3f3030998f13..85e9389c1eea 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 99ddaa8d2eb8..158636a401fe 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java index 66404193208f..da87f2d68304 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 6b06529329f2..afec253f8a97 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -877,3 +878,72 @@ No authorization required |-------------|-------------|------------------| **200** | successful operation | - | + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md index 7f906eed6d99..7a90fb438b19 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md @@ -96,7 +96,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -155,7 +155,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh b/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 44c7a97ffc4f..c070ab318358 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -942,7 +942,7 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1168,7 +1168,7 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1312,7 +1312,7 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1637,7 +1637,7 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1745,4 +1745,165 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for testQueryParameterCollectionFormat + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pipe != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "pipe", pipe)); + } + + if (ioutil != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ioutil", ioutil)); + } + + if (http != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + } + + if (url != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "url", url)); + } + + if (context != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "context", context)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); + } + + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); + return localVarCall; + + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index ce889eb24ecd..c0c72236815c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -180,7 +180,7 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -297,7 +297,7 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByStatus"; @@ -416,7 +416,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByTags"; @@ -541,7 +541,7 @@ public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -776,7 +776,7 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -898,7 +898,7 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" @@ -1024,7 +1024,7 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index d61f72719436..748ae2e8c0a4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -68,7 +68,7 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" @@ -176,7 +176,7 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -279,7 +279,7 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index f3e783d0bc81..d96b89b607ce 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -383,7 +383,7 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -494,7 +494,7 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -612,7 +612,7 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/login"; @@ -739,7 +739,7 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index acb8a5e77231..046018a4bf9e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -40,7 +40,9 @@ public class AdditionalPropertiesAnyType extends HashMap impleme public AdditionalPropertiesAnyType() { super(); } + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -51,10 +53,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index ebc9abb8ddc0..8f440fc6bf77 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -41,7 +41,9 @@ public class AdditionalPropertiesArray extends HashMap implements public AdditionalPropertiesArray() { super(); } + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -52,10 +54,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 4cc350ca10ff..19d55e0f0095 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -40,7 +40,9 @@ public class AdditionalPropertiesBoolean extends HashMap implem public AdditionalPropertiesBoolean() { super(); } + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -51,10 +53,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 23a7b49f01ab..e1edb91edde8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -37,51 +37,53 @@ public class AdditionalPropertiesClass implements Parcelable { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass() { } + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -100,15 +102,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -127,15 +134,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -154,15 +166,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -181,15 +198,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -208,15 +230,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -235,15 +262,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -262,15 +294,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -289,15 +326,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -308,15 +350,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -327,15 +374,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -346,10 +398,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77d124237895..17e9e9d19139 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -40,7 +40,9 @@ public class AdditionalPropertiesInteger extends HashMap implem public AdditionalPropertiesInteger() { super(); } + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -51,10 +53,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 7e0d226868f5..6cbb3aa96849 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -41,7 +41,9 @@ public class AdditionalPropertiesNumber extends HashMap impl public AdditionalPropertiesNumber() { super(); } + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -52,10 +54,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 5d7aa7a622b8..9f14ff2bde0a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -40,7 +40,9 @@ public class AdditionalPropertiesObject extends HashMap implements public AdditionalPropertiesObject() { super(); } + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -51,10 +53,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 7182f8219724..c24a17f9080e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -40,7 +40,9 @@ public class AdditionalPropertiesString extends HashMap implemen public AdditionalPropertiesString() { super(); } + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -51,10 +53,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java index dce6c2969a7a..0d24289a3c05 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java @@ -43,7 +43,9 @@ public class Animal implements Parcelable { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -53,15 +55,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -72,10 +79,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cb59454209e2..088c12706d17 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,11 +36,13 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly() { } + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -59,10 +61,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4d55320e11b5..1f5bf615e5d7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,11 +36,13 @@ public class ArrayOfNumberOnly implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; public ArrayOfNumberOnly() { } + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -59,10 +61,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java index df2d89a61865..1f2fde0c7ef7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -36,19 +36,21 @@ public class ArrayTest implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; public ArrayTest() { } + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -67,15 +69,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -94,15 +101,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -121,10 +133,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java index 21955e67b7cd..f9ddbf936dd1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,7 +57,9 @@ public class Capitalization implements Parcelable { public Capitalization() { } + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -68,15 +70,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -87,15 +94,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -106,15 +118,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -125,15 +142,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -144,15 +166,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -163,10 +190,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java index 5738b17e665e..2f96f6fdb6ae 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java @@ -40,7 +40,9 @@ public class Cat extends Animal implements Parcelable { public Cat() { super(); } + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -51,10 +53,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java index 1d09feb3e716..93b3fbb0c66d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -37,7 +37,9 @@ public class CatAllOf implements Parcelable { public CatAllOf() { } + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -48,10 +50,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java index 8dedfbedc140..1cd35b954bd0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java @@ -41,7 +41,9 @@ public class Category implements Parcelable { public Category() { } + public Category id(Long id) { + this.id = id; return this; } @@ -52,15 +54,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -70,10 +77,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java index cbf4ea5ff1b7..9ec7a3c8cff0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,7 +38,9 @@ public class ClassModel implements Parcelable { public ClassModel() { } + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -49,10 +51,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java index f2dfb2900d37..4e9c9ebc3e4d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java @@ -37,7 +37,9 @@ public class Client implements Parcelable { public Client() { } + public Client client(String client) { + this.client = client; return this; } @@ -48,10 +50,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java index 3f89f3344894..c420287ab428 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java @@ -40,7 +40,9 @@ public class Dog extends Animal implements Parcelable { public Dog() { super(); } + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -51,10 +53,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3e4e0856f2..38d0356fd206 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -37,7 +37,9 @@ public class DogAllOf implements Parcelable { public DogAllOf() { } + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -48,10 +50,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java index 11a6fed5872c..caa59c3a6eab 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -74,7 +74,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -125,7 +125,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -133,11 +133,13 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; public EnumArrays() { } + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -148,15 +150,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -175,10 +182,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index 7c67dd8229fb..383b85c790b7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -75,7 +75,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -128,7 +128,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -179,7 +179,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -230,7 +230,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -246,7 +246,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { public EnumTest() { } + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -257,15 +259,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -275,15 +282,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -294,15 +306,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -313,15 +330,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -332,10 +354,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index b5f0ce559cb1..1222b62971e8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,15 +35,17 @@ public class FileSchemaTestClass implements Parcelable { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; public FileSchemaTestClass() { } + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -54,15 +56,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -81,10 +88,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java index 1f8cd0e08d20..4064f8ee2fe2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java @@ -90,7 +90,9 @@ public class FormatTest implements Parcelable { public FormatTest() { } + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -103,15 +105,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -124,15 +131,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -143,15 +155,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -163,15 +180,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -184,15 +206,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -205,15 +232,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -224,15 +256,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -242,15 +279,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -261,15 +303,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -279,15 +326,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -298,15 +350,20 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -317,15 +374,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -335,10 +397,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 14c218af7e3f..fc314c0a03fc 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,27 +41,35 @@ public class HasOnlyReadOnly implements Parcelable { public HasOnlyReadOnly() { } + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index 09f608dc198b..aaf07f81ced4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,7 +36,7 @@ public class MapTest implements Parcelable { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -79,7 +79,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -87,19 +87,21 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; public MapTest() { } + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -118,15 +120,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -145,15 +152,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -172,15 +184,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -199,10 +216,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index abae7222e26d..1d281317c580 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -47,11 +47,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass() { } + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -62,15 +64,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -81,15 +88,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -108,10 +120,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java index c98ab531f02e..53389691bd6f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,7 +42,9 @@ public class Model200Response implements Parcelable { public Model200Response() { } + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -53,15 +55,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -72,10 +79,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 166efa5ccdbc..fe455189509b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -45,7 +45,9 @@ public class ModelApiResponse implements Parcelable { public ModelApiResponse() { } + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -56,15 +58,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -75,15 +82,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -94,10 +106,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java index d475b487008d..2f84315ce282 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,7 +38,9 @@ public class ModelReturn implements Parcelable { public ModelReturn() { } + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -49,10 +51,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java index adb0ada7b18a..d3169dfa67e9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java @@ -50,7 +50,9 @@ public class Name implements Parcelable { public Name() { } + public Name name(Integer name) { + this.name = name; return this; } @@ -60,25 +62,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -89,25 +100,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java index d9c958887006..932fb9fb8d64 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,7 +38,9 @@ public class NumberOnly implements Parcelable { public NumberOnly() { } + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -49,10 +51,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java index 27f892822848..2e1e19683404 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java @@ -91,7 +91,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -107,7 +107,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public Order() { } + public Order id(Long id) { + this.id = id; return this; } @@ -118,15 +120,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -137,15 +144,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -156,15 +168,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -175,15 +192,20 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -194,15 +216,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -213,10 +240,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java index 171ee7a93d13..8a13eb0902ab 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,7 +46,9 @@ public class OuterComposite implements Parcelable { public OuterComposite() { } + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -57,15 +59,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -76,15 +83,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -95,10 +107,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java index 73ab81f800e7..f6fc8415a72c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java @@ -41,7 +41,7 @@ public class Pet implements Parcelable { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -53,7 +53,7 @@ public class Pet implements Parcelable { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -98,7 +98,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -110,7 +110,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public Pet() { } + public Pet id(Long id) { + this.id = id; return this; } @@ -121,15 +123,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -140,15 +147,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -158,15 +170,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -181,15 +198,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -208,15 +230,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -227,10 +254,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 824c0c728cfc..33b381464356 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,17 +41,23 @@ public class ReadOnlyFirst implements Parcelable { public ReadOnlyFirst() { } + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -62,10 +68,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java index d2eadd0140bf..006df157cc4e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -37,7 +37,9 @@ public class SpecialModelName implements Parcelable { public SpecialModelName() { } + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -48,10 +50,13 @@ public SpecialModelName() { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java index 1e75240cdec3..fa747cd4777a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java @@ -41,7 +41,9 @@ public class Tag implements Parcelable { public Tag() { } + public Tag id(Long id) { + this.id = id; return this; } @@ -52,15 +54,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -71,10 +78,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8cb0ab986890..cdfdf94ca93f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -56,7 +56,9 @@ public class TypeHolderDefault implements Parcelable { public TypeHolderDefault() { } + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -66,15 +68,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -84,15 +91,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -102,15 +114,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +137,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -143,10 +165,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 4945a5b35ab3..a1c16610d3f9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -42,6 +42,10 @@ public class TypeHolderExample implements Parcelable { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -56,7 +60,9 @@ public class TypeHolderExample implements Parcelable { public TypeHolderExample() { } + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -66,15 +72,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -84,15 +95,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -102,15 +141,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +164,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -143,10 +192,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -163,6 +215,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -170,7 +223,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -180,6 +233,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); @@ -202,6 +256,7 @@ private String toIndentedString(java.lang.Object o) { public void writeToParcel(Parcel out, int flags) { out.writeValue(stringItem); out.writeValue(numberItem); + out.writeValue(floatItem); out.writeValue(integerItem); out.writeValue(boolItem); out.writeValue(arrayItem); @@ -210,6 +265,7 @@ public void writeToParcel(Parcel out, int flags) { TypeHolderExample(Parcel in) { stringItem = (String)in.readValue(null); numberItem = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader()); + floatItem = (Float)in.readValue(null); integerItem = (Integer)in.readValue(null); boolItem = (Boolean)in.readValue(null); arrayItem = (List)in.readValue(null); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java index 3d0d5f8fc5c8..a97509e9416e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java @@ -65,7 +65,9 @@ public class User implements Parcelable { public User() { } + public User id(Long id) { + this.id = id; return this; } @@ -76,15 +78,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -95,15 +102,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -114,15 +126,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -133,15 +150,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -152,15 +174,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -171,15 +198,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -190,15 +222,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -209,10 +246,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java index f5151fce0e2f..c5f9a323ab09 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java @@ -52,7 +52,7 @@ public class XmlItem implements Parcelable { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -72,11 +72,11 @@ public class XmlItem implements Parcelable { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -96,11 +96,11 @@ public class XmlItem implements Parcelable { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -120,11 +120,11 @@ public class XmlItem implements Parcelable { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -144,15 +144,17 @@ public class XmlItem implements Parcelable { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; public XmlItem() { } + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -163,15 +165,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -182,15 +189,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -201,15 +213,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -220,15 +237,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -247,15 +269,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -266,15 +293,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -285,15 +317,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -304,15 +341,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -323,15 +365,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -350,15 +397,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -377,15 +429,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -396,15 +453,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -415,15 +477,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -434,15 +501,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -453,15 +525,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -480,15 +557,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -507,15 +589,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -526,15 +613,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -545,15 +637,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -564,15 +661,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -583,15 +685,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -610,15 +717,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -637,15 +749,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -656,15 +773,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -675,15 +797,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -694,15 +821,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -713,15 +845,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -740,15 +877,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -767,10 +909,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.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/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 6b06529329f2..afec253f8a97 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -877,3 +878,72 @@ No authorization required |-------------|-------------|------------------| **200** | successful operation | - | + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/okhttp-gson/docs/TypeHolderExample.md b/samples/client/petstore/java/okhttp-gson/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/okhttp-gson/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md index 7f906eed6d99..7a90fb438b19 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md @@ -96,7 +96,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -155,7 +155,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/okhttp-gson/git_push.sh b/samples/client/petstore/java/okhttp-gson/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/okhttp-gson/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 44c7a97ffc4f..c070ab318358 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -942,7 +942,7 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1168,7 +1168,7 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1312,7 +1312,7 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1637,7 +1637,7 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1745,4 +1745,165 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for testQueryParameterCollectionFormat + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pipe != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "pipe", pipe)); + } + + if (ioutil != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ioutil", ioutil)); + } + + if (http != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + } + + if (url != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "url", url)); + } + + if (context != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "context", context)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); + } + + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); + return localVarCall; + + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index ce889eb24ecd..c0c72236815c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -180,7 +180,7 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -297,7 +297,7 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByStatus"; @@ -416,7 +416,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByTags"; @@ -541,7 +541,7 @@ public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -776,7 +776,7 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -898,7 +898,7 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" @@ -1024,7 +1024,7 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index d61f72719436..748ae2e8c0a4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -68,7 +68,7 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" @@ -176,7 +176,7 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -279,7 +279,7 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index f3e783d0bc81..d96b89b607ce 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -383,7 +383,7 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -494,7 +494,7 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -612,7 +612,7 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/login"; @@ -739,7 +739,7 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 6639252ccb33..13e761a8d9c0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c3f2ca0a464..17e320b0a953 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7c4a5248c073..8a51fa9f778d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b016f1f3778f..a4a797bb487c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,49 +35,51 @@ public class AdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -96,15 +98,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +130,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +162,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +194,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -204,15 +226,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -231,15 +258,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -258,15 +290,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -285,15 +322,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -304,15 +346,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -323,15 +370,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -342,10 +394,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 10df3df74c74..4f2e3ef333e9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 33719cab2611..80ce73d422b5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e37e04b01a6d..bc5cc81bf64e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfbf74f5b328..2e9c0c7ffd9f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java index 0a02419dbf16..dd6b313c58cd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,9 @@ public class Animal { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +53,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +77,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 4f016503d471..1af52a3a988d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 15d27a21f287..eba8d40a2893 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java index 7f6d476044d4..7ba0d8b77e0d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,17 +34,19 @@ public class ArrayTest { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -63,15 +65,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +97,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -117,10 +129,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java index ef40fe949fdf..dc70cf2b5975 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,7 +53,9 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -64,15 +66,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -83,15 +90,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -102,15 +114,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -121,15 +138,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -140,15 +162,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -159,10 +186,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java index c600502f716f..8829c547501d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,9 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -46,10 +48,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java index 29b3658551eb..d20d19aa53f7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,9 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -44,10 +46,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java index 1968763722dc..f335f0b5217d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java @@ -37,7 +37,9 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +73,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java index 52245d70502d..83c30b802d49 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,9 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -45,10 +47,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java index e5ece3536d60..192c0ce6e5b6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,9 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -44,10 +46,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java index d877eb2f3706..2f8a4652247c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,9 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -46,10 +48,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java index 54483f2227d1..96610291473f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,9 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -44,10 +46,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java index a5aba01d533d..bbb97598ea37 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -72,7 +72,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -123,7 +123,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -131,9 +131,11 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -144,15 +146,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -171,10 +178,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index 679584204fb5..c08e4f6239de 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -73,7 +73,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -126,7 +126,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -228,7 +228,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -242,7 +242,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -253,15 +255,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -271,15 +278,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -290,15 +302,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -309,15 +326,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -328,10 +350,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 181141b92dc4..45ce4347b2dd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,13 +33,15 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +52,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -77,10 +84,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java index 583b12a0ebc8..36fe58976838 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -86,7 +86,9 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -99,15 +101,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -120,15 +127,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -139,15 +151,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -159,15 +176,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -180,15 +202,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -201,15 +228,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -220,15 +252,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -238,15 +275,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -257,15 +299,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -275,15 +322,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -294,15 +346,20 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -313,15 +370,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -331,10 +393,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 02225d278c47..8fcb26846436 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,27 +37,35 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index 329cb4c87b8d..b19863fb9931 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,7 +77,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -85,17 +85,19 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -114,15 +116,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -141,15 +148,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -168,15 +180,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -195,10 +212,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1826c8b064c7..815cf8d5e050 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,9 +45,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +60,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -77,15 +84,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -104,10 +116,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java index 3167560a9dd0..42a61d0d8776 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,7 +38,9 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -49,15 +51,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -68,10 +75,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84d2fcc4d396..db323b17602a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,7 +41,9 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -52,15 +54,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -71,15 +78,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -90,10 +102,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java index c13f1babe599..da9f1a20259d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,7 +34,9 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -45,10 +47,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java index 221821d4e191..f775f97b3f19 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java @@ -46,7 +46,9 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +58,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +96,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a068c2e1ee6..1a7bd689645f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,9 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +47,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java index 9ee41b5b8a92..8b4c1c910b72 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java @@ -89,7 +89,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -103,7 +103,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -114,15 +116,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -133,15 +140,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -152,15 +164,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -171,15 +188,20 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -190,15 +212,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -209,10 +236,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java index 690b6bde4be1..3db0e2e26c9a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,7 +42,9 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +55,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +79,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +103,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index 59fe8406f43d..643184ae4fc1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -51,7 +51,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -96,7 +96,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -106,7 +106,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -117,15 +119,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -136,15 +143,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -154,15 +166,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -177,15 +194,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -204,15 +226,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -223,10 +250,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 84780d763a0d..2501babb56ea 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,17 +37,23 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -58,10 +64,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java index c6ccd2c33f6a..4ff598a6cfca 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,9 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -44,10 +46,13 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java index 504c51cc3e59..693247a2fd27 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -37,7 +37,9 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -67,10 +74,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8fc321bc0a20..e61b1492abc2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,7 +52,9 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +64,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +87,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +110,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +133,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +161,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d9496cbd7902..bf0f4550ccbf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,10 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -52,7 +56,9 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +91,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +137,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +160,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +188,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -159,6 +211,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -166,7 +219,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -176,6 +229,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java index 1aedd044b588..3760c07c5927 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java @@ -61,7 +61,9 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -72,15 +74,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -91,15 +98,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -110,15 +122,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -129,15 +146,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -148,15 +170,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -167,15 +194,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -186,15 +218,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -205,10 +242,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java index ea15cdba33cf..4fce3d5e1c05 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -50,7 +50,7 @@ public class XmlItem { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -70,11 +70,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -94,11 +94,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -118,11 +118,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -142,13 +142,15 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -159,15 +161,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +185,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +209,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +233,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +265,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +289,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -281,15 +313,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -300,15 +337,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -319,15 +361,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -346,15 +393,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -373,15 +425,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -392,15 +449,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -411,15 +473,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -430,15 +497,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -449,15 +521,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -476,15 +553,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -503,15 +585,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -522,15 +609,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -541,15 +633,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -560,15 +657,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -579,15 +681,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -606,15 +713,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -633,15 +745,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -652,15 +769,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -671,15 +793,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -690,15 +817,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -709,15 +841,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -736,15 +873,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -763,10 +905,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 73f0b3c6f5c3..27121aec515e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -53,6 +53,7 @@ public void arrayArrayNumberTest() { List arrayArrayNumber = new ArrayList(); arrayArrayNumber.add(b1); arrayArrayNumber.add(b2); + model.setArrayArrayNumber(new ArrayList>()); model.getArrayArrayNumber().add(arrayArrayNumber); // create another instance for comparison @@ -62,6 +63,7 @@ public void arrayArrayNumberTest() { List arrayArrayNumber2 = new ArrayList(); arrayArrayNumber2.add(b1); arrayArrayNumber2.add(b2); + model2.setArrayArrayNumber(new ArrayList>()); model2.getArrayArrayNumber().add(arrayArrayNumber2); Assert.assertTrue(model2.equals(model)); diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.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/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index b05326008f5d..135f2fc93d45 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -109,6 +109,7 @@ dependencies { compile "com.google.code.findbugs:jsr305:3.0.2" compile "io.rest-assured:scala-support:$rest_assured_version" compile "io.gsonfire:gson-fire:$gson_fire_version" + compile 'com.google.code.gson:gson:$gson_version' compile "org.threeten:threetenbp:$threetenbp_version" compile "com.squareup.okio:okio:$okio_version" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/rest-assured/docs/FakeApi.md b/samples/client/petstore/java/rest-assured/docs/FakeApi.md index cda10bf74d5e..c60da0e25a5a 100644 --- a/samples/client/petstore/java/rest-assured/docs/FakeApi.md +++ b/samples/client/petstore/java/rest-assured/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -588,3 +589,53 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +//import org.openapitools.client.ApiClient; +//import io.restassured.builder.RequestSpecBuilder; +//import io.restassured.filter.log.ErrorLoggingFilter; + +FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( + () -> new RequestSpecBuilder() + .setBaseUri("http://petstore.swagger.io:80/v2"))).fake(); + +api.testQueryParameterCollectionFormat() + .pipeQuery(pipe) + .ioutilQuery(ioutil) + .httpQuery(http) + .urlQuery(url) + .contextQuery(context).execute(r -> r.prettyPeek()); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **ioutil** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **http** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **url** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **context** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + +### 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/java/rest-assured/docs/TypeHolderExample.md b/samples/client/petstore/java/rest-assured/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/rest-assured/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/rest-assured/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/rest-assured/git_push.sh b/samples/client/petstore/java/rest-assured/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/rest-assured/git_push.sh +++ b/samples/client/petstore/java/rest-assured/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index 5dd9a1b8f4bf..7c3d394676ba 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -225,11 +225,11 @@ gson-fire ${gson-fire-version} - - com.squareup.okio - okio - ${okio-version} - + + com.squareup.okio + okio + ${okio-version} + junit diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ApiClient.java index ec1d9a433cce..623f135280ef 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ApiClient.java @@ -23,6 +23,7 @@ import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; + public class ApiClient { public static final String BASE_URI = "http://petstore.swagger.io:80/v2"; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 13de1523a6ab..cc52d202adf6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -33,7 +33,6 @@ import java.util.function.Function; import java.util.function.Supplier; import org.openapitools.client.JSON; - import static io.restassured.http.Method.*; @Api(value = "AnotherFake") diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java index 7ba6b4294aeb..543cb0c42957 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java @@ -41,7 +41,6 @@ import java.util.function.Function; import java.util.function.Supplier; import org.openapitools.client.JSON; - import static io.restassured.http.Method.*; @Api(value = "Fake") @@ -199,6 +198,16 @@ public TestJsonFormDataOper testJsonFormData() { return new TestJsonFormDataOper(createReqSpec()); } + @ApiOperation(value = "", + notes = "To test the collection format in query parameters", + nickname = "testQueryParameterCollectionFormat", + tags = { "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public TestQueryParameterCollectionFormatOper testQueryParameterCollectionFormat() { + return new TestQueryParameterCollectionFormatOper(createReqSpec()); + } + /** * Customize request specification * @param reqSpecCustomizer consumer to modify the RequestSpecBuilder @@ -1375,4 +1384,113 @@ public TestJsonFormDataOper respSpec(Consumer respSpecCusto return this; } } + /** + * + * To test the collection format in query parameters + * + * @see #pipeQuery (required) + * @see #ioutilQuery (required) + * @see #httpQuery (required) + * @see #urlQuery (required) + * @see #contextQuery (required) + */ + public static class TestQueryParameterCollectionFormatOper { + + public static final Method REQ_METHOD = PUT; + public static final String REQ_URI = "/fake/test-query-paramters"; + + private RequestSpecBuilder reqSpec; + private ResponseSpecBuilder respSpec; + + public TestQueryParameterCollectionFormatOper(RequestSpecBuilder reqSpec) { + this.reqSpec = reqSpec; + reqSpec.setAccept("application/json"); + this.respSpec = new ResponseSpecBuilder(); + } + + /** + * PUT /fake/test-query-paramters + * @param handler handler + * @param type + * @return type + */ + public T execute(Function handler) { + return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI)); + } + + public static final String PIPE_QUERY = "pipe"; + + /** + * @param pipe (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper pipeQuery(Object... pipe) { + reqSpec.addQueryParam(PIPE_QUERY, pipe); + return this; + } + + public static final String IOUTIL_QUERY = "ioutil"; + + /** + * @param ioutil (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper ioutilQuery(Object... ioutil) { + reqSpec.addQueryParam(IOUTIL_QUERY, ioutil); + return this; + } + + public static final String HTTP_QUERY = "http"; + + /** + * @param http (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper httpQuery(Object... http) { + reqSpec.addQueryParam(HTTP_QUERY, http); + return this; + } + + public static final String URL_QUERY = "url"; + + /** + * @param url (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper urlQuery(Object... url) { + reqSpec.addQueryParam(URL_QUERY, url); + return this; + } + + public static final String CONTEXT_QUERY = "context"; + + /** + * @param context (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper contextQuery(Object... context) { + reqSpec.addQueryParam(CONTEXT_QUERY, context); + return this; + } + + /** + * Customize request specification + * @param reqSpecCustomizer consumer to modify the RequestSpecBuilder + * @return operation + */ + public TestQueryParameterCollectionFormatOper reqSpec(Consumer reqSpecCustomizer) { + reqSpecCustomizer.accept(reqSpec); + return this; + } + + /** + * Customize response specification + * @param respSpecCustomizer consumer to modify the ResponseSpecBuilder + * @return operation + */ + public TestQueryParameterCollectionFormatOper respSpec(Consumer respSpecCustomizer) { + respSpecCustomizer.accept(respSpec); + return this; + } + } } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index f7130fef3c24..aff1931bb82b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -33,7 +33,6 @@ import java.util.function.Function; import java.util.function.Supplier; import org.openapitools.client.JSON; - import static io.restassured.http.Method.*; @Api(value = "FakeClassnameTags123") diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java index cc8a389d94a1..4ffbfa3bcac2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java @@ -35,7 +35,6 @@ import java.util.function.Function; import java.util.function.Supplier; import org.openapitools.client.JSON; - import static io.restassured.http.Method.*; @Api(value = "Pet") diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java index 83591c716957..9ba5cec8cdbf 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java @@ -33,7 +33,6 @@ import java.util.function.Function; import java.util.function.Supplier; import org.openapitools.client.JSON; - import static io.restassured.http.Method.*; @Api(value = "Store") diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java index 3ab3025c92ba..38c921afb996 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java @@ -33,7 +33,6 @@ import java.util.function.Function; import java.util.function.Supplier; import org.openapitools.client.JSON; - import static io.restassured.http.Method.*; @Api(value = "User") diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 6639252ccb33..13e761a8d9c0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c3f2ca0a464..17e320b0a953 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7c4a5248c073..8a51fa9f778d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b016f1f3778f..a4a797bb487c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,49 +35,51 @@ public class AdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -96,15 +98,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +130,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +162,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +194,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -204,15 +226,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -231,15 +258,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -258,15 +290,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -285,15 +322,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -304,15 +346,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -323,15 +370,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -342,10 +394,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 10df3df74c74..4f2e3ef333e9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 33719cab2611..80ce73d422b5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e37e04b01a6d..bc5cc81bf64e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfbf74f5b328..2e9c0c7ffd9f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index 0a02419dbf16..dd6b313c58cd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,9 @@ public class Animal { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +53,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +77,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 4f016503d471..1af52a3a988d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 15d27a21f287..eba8d40a2893 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index 7f6d476044d4..7ba0d8b77e0d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,17 +34,19 @@ public class ArrayTest { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -63,15 +65,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +97,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -117,10 +129,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index ef40fe949fdf..dc70cf2b5975 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,7 +53,9 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -64,15 +66,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -83,15 +90,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -102,15 +114,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -121,15 +138,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -140,15 +162,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -159,10 +186,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index 91196d53a89b..65795e6d7acf 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,9 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -46,10 +48,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java index d7569c72fd48..94268aba4af0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,9 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -44,10 +46,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean isDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 1968763722dc..f335f0b5217d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -37,7 +37,9 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +73,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 52245d70502d..83c30b802d49 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,9 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -45,10 +47,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index e5ece3536d60..192c0ce6e5b6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,9 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -44,10 +46,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index d877eb2f3706..2f8a4652247c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,9 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -46,10 +48,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java index 54483f2227d1..96610291473f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,9 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -44,10 +46,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index a5aba01d533d..bbb97598ea37 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -72,7 +72,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -123,7 +123,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -131,9 +131,11 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -144,15 +146,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -171,10 +178,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 679584204fb5..c08e4f6239de 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -73,7 +73,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -126,7 +126,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -228,7 +228,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -242,7 +242,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -253,15 +255,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -271,15 +278,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -290,15 +302,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -309,15 +326,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -328,10 +350,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 181141b92dc4..45ce4347b2dd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,13 +33,15 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +52,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -77,10 +84,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index 583b12a0ebc8..36fe58976838 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -86,7 +86,9 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -99,15 +101,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -120,15 +127,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -139,15 +151,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -159,15 +176,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -180,15 +202,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -201,15 +228,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -220,15 +252,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -238,15 +275,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -257,15 +299,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -275,15 +322,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -294,15 +346,20 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -313,15 +370,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -331,10 +393,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 02225d278c47..8fcb26846436 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,27 +37,35 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 329cb4c87b8d..b19863fb9931 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,7 +77,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -85,17 +85,19 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -114,15 +116,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -141,15 +148,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -168,15 +180,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -195,10 +212,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1826c8b064c7..815cf8d5e050 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,9 +45,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +60,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -77,15 +84,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -104,10 +116,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index 3167560a9dd0..42a61d0d8776 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,7 +38,9 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -49,15 +51,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -68,10 +75,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84d2fcc4d396..db323b17602a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,7 +41,9 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -52,15 +54,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -71,15 +78,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -90,10 +102,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index c13f1babe599..da9f1a20259d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,7 +34,9 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -45,10 +47,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index 221821d4e191..f775f97b3f19 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -46,7 +46,9 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +58,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +96,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a068c2e1ee6..1a7bd689645f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,9 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +47,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index bfd740e83b5b..550086024f52 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -89,7 +89,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -103,7 +103,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -114,15 +116,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -133,15 +140,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -152,15 +164,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -171,15 +188,20 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -190,15 +212,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -209,10 +236,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean isComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 5bc91ffa0a16..0147882173c9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,7 +42,9 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +55,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +79,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +103,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean isMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index 59fe8406f43d..643184ae4fc1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -51,7 +51,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -96,7 +96,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -106,7 +106,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -117,15 +119,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -136,15 +143,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -154,15 +166,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -177,15 +194,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -204,15 +226,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -223,10 +250,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 84780d763a0d..2501babb56ea 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,17 +37,23 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -58,10 +64,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index c6ccd2c33f6a..4ff598a6cfca 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,9 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -44,10 +46,13 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index 504c51cc3e59..693247a2fd27 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -37,7 +37,9 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -67,10 +74,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 13d9a5ad6708..2a91f01e7cd1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,7 +52,9 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +64,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +87,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +110,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +133,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +161,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index adf66b7c6542..9c981c42ea22 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,10 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -52,7 +56,9 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +91,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +137,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +160,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean isBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +188,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -159,6 +211,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -166,7 +219,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -176,6 +229,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index 1aedd044b588..3760c07c5927 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -61,7 +61,9 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -72,15 +74,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -91,15 +98,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -110,15 +122,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -129,15 +146,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -148,15 +170,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -167,15 +194,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -186,15 +218,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -205,10 +242,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index 42c4ad163123..fd741c730126 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -50,7 +50,7 @@ public class XmlItem { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -70,11 +70,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -94,11 +94,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -118,11 +118,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -142,13 +142,15 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -159,15 +161,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +185,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +209,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +233,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean isAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +265,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +289,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -281,15 +313,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -300,15 +337,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -319,15 +361,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean isNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -346,15 +393,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -373,15 +425,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -392,15 +449,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -411,15 +473,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -430,15 +497,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -449,15 +521,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean isPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -476,15 +553,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -503,15 +585,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -522,15 +609,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -541,15 +633,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -560,15 +657,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -579,15 +681,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean isNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -606,15 +713,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -633,15 +745,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -652,15 +769,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -671,15 +793,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -690,15 +817,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -709,15 +841,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean isPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -736,15 +873,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -763,10 +905,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.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/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index eddbfd1e8431..0fa0a028d250 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -95,8 +95,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" threetenbp_version = "2.6.4" resteasy_version = "3.1.3.Final" jodatime_version = "2.9.9" @@ -113,6 +114,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile "joda-time:joda-time:$jodatime_version" compile "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index 9b2cf7539f3f..7b4207991b71 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.9" % "compile", "joda-time" % "joda-time" % "2.9.9" % "compile", diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/resteasy/docs/TypeHolderExample.md b/samples/client/petstore/java/resteasy/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/resteasy/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/resteasy/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/resteasy/docs/UserApi.md b/samples/client/petstore/java/resteasy/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/resteasy/docs/UserApi.md +++ b/samples/client/petstore/java/resteasy/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/resteasy/git_push.sh b/samples/client/petstore/java/resteasy/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/resteasy/git_push.sh +++ b/samples/client/petstore/java/resteasy/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 1b327454a681..829d0971d390 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -193,6 +193,11 @@ jackson-databind ${jackson-databind-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + com.fasterxml.jackson.datatype jackson-datatype-joda @@ -238,8 +243,9 @@ UTF-8 1.5.22 3.1.3.Final - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 2.6.4 2.9.9 1.0.0 diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java index 933582c7e04c..51552f8230dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java @@ -41,6 +41,7 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @@ -652,11 +653,15 @@ public T invokeAPI(String path, String method, List queryParams, Objec } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { - response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity); + response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); } else { throw new ApiException(500, "unknown method type " + method); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JSON.java index b85fd70601fc..b586ff362190 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/JSON.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.joda.*; import java.text.DateFormat; @@ -21,6 +22,8 @@ public JSON() { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); mapper.registerModule(new JodaModule()); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index 753f181e9719..bf9c1667efe3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -374,7 +374,7 @@ public Client testClientModel(Client body) throws ApiException { * @throws ApiException if fails to make API call */ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -464,7 +464,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @throws ApiException if fails to make API call */ public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake".replaceAll("\\{format\\}","json"); @@ -516,7 +516,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe * @throws ApiException if fails to make API call */ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -615,7 +615,7 @@ public void testInlineAdditionalProperties(Map param) throws Api * @throws ApiException if fails to make API call */ public void testJsonFormData(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -657,4 +657,73 @@ public void testJsonFormData(String param, String param2) throws ApiException { apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java index bde2cae971d9..4d85cdd1fe40 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java @@ -84,7 +84,7 @@ public void addPet(Pet body) throws ApiException { * @throws ApiException if fails to make API call */ public void deletePet(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -128,7 +128,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { * @throws ApiException if fails to make API call */ public List findPetsByStatus(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -172,7 +172,7 @@ public List findPetsByStatus(List status) throws ApiException { */ @Deprecated public List findPetsByTags(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -214,7 +214,7 @@ public List findPetsByTags(List tags) throws ApiException { * @throws ApiException if fails to make API call */ public Pet getPetById(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -297,7 +297,7 @@ public void updatePet(Pet body) throws ApiException { * @throws ApiException if fails to make API call */ public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -345,7 +345,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api * @throws ApiException if fails to make API call */ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -393,7 +393,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f * @throws ApiException if fails to make API call */ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java index 61ecbcd45bd5..c88879d7e845 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java @@ -41,7 +41,7 @@ public void setApiClient(ApiClient apiClient) { * @throws ApiException if fails to make API call */ public void deleteOrder(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -82,7 +82,7 @@ public void deleteOrder(String orderId) throws ApiException { * @throws ApiException if fails to make API call */ public Map getInventory() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); @@ -118,7 +118,7 @@ public Map getInventory() throws ApiException { * @throws ApiException if fails to make API call */ public Order getOrderById(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java index c52ebbc6eed4..ee251c3858d5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java @@ -161,7 +161,7 @@ public void createUsersWithListInput(List body) throws ApiException { * @throws ApiException if fails to make API call */ public void deleteUser(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -203,7 +203,7 @@ public void deleteUser(String username) throws ApiException { * @throws ApiException if fails to make API call */ public User getUserByName(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -246,7 +246,7 @@ public User getUserByName(String username) throws ApiException { * @throws ApiException if fails to make API call */ public String loginUser(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -292,7 +292,7 @@ public String loginUser(String username, String password) throws ApiException { * @throws ApiException if fails to make API call */ public void logoutUser() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index 0d6bc154e463..dabd18a06a1d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0961f776fb02..c9bb8bcebec9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 3617c5c16b2d..32a4d8bb6e4a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index 151939d60542..75b1edce8d9a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.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/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index c72c59f98a0a..6345e3b0f2d6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -96,8 +96,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" junit_version = "4.12" @@ -112,6 +113,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/TypeHolderExample.md b/samples/client/petstore/java/resttemplate-withXml/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/resttemplate-withXml/git_push.sh b/samples/client/petstore/java/resttemplate-withXml/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/git_push.sh +++ b/samples/client/petstore/java/resttemplate-withXml/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index 03f37e2fc0c3..74763f9a6c8e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -236,6 +236,11 @@ jackson-jaxrs-json-provider ${jackson-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + @@ -264,6 +269,7 @@ 4.3.9.RELEASE 2.9.9 2.9.9 + 0.2.0 2.6.4 1.0.0 4.12 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 6ccafb53cc2f..5d8fa7b9a8ed 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 @@ -34,6 +34,7 @@ import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import java.io.BufferedReader; import java.io.IOException; @@ -649,6 +650,7 @@ protected RestTemplate buildRestTemplate() { messageConverters.add(new MappingJackson2HttpMessageConverter()); XmlMapper xmlMapper = new XmlMapper(); xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); + xmlMapper.registerModule(new JsonNullableModule()); messageConverters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); RestTemplate restTemplate = new RestTemplate(messageConverters); @@ -661,6 +663,7 @@ protected RestTemplate buildRestTemplate() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper.registerModule(module); + mapper.registerModule(new JsonNullableModule()); } } // This allows us to read the response more than once - Necessary for debugging. 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 4981d7ea3a8a..8b7f1118e5f7 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 @@ -589,4 +589,65 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + Object postBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + String path = apiClient.expandPath("/fake/test-query-paramters", Collections.emptyMap()); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + 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)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a1d2fdc6b..1ab77fed738f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesAnyType") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesAnyType") public class AdditionalPropertiesAnyType extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -50,10 +55,16 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index af9a2679f911..4c6150829cbc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,24 +24,28 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesArray") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesArray") public class AdditionalPropertiesArray extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -51,10 +56,16 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 02df03199f97..c4d8741f2456 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesBoolean") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesBoolean") public class AdditionalPropertiesBoolean extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -50,10 +55,16 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 82a2de80c1fc..893a831d603c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,100 +25,102 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) @XmlRootElement(name = "AdditionalPropertiesClass") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { - public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "inner") - private Map mapString = new HashMap(); + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + private Map mapString = null; - public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=BigDecimal @XmlElement(name = "inner") - private Map mapNumber = new HashMap(); + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + private Map mapNumber = null; - public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "inner") - private Map mapInteger = new HashMap(); + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + private Map mapInteger = null; - public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Boolean @XmlElement(name = "inner") - private Map mapBoolean = new HashMap(); + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + private Map mapBoolean = null; - public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=List<Integer> @XmlElement(name = "inner") - private Map> mapArrayInteger = new HashMap>(); + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + private Map> mapArrayInteger = null; - public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=List<Object> @XmlElement(name = "inner") - private Map> mapArrayAnytype = new HashMap>(); + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + private Map> mapArrayAnytype = null; - public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Map<String, String> @XmlElement(name = "inner") - private Map> mapMapString = new HashMap>(); + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + private Map> mapMapString = null; - public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Map<String, Object> @XmlElement(name = "inner") - private Map> mapMapAnytype = new HashMap>(); + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + private Map> mapMapAnytype = null; - public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - @JacksonXmlProperty(localName = "anytype_1") @XmlElement(name = "anytype_1") - private Object anytype1 = null; + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + private Object anytype1; - public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - @JacksonXmlProperty(localName = "anytype_2") @XmlElement(name = "anytype_2") - private Object anytype2 = null; + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + private Object anytype2; - public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - @JacksonXmlProperty(localName = "anytype_3") @XmlElement(name = "anytype_3") - private Object anytype3 = null; + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -136,15 +139,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -163,15 +173,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -190,15 +207,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -217,15 +241,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -244,15 +275,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -271,15 +309,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -298,15 +343,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -325,15 +377,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -344,15 +403,23 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_1") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -363,15 +430,23 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_2") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -382,10 +457,16 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_3") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index ed7a57eb1eba..f6c3424388c5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesInteger") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesInteger") public class AdditionalPropertiesInteger extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -50,10 +55,16 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index fe1af38c34b3..ae39a9f48e4c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,24 +24,28 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesNumber") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesNumber") public class AdditionalPropertiesNumber extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -51,10 +56,16 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 23a4f6750ab8..897018cb53d7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesObject") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesObject") public class AdditionalPropertiesObject extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -50,10 +55,16 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 234743f50e0f..c8a94eea08b2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "AdditionalPropertiesString") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesString") public class AdditionalPropertiesString extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -50,10 +55,16 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index cfa45cacb637..9265b5317eec 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,12 +23,17 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -39,19 +45,17 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Animal") public class Animal { - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JacksonXmlProperty(localName = "className") @XmlElement(name = "className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; private String className; - public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) - @JacksonXmlProperty(localName = "color") @XmlElement(name = "color") + public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -61,15 +65,23 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -80,10 +92,16 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9738cfc15f1b..11ed5ea28046 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,26 +24,31 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) @XmlRootElement(name = "ArrayOfArrayOfNumberOnly") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) // Is a container wrapped=false // items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace= // items.example= items.type=List<BigDecimal> @XmlElement(name = "arrayArrayNumber") - private List> arrayArrayNumber = new ArrayList>(); + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -61,10 +67,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 020c8b1ff7e2..6d8d8f6fdbd2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,26 +24,31 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) @XmlRootElement(name = "ArrayOfNumberOnly") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) // Is a container wrapped=false // items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace= // items.example= items.type=BigDecimal @XmlElement(name = "arrayNumber") - private List arrayNumber = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -61,10 +67,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index 8f0d753556ab..5c82d3c89c1f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,42 +24,47 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) @XmlRootElement(name = "ArrayTest") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { - public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) // Is a container wrapped=false // items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "arrayOfString") - private List arrayOfString = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString = null; - public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) // Is a container wrapped=false // items.name=arrayArrayOfInteger items.baseName=arrayArrayOfInteger items.xmlName= items.xmlNamespace= // items.example= items.type=List<Long> @XmlElement(name = "arrayArrayOfInteger") - private List> arrayArrayOfInteger = new ArrayList>(); + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger = null; - public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) // Is a container wrapped=false // items.name=arrayArrayOfModel items.baseName=arrayArrayOfModel items.xmlName= items.xmlNamespace= // items.example= items.type=List<ReadOnlyFirst> @XmlElement(name = "arrayArrayOfModel") - private List> arrayArrayOfModel = new ArrayList>(); + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -77,15 +83,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -104,15 +117,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -131,10 +151,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index 520e7400d749..9dbf22d4ccf5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,59 +15,59 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) @XmlRootElement(name = "Capitalization") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Capitalization") public class Capitalization { - public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JacksonXmlProperty(localName = "smallCamel") @XmlElement(name = "smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; private String smallCamel; - public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JacksonXmlProperty(localName = "CapitalCamel") @XmlElement(name = "CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; private String capitalCamel; - public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JacksonXmlProperty(localName = "small_Snake") @XmlElement(name = "small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; private String smallSnake; - public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JacksonXmlProperty(localName = "Capital_Snake") @XmlElement(name = "Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; private String capitalSnake; - public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") @XmlElement(name = "SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; private String scAETHFlowPoints; - public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) - @JacksonXmlProperty(localName = "ATT_NAME") @XmlElement(name = "ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -78,15 +78,23 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -97,15 +105,23 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -116,15 +132,23 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -135,15 +159,23 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -154,15 +186,23 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -173,10 +213,16 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index a26c42f8d435..914ae0e1d6e2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) @XmlRootElement(name = "Cat") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Cat") public class Cat extends Animal { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JacksonXmlProperty(localName = "declawed") @XmlElement(name = "declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -50,10 +55,16 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index 9f1058045279..d4787cee33bd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,29 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) @XmlRootElement(name = "CatAllOf") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "CatAllOf") public class CatAllOf { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JacksonXmlProperty(localName = "declawed") @XmlElement(name = "declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -48,10 +53,16 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index 9278904f6919..ba1daba69010 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -15,35 +15,39 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "Category") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Category") public class Category { - public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) - @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") + public static final String JSON_PROPERTY_ID = "id"; private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -54,15 +58,23 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -72,10 +84,16 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index 0c74063d6814..25d9c8d4f06f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; @@ -27,18 +29,21 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) @XmlRootElement(name = "ClassModel") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ClassModel") public class ClassModel { - public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JacksonXmlProperty(localName = "_class") @XmlElement(name = "_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -49,10 +54,16 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index 3b7ce5c17ceb..ecb934696f09 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -15,29 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) @XmlRootElement(name = "Client") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Client") public class Client { - public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) - @JacksonXmlProperty(localName = "client") @XmlElement(name = "client") + public static final String JSON_PROPERTY_CLIENT = "client"; private String client; + public Client client(String client) { + this.client = client; return this; } @@ -48,10 +53,16 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index b95d3f385bc8..0e198c2302f0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,24 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) @XmlRootElement(name = "Dog") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Dog") public class Dog extends Animal { - public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) - @JacksonXmlProperty(localName = "breed") @XmlElement(name = "breed") + public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -50,10 +55,16 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index 10cecedd80b4..f413def1dc3f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,29 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) @XmlRootElement(name = "DogAllOf") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "DogAllOf") public class DogAllOf { - public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) - @JacksonXmlProperty(localName = "breed") @XmlElement(name = "breed") + public static final String JSON_PROPERTY_BREED = "breed"; private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -48,10 +53,16 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index 8262fb046ec5..64939f3923df 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,12 +23,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) @XmlRootElement(name = "EnumArrays") @XmlAccessorType(XmlAccessType.FIELD) @@ -68,10 +74,8 @@ public static JustSymbolEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JacksonXmlProperty(localName = "just_symbol") @XmlElement(name = "just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; private JustSymbolEnum justSymbol; /** @@ -109,15 +113,16 @@ public static ArrayEnumEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) // Is a container wrapped=false // items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "arrayEnum") - private List arrayEnum = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -128,15 +133,23 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -155,10 +168,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumClass.java index a7ffe1f30d5d..747fb015cdc2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 3813bb861f4b..0e979e564cbd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,18 +15,27 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) @XmlRootElement(name = "EnumTest") @XmlAccessorType(XmlAccessType.FIELD) @@ -69,10 +78,8 @@ public static EnumStringEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JacksonXmlProperty(localName = "enum_string") @XmlElement(name = "enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; private EnumStringEnum enumString; /** @@ -112,10 +119,8 @@ public static EnumStringRequiredEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JacksonXmlProperty(localName = "enum_string_required") @XmlElement(name = "enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; private EnumStringRequiredEnum enumStringRequired; /** @@ -153,10 +158,8 @@ public static EnumIntegerEnum fromValue(Integer value) { } } - public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JacksonXmlProperty(localName = "enum_integer") @XmlElement(name = "enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; private EnumIntegerEnum enumInteger; /** @@ -194,19 +197,17 @@ public static EnumNumberEnum fromValue(Double value) { } } - public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JacksonXmlProperty(localName = "enum_number") @XmlElement(name = "enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; - public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - @JacksonXmlProperty(localName = "outerEnum") @XmlElement(name = "outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -217,15 +218,23 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -235,15 +244,23 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -254,15 +271,23 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -273,15 +298,23 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -292,10 +325,16 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnum") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e3207ecd97d7..9690372c1ceb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,32 +23,36 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) @XmlRootElement(name = "FileSchemaTestClass") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "FileSchemaTestClass") public class FileSchemaTestClass { - public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - @JacksonXmlProperty(localName = "file") @XmlElement(name = "file") - private java.io.File file = null; + public static final String JSON_PROPERTY_FILE = "file"; + private java.io.File file; - public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) // Is a container wrapped=false // items.name=files items.baseName=files items.xmlName= items.xmlNamespace= // items.example= items.type=java.io.File @XmlElement(name = "files") - private List files = new ArrayList(); + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -58,15 +63,23 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -85,10 +98,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index e0328c647e82..6f26a929b9ef 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,96 +26,88 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) @XmlRootElement(name = "FormatTest") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "FormatTest") public class FormatTest { - public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) - @JacksonXmlProperty(localName = "integer") @XmlElement(name = "integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; private Integer integer; - public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) - @JacksonXmlProperty(localName = "int32") @XmlElement(name = "int32") + public static final String JSON_PROPERTY_INT32 = "int32"; private Integer int32; - public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) - @JacksonXmlProperty(localName = "int64") @XmlElement(name = "int64") + public static final String JSON_PROPERTY_INT64 = "int64"; private Long int64; - public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) - @JacksonXmlProperty(localName = "number") @XmlElement(name = "number") + public static final String JSON_PROPERTY_NUMBER = "number"; private BigDecimal number; - public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) - @JacksonXmlProperty(localName = "float") @XmlElement(name = "float") + public static final String JSON_PROPERTY_FLOAT = "float"; private Float _float; - public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JacksonXmlProperty(localName = "double") @XmlElement(name = "double") + public static final String JSON_PROPERTY_DOUBLE = "double"; private Double _double; - public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) - @JacksonXmlProperty(localName = "string") @XmlElement(name = "string") + public static final String JSON_PROPERTY_STRING = "string"; private String string; - public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) - @JacksonXmlProperty(localName = "byte") @XmlElement(name = "byte") + public static final String JSON_PROPERTY_BYTE = "byte"; private byte[] _byte; - public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) - @JacksonXmlProperty(localName = "binary") @XmlElement(name = "binary") + public static final String JSON_PROPERTY_BINARY = "binary"; private File binary; - public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) - @JacksonXmlProperty(localName = "date") @XmlElement(name = "date") + public static final String JSON_PROPERTY_DATE = "date"; private LocalDate date; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JacksonXmlProperty(localName = "dateTime") @XmlElement(name = "dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; private OffsetDateTime dateTime; - public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) - @JacksonXmlProperty(localName = "uuid") @XmlElement(name = "uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; private UUID uuid; - public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JacksonXmlProperty(localName = "password") @XmlElement(name = "password") + public static final String JSON_PROPERTY_PASSWORD = "password"; private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -127,15 +120,23 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -148,15 +149,23 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -167,15 +176,23 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -187,15 +204,23 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -208,15 +233,23 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -229,15 +262,23 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -248,15 +289,23 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -266,15 +315,23 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -285,15 +342,23 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -303,15 +368,23 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -322,15 +395,23 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -341,15 +422,23 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -359,10 +448,16 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index c02be2c3ddc3..b7770eed1bed 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,55 +15,71 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) @XmlRootElement(name = "HasOnlyReadOnly") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "HasOnlyReadOnly") public class HasOnlyReadOnly { - public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) - @JacksonXmlProperty(localName = "bar") @XmlElement(name = "bar") + public static final String JSON_PROPERTY_BAR = "bar"; private String bar; - public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) - @JacksonXmlProperty(localName = "foo") @XmlElement(name = "foo") + public static final String JSON_PROPERTY_FOO = "foo"; private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "foo") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 44b51846ea58..d309e855cfee 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,24 +24,30 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) @XmlRootElement(name = "MapTest") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "MapTest") public class MapTest { - public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Map<String, String> @XmlElement(name = "inner") - private Map> mapMapOfString = new HashMap>(); + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,31 +84,30 @@ public static InnerEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "inner") - private Map mapOfEnumString = new HashMap(); + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString = null; - public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Boolean @XmlElement(name = "inner") - private Map directMap = new HashMap(); + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap = null; - public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Boolean @XmlElement(name = "inner") - private Map indirectMap = new HashMap(); + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -120,15 +126,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -147,15 +160,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -174,15 +194,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -201,10 +228,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ff16a8c62bb2..94d3c51ce11b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,38 +27,41 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) @XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass") public class MixedPropertiesAndAdditionalPropertiesClass { - public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) - @JacksonXmlProperty(localName = "uuid") @XmlElement(name = "uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; private UUID uuid; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JacksonXmlProperty(localName = "dateTime") @XmlElement(name = "dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; private OffsetDateTime dateTime; - public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Animal @XmlElement(name = "inner") - private Map map = new HashMap(); + public static final String JSON_PROPERTY_MAP = "map"; + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -68,15 +72,23 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -87,15 +99,23 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -114,10 +134,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index 88715980d82a..255a2fe8c704 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; @@ -27,24 +29,26 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Name") public class Model200Response { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private Integer name; - public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JacksonXmlProperty(localName = "class") @XmlElement(name = "class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -55,15 +59,23 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -74,10 +86,16 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index a2997af04dc5..5b968f3aac8f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,41 +15,44 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ModelApiResponse") public class ModelApiResponse { - public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) - @JacksonXmlProperty(localName = "code") @XmlElement(name = "code") + public static final String JSON_PROPERTY_CODE = "code"; private Integer code; - public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) - @JacksonXmlProperty(localName = "type") @XmlElement(name = "type") + public static final String JSON_PROPERTY_TYPE = "type"; private String type; - public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JacksonXmlProperty(localName = "message") @XmlElement(name = "message") + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -60,15 +63,23 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -79,15 +90,23 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -98,10 +117,16 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index a56ca84199a1..20deeb9358df 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; @@ -27,18 +29,21 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) @XmlRootElement(name = "Return") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Return") public class ModelReturn { - public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) - @JacksonXmlProperty(localName = "return") @XmlElement(name = "return") + public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -49,10 +54,16 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index aacb62b4d593..5a9d2d180379 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; @@ -27,36 +29,36 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Name") public class Name { - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private Integer name; - public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) - @JacksonXmlProperty(localName = "snake_case") @XmlElement(name = "snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; private Integer snakeCase; - public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JacksonXmlProperty(localName = "property") @XmlElement(name = "property") + public static final String JSON_PROPERTY_PROPERTY = "property"; private String property; - public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) - @JacksonXmlProperty(localName = "123Number") @XmlElement(name = "123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -66,25 +68,40 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "snake_case") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -95,25 +112,38 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123Number") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index c2a3752b5d89..80346db3f821 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,30 +15,35 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) @XmlRootElement(name = "NumberOnly") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "NumberOnly") public class NumberOnly { - public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JacksonXmlProperty(localName = "JustNumber") @XmlElement(name = "JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -49,10 +54,16 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index 4a9e562d00cd..18ab19f96716 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -15,45 +15,47 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) @XmlRootElement(name = "Order") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Order") public class Order { - public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) - @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") + public static final String JSON_PROPERTY_ID = "id"; private Long id; - public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) - @JacksonXmlProperty(localName = "petId") @XmlElement(name = "petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; private Long petId; - public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JacksonXmlProperty(localName = "quantity") @XmlElement(name = "quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; private Integer quantity; - public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JacksonXmlProperty(localName = "shipDate") @XmlElement(name = "shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; private OffsetDateTime shipDate; /** @@ -93,19 +95,17 @@ public static StatusEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) - @JacksonXmlProperty(localName = "status") @XmlElement(name = "status") + public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; - public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JacksonXmlProperty(localName = "complete") @XmlElement(name = "complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -116,15 +116,23 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -135,15 +143,23 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -154,15 +170,23 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -173,15 +197,23 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -192,15 +224,23 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -211,10 +251,16 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index 1ee7b4357361..77f0ff1aba51 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,42 +15,45 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) @XmlRootElement(name = "OuterComposite") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "OuterComposite") public class OuterComposite { - public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JacksonXmlProperty(localName = "my_number") @XmlElement(name = "my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; private BigDecimal myNumber; - public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JacksonXmlProperty(localName = "my_string") @XmlElement(name = "my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; private String myString; - public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JacksonXmlProperty(localName = "my_boolean") @XmlElement(name = "my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -61,15 +64,23 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -80,15 +91,23 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -99,10 +118,16 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterEnum.java index abd0f0563632..a4222ad7ba03 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index de4747b11283..98bcda421faa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,56 +25,53 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Pet") public class Pet { - public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) - @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") + public static final String JSON_PROPERTY_ID = "id"; private Long id; - public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JacksonXmlProperty(localName = "category") @XmlElement(name = "category") - private Category category = null; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; - public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls") // Is a container wrapped=true // items.name=photoUrls items.baseName=photoUrls items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "photoUrls") @XmlElementWrapper(name = "photoUrl") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; private List photoUrls = new ArrayList(); - public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "tags") // Is a container wrapped=true // items.name=tags items.baseName=tags items.xmlName= items.xmlNamespace= // items.example= items.type=Tag @XmlElement(name = "tags") @XmlElementWrapper(name = "tag") - private List tags = new ArrayList(); + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; /** * pet status in the store @@ -112,13 +110,13 @@ public static StatusEnum fromValue(String value) { } } - public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) - @JacksonXmlProperty(localName = "status") @XmlElement(name = "status") + public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -129,15 +127,23 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -148,15 +154,23 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "category") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -166,15 +180,23 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -189,15 +211,24 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + // items.xmlName= + @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -216,15 +247,24 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + // items.xmlName= + @JacksonXmlElementWrapper(useWrapping = true, localName = "tags") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -235,10 +275,16 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 95c3b1a60220..6b9493b2284a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,45 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) @XmlRootElement(name = "ReadOnlyFirst") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ReadOnlyFirst") public class ReadOnlyFirst { - public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) - @JacksonXmlProperty(localName = "bar") @XmlElement(name = "bar") + public static final String JSON_PROPERTY_BAR = "bar"; private String bar; - public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) - @JacksonXmlProperty(localName = "baz") @XmlElement(name = "baz") + public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -64,10 +75,16 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index 02bf80764c96..8c48493002e8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,29 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) @XmlRootElement(name = "$special[model.name]") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "$special[model.name]") public class SpecialModelName { - public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JacksonXmlProperty(localName = "$special[property.name]") @XmlElement(name = "$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -48,10 +53,16 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index 6942e79d6f1f..376ac030ed6f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -15,35 +15,39 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) @XmlRootElement(name = "Tag") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Tag") public class Tag { - public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) - @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") + public static final String JSON_PROPERTY_ID = "id"; private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) - @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -54,15 +58,23 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -73,10 +85,16 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9012547ae0f3..74894489c00c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,50 +24,51 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) @XmlRootElement(name = "TypeHolderDefault") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "TypeHolderDefault") public class TypeHolderDefault { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JacksonXmlProperty(localName = "string_item") @XmlElement(name = "string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; private String stringItem = "what"; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JacksonXmlProperty(localName = "number_item") @XmlElement(name = "number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; private BigDecimal numberItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JacksonXmlProperty(localName = "integer_item") @XmlElement(name = "integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JacksonXmlProperty(localName = "bool_item") @XmlElement(name = "bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; private Boolean boolItem = true; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) // Is a container wrapped=false // items.name=arrayItem items.baseName=arrayItem items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "arrayItem") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -76,15 +78,23 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "string_item") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -94,15 +104,23 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number_item") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -112,15 +130,23 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "integer_item") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -130,15 +156,23 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "bool_item") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -153,10 +187,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 86b51dbe04ce..7508b3fe96ad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,50 +24,56 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) @XmlRootElement(name = "TypeHolderExample") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "TypeHolderExample") public class TypeHolderExample { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JacksonXmlProperty(localName = "string_item") @XmlElement(name = "string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; private String stringItem; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JacksonXmlProperty(localName = "number_item") @XmlElement(name = "number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; private BigDecimal numberItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JacksonXmlProperty(localName = "integer_item") + @XmlElement(name = "float_item") + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + @XmlElement(name = "integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JacksonXmlProperty(localName = "bool_item") @XmlElement(name = "bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; private Boolean boolItem; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) // Is a container wrapped=false // items.name=arrayItem items.baseName=arrayItem items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "arrayItem") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -76,15 +83,23 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "string_item") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -94,15 +109,49 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number_item") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "float_item") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -112,15 +161,23 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "integer_item") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -130,15 +187,23 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "bool_item") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -153,10 +218,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -173,6 +243,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -180,7 +251,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -190,6 +261,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index cabbb31fe80f..6bd7b43bc9d1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -15,71 +15,69 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) @XmlRootElement(name = "User") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "User") public class User { - public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) - @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") + public static final String JSON_PROPERTY_ID = "id"; private Long id; - public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) - @JacksonXmlProperty(localName = "username") @XmlElement(name = "username") + public static final String JSON_PROPERTY_USERNAME = "username"; private String username; - public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JacksonXmlProperty(localName = "firstName") @XmlElement(name = "firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; - public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JacksonXmlProperty(localName = "lastName") @XmlElement(name = "lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; - public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) - @JacksonXmlProperty(localName = "email") @XmlElement(name = "email") + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; - public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JacksonXmlProperty(localName = "password") @XmlElement(name = "password") + public static final String JSON_PROPERTY_PASSWORD = "password"; private String password; - public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) - @JacksonXmlProperty(localName = "phone") @XmlElement(name = "phone") + public static final String JSON_PROPERTY_PHONE = "phone"; private String phone; - public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JacksonXmlProperty(localName = "userStatus") @XmlElement(name = "userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -90,15 +88,23 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -109,15 +115,23 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -128,15 +142,23 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -147,15 +169,23 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -166,15 +196,23 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -185,15 +223,23 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -204,15 +250,23 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -223,10 +277,16 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index 1276bde52876..37e961474be9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,225 +24,200 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) @XmlRootElement(namespace="http://a.com/schema", name = "XmlItem") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(namespace="http://a.com/schema", localName = "XmlItem") public class XmlItem { - public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JacksonXmlProperty(isAttribute = true, localName = "attribute_string") @XmlAttribute(name = "attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; private String attributeString; - public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JacksonXmlProperty(isAttribute = true, localName = "attribute_number") @XmlAttribute(name = "attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; private BigDecimal attributeNumber; - public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JacksonXmlProperty(isAttribute = true, localName = "attribute_integer") @XmlAttribute(name = "attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; private Integer attributeInteger; - public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JacksonXmlProperty(isAttribute = true, localName = "attribute_boolean") @XmlAttribute(name = "attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; private Boolean attributeBoolean; - public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "wrappedArray") // Is a container wrapped=true // items.name=wrappedArray items.baseName=wrappedArray items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "wrappedArray") @XmlElementWrapper(name = "wrapped_array") - private List wrappedArray = new ArrayList(); + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + private List wrappedArray = null; - public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JacksonXmlProperty(localName = "xml_name_string") @XmlElement(name = "xml_name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; - public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JacksonXmlProperty(localName = "xml_name_number") @XmlElement(name = "xml_name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; private BigDecimal nameNumber; - public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JacksonXmlProperty(localName = "xml_name_integer") @XmlElement(name = "xml_name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; private Integer nameInteger; - public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JacksonXmlProperty(localName = "xml_name_boolean") @XmlElement(name = "xml_name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; private Boolean nameBoolean; - public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) // Is a container wrapped=false // items.name=nameArray items.baseName=nameArray items.xmlName=xml_name_array_item items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "xml_name_array_item") - private List nameArray = new ArrayList(); + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + private List nameArray = null; - public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - // items.xmlName=xml_name_wrapped_array_item - @JacksonXmlElementWrapper(useWrapping = true, localName = "xml_name_wrapped_array_item") // Is a container wrapped=true // items.name=nameWrappedArray items.baseName=nameWrappedArray items.xmlName=xml_name_wrapped_array_item items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "xml_name_wrapped_array_item") @XmlElementWrapper(name = "xml_name_wrapped_array") - private List nameWrappedArray = new ArrayList(); + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + private List nameWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JacksonXmlProperty(localName = "prefix_string") @XmlElement(name = "prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; - public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JacksonXmlProperty(localName = "prefix_number") @XmlElement(name = "prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; private BigDecimal prefixNumber; - public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JacksonXmlProperty(localName = "prefix_integer") @XmlElement(name = "prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; private Integer prefixInteger; - public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JacksonXmlProperty(localName = "prefix_boolean") @XmlElement(name = "prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; private Boolean prefixBoolean; - public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) // Is a container wrapped=false // items.name=prefixArray items.baseName=prefixArray items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "prefixArray") - private List prefixArray = new ArrayList(); + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + private List prefixArray = null; - public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "prefixWrappedArray") // Is a container wrapped=true // items.name=prefixWrappedArray items.baseName=prefixWrappedArray items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "prefixWrappedArray") @XmlElementWrapper(name = "prefix_wrapped_array") - private List prefixWrappedArray = new ArrayList(); + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + private List prefixWrappedArray = null; - public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JacksonXmlProperty(namespace="http://a.com/schema", localName = "namespace_string") @XmlElement(namespace="http://a.com/schema", name = "namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; - public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JacksonXmlProperty(namespace="http://b.com/schema", localName = "namespace_number") @XmlElement(namespace="http://b.com/schema", name = "namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; private BigDecimal namespaceNumber; - public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JacksonXmlProperty(namespace="http://c.com/schema", localName = "namespace_integer") @XmlElement(namespace="http://c.com/schema", name = "namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; private Integer namespaceInteger; - public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JacksonXmlProperty(namespace="http://d.com/schema", localName = "namespace_boolean") @XmlElement(namespace="http://d.com/schema", name = "namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; private Boolean namespaceBoolean; - public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) // Is a container wrapped=false // items.name=namespaceArray items.baseName=namespaceArray items.xmlName= items.xmlNamespace=http://e.com/schema // items.example= items.type=Integer @XmlElement(namespace="http://e.com/schema", name = "namespaceArray") - private List namespaceArray = new ArrayList(); + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + private List namespaceArray = null; - public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, namespace="http://f.com/schema", localName = "namespaceWrappedArray") // Is a container wrapped=true // items.name=namespaceWrappedArray items.baseName=namespaceWrappedArray items.xmlName= items.xmlNamespace=http://g.com/schema // items.example= items.type=Integer @XmlElement(namespace="http://g.com/schema", name = "namespaceWrappedArray") @XmlElementWrapper(namespace="http://f.com/schema", name = "namespace_wrapped_array") - private List namespaceWrappedArray = new ArrayList(); + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + private List namespaceWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JacksonXmlProperty(namespace="http://a.com/schema", localName = "prefix_ns_string") @XmlElement(namespace="http://a.com/schema", name = "prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; - public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JacksonXmlProperty(namespace="http://b.com/schema", localName = "prefix_ns_number") @XmlElement(namespace="http://b.com/schema", name = "prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; private BigDecimal prefixNsNumber; - public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JacksonXmlProperty(namespace="http://c.com/schema", localName = "prefix_ns_integer") @XmlElement(namespace="http://c.com/schema", name = "prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; private Integer prefixNsInteger; - public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JacksonXmlProperty(namespace="http://d.com/schema", localName = "prefix_ns_boolean") @XmlElement(namespace="http://d.com/schema", name = "prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; private Boolean prefixNsBoolean; - public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) // Is a container wrapped=false // items.name=prefixNsArray items.baseName=prefixNsArray items.xmlName= items.xmlNamespace=http://e.com/schema // items.example= items.type=Integer @XmlElement(namespace="http://e.com/schema", name = "prefixNsArray") - private List prefixNsArray = new ArrayList(); + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + private List prefixNsArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, namespace="http://f.com/schema", localName = "prefixNsWrappedArray") // Is a container wrapped=true // items.name=prefixNsWrappedArray items.baseName=prefixNsWrappedArray items.xmlName= items.xmlNamespace=http://g.com/schema // items.example= items.type=Integer @XmlElement(namespace="http://g.com/schema", name = "prefixNsWrappedArray") @XmlElementWrapper(namespace="http://f.com/schema", name = "prefix_ns_wrapped_array") - private List prefixNsWrappedArray = new ArrayList(); + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -252,15 +228,23 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(isAttribute = true, localName = "attribute_string") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -271,15 +255,23 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(isAttribute = true, localName = "attribute_number") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -290,15 +282,23 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(isAttribute = true, localName = "attribute_integer") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -309,15 +309,23 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(isAttribute = true, localName = "attribute_boolean") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -336,15 +344,24 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + // items.xmlName= + @JacksonXmlElementWrapper(useWrapping = true, localName = "wrappedArray") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -355,15 +372,23 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_string") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -374,15 +399,23 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_number") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -393,15 +426,23 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_integer") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -412,15 +453,23 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_boolean") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -439,15 +488,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -466,15 +522,24 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + // items.xmlName=xml_name_wrapped_array_item + @JacksonXmlElementWrapper(useWrapping = true, localName = "xml_name_wrapped_array_item") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -485,15 +550,23 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_string") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -504,15 +577,23 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_number") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -523,15 +604,23 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_integer") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -542,15 +631,23 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_boolean") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -569,15 +666,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -596,15 +700,24 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + // items.xmlName= + @JacksonXmlElementWrapper(useWrapping = true, localName = "prefixWrappedArray") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -615,15 +728,23 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://a.com/schema", localName = "namespace_string") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -634,15 +755,23 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://b.com/schema", localName = "namespace_number") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -653,15 +782,23 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://c.com/schema", localName = "namespace_integer") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -672,15 +809,23 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://d.com/schema", localName = "namespace_boolean") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -699,15 +844,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -726,15 +878,24 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + // items.xmlName= + @JacksonXmlElementWrapper(useWrapping = true, namespace="http://f.com/schema", localName = "namespaceWrappedArray") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -745,15 +906,23 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://a.com/schema", localName = "prefix_ns_string") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -764,15 +933,23 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://b.com/schema", localName = "prefix_ns_number") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -783,15 +960,23 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://c.com/schema", localName = "prefix_ns_integer") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -802,15 +987,23 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(namespace="http://d.com/schema", localName = "prefix_ns_boolean") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -829,15 +1022,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -856,10 +1056,17 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + // items.xmlName= + @JacksonXmlElementWrapper(useWrapping = true, namespace="http://f.com/schema", localName = "prefixNsWrappedArray") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.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/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index 9aa0a46fccf3..6081aaded211 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -96,8 +96,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" junit_version = "4.12" @@ -112,6 +113,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/resttemplate/docs/TypeHolderExample.md b/samples/client/petstore/java/resttemplate/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/resttemplate/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/resttemplate/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/resttemplate/docs/UserApi.md b/samples/client/petstore/java/resttemplate/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/resttemplate/docs/UserApi.md +++ b/samples/client/petstore/java/resttemplate/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/resttemplate/git_push.sh b/samples/client/petstore/java/resttemplate/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/resttemplate/git_push.sh +++ b/samples/client/petstore/java/resttemplate/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index 3f6172a6765c..314fb7f6a7c1 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -235,6 +235,11 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.github.joschi.jackson @@ -256,6 +261,7 @@ 4.3.9.RELEASE 2.9.9 2.9.9 + 0.2.0 2.6.4 1.0.0 4.12 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 c49d73bcfb06..264ea075d190 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 @@ -29,6 +29,7 @@ import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import java.io.BufferedReader; import java.io.IOException; @@ -649,6 +650,7 @@ protected RestTemplate buildRestTemplate() { module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper.registerModule(module); + mapper.registerModule(new JsonNullableModule()); } } // This allows us to read the response more than once - Necessary for debugging. 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 4981d7ea3a8a..8b7f1118e5f7 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 @@ -589,4 +589,65 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + Object postBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + String path = apiClient.expandPath("/fake/test-query-paramters", Collections.emptyMap()); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + 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)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cf0854acd006..e0e0ddfb64bd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3dd85a61ea4..b3641265ed92 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae01f1581a3..7ba8a580f15e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index f5968901765a..cd0082b7af00 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index 10b3d3587621..988c7335eb00 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5ce9290bba2e..0854831ce8a7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index 509048cd5e97..4c62aed5282f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 0a57199a7140..2fee3e90d049 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index df68b7d41884..e59e697be723 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index 0d6bc154e463..dabd18a06a1d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index b907822ed01e..e9213a2052c8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0961f776fb02..c9bb8bcebec9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 3617c5c16b2d..32a4d8bb6e4a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index 151939d60542..75b1edce8d9a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit/.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/client/petstore/java/retrofit/git_push.sh b/samples/client/petstore/java/retrofit/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit/git_push.sh +++ b/samples/client/petstore/java/retrofit/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java index 402f5c7c7931..2283c382cc37 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 279f91bb9a90..e258826a9aac 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -394,4 +394,36 @@ Void testJsonFormData( void testJsonFormData( @retrofit.http.Field("param") String param, @retrofit.http.Field("param2") String param2, Callback cb ); + /** + * + * Sync method + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Void + */ + + @PUT("/fake/test-query-paramters") + Void testQueryParameterCollectionFormat( + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + ); + + /** + * + * Async method + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param cb callback method + */ + + @PUT("/fake/test-query-paramters") + void testQueryParameterCollectionFormat( + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 6639252ccb33..13e761a8d9c0 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c3f2ca0a464..17e320b0a953 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7c4a5248c073..8a51fa9f778d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b016f1f3778f..a4a797bb487c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,49 +35,51 @@ public class AdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -96,15 +98,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +130,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +162,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +194,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -204,15 +226,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -231,15 +258,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -258,15 +290,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -285,15 +322,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -304,15 +346,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -323,15 +370,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -342,10 +394,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 10df3df74c74..4f2e3ef333e9 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 33719cab2611..80ce73d422b5 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e37e04b01a6d..bc5cc81bf64e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfbf74f5b328..2e9c0c7ffd9f 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java index 0a02419dbf16..dd6b313c58cd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,9 @@ public class Animal { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +53,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +77,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 4f016503d471..1af52a3a988d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 15d27a21f287..eba8d40a2893 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayTest.java index 7f6d476044d4..7ba0d8b77e0d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,17 +34,19 @@ public class ArrayTest { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -63,15 +65,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +97,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -117,10 +129,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Capitalization.java index ef40fe949fdf..dc70cf2b5975 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,7 +53,9 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -64,15 +66,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -83,15 +90,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -102,15 +114,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -121,15 +138,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -140,15 +162,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -159,10 +186,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Cat.java index c600502f716f..8829c547501d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,9 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -46,10 +48,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/CatAllOf.java index 29b3658551eb..d20d19aa53f7 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,9 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -44,10 +46,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Category.java index 1968763722dc..f335f0b5217d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Category.java @@ -37,7 +37,9 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +73,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ClassModel.java index 52245d70502d..83c30b802d49 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,9 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -45,10 +47,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Client.java index e5ece3536d60..192c0ce6e5b6 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,9 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -44,10 +46,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Dog.java index d877eb2f3706..2f8a4652247c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,9 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -46,10 +48,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/DogAllOf.java index 54483f2227d1..96610291473f 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,9 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -44,10 +46,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumArrays.java index a5aba01d533d..bbb97598ea37 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -72,7 +72,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -123,7 +123,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -131,9 +131,11 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -144,15 +146,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -171,10 +178,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumTest.java index 679584204fb5..c08e4f6239de 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/EnumTest.java @@ -73,7 +73,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -126,7 +126,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -228,7 +228,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -242,7 +242,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -253,15 +255,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -271,15 +278,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -290,15 +302,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -309,15 +326,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -328,10 +350,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 181141b92dc4..45ce4347b2dd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,13 +33,15 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +52,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -77,10 +84,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FormatTest.java index 71556d37db1f..271e7db17b69 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/FormatTest.java @@ -86,7 +86,9 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -99,15 +101,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -120,15 +127,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -139,15 +151,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -159,15 +176,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -180,15 +202,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -201,15 +228,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -220,15 +252,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -238,15 +275,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -257,15 +299,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -275,15 +322,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(DateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -294,15 +346,20 @@ public FormatTest dateTime(DateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public DateTime getDateTime() { return dateTime; } + + public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -313,15 +370,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -331,10 +393,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 02225d278c47..8fcb26846436 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,27 +37,35 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java index 329cb4c87b8d..b19863fb9931 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,7 +77,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -85,17 +85,19 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -114,15 +116,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -141,15 +148,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -168,15 +180,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -195,10 +212,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index dd905fbaedcf..a9a390d1ffcd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,9 +45,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +60,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -77,15 +84,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public DateTime getDateTime() { return dateTime; } + + public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -104,10 +116,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Model200Response.java index 3167560a9dd0..42a61d0d8776 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,7 +38,9 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -49,15 +51,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -68,10 +75,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84d2fcc4d396..db323b17602a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,7 +41,9 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -52,15 +54,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -71,15 +78,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -90,10 +102,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelReturn.java index c13f1babe599..da9f1a20259d 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,7 +34,9 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -45,10 +47,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Name.java index 221821d4e191..f775f97b3f19 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Name.java @@ -46,7 +46,9 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +58,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +96,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a068c2e1ee6..1a7bd689645f 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,9 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +47,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Order.java index e79f32372044..dd421bef11d7 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Order.java @@ -89,7 +89,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -103,7 +103,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -114,15 +116,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -133,15 +140,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -152,15 +164,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(DateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -171,15 +188,20 @@ public Order shipDate(DateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public DateTime getShipDate() { return shipDate; } + + public void setShipDate(DateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -190,15 +212,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -209,10 +236,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java index 690b6bde4be1..3db0e2e26c9a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,7 +42,9 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +55,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +79,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +103,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java index 59fe8406f43d..643184ae4fc1 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -51,7 +51,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -96,7 +96,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -106,7 +106,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -117,15 +119,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -136,15 +143,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -154,15 +166,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -177,15 +194,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -204,15 +226,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -223,10 +250,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 84780d763a0d..2501babb56ea 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,17 +37,23 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -58,10 +64,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/SpecialModelName.java index c6ccd2c33f6a..4ff598a6cfca 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,9 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -44,10 +46,13 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Tag.java index 504c51cc3e59..693247a2fd27 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Tag.java @@ -37,7 +37,9 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -67,10 +74,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8fc321bc0a20..e61b1492abc2 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,7 +52,9 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +64,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +87,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +110,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +133,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +161,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d9496cbd7902..bf0f4550ccbf 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,10 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -52,7 +56,9 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +91,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +137,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +160,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +188,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -159,6 +211,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -166,7 +219,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -176,6 +229,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/User.java index 1aedd044b588..3760c07c5927 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/User.java @@ -61,7 +61,9 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -72,15 +74,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -91,15 +98,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -110,15 +122,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -129,15 +146,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -148,15 +170,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -167,15 +194,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -186,15 +218,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -205,10 +242,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/XmlItem.java index ea15cdba33cf..4fce3d5e1c05 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/XmlItem.java @@ -50,7 +50,7 @@ public class XmlItem { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -70,11 +70,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -94,11 +94,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -118,11 +118,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -142,13 +142,15 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -159,15 +161,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +185,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +209,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +233,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +265,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +289,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -281,15 +313,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -300,15 +337,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -319,15 +361,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -346,15 +393,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -373,15 +425,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -392,15 +449,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -411,15 +473,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -430,15 +497,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -449,15 +521,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -476,15 +553,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -503,15 +585,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -522,15 +609,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -541,15 +633,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -560,15 +657,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -579,15 +681,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -606,15 +713,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -633,15 +745,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -652,15 +769,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -671,15 +793,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -690,15 +817,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -709,15 +841,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -736,15 +873,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -763,10 +905,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.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/client/petstore/java/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 1766fa5b3a76..663a8a3475c0 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -119,6 +119,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md index 29d71d3620d5..24e2d7f5be24 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/TypeHolderExample.md b/samples/client/petstore/java/retrofit2-play24/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md index bdf473df90dc..d03e871ce01b 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2-play24/git_push.sh b/samples/client/petstore/java/retrofit2-play24/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit2-play24/git_push.sh +++ b/samples/client/petstore/java/retrofit2-play24/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 6a8a48bd5a6e..329612aa1920 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -259,6 +259,11 @@ play-java-ws_2.11 ${play-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + junit @@ -274,9 +279,10 @@ ${java.version} 1.8.3 1.5.22 - 2.9.9 + 2.9.10 2.6.6 2.4.11 + 0.2.0 2.5.0 1.0.1 4.12 diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/ApiClient.java index 1ba1e8f024cd..e4637e68ec41 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/ApiClient.java @@ -8,6 +8,8 @@ import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import play.libs.Json; import play.libs.ws.WSClient; @@ -68,10 +70,14 @@ public S createService(Class serviceClass) { auth.applyToParams(extraQueryParams, extraHeaders); } + ObjectMapper mapper = Json.mapper(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return new Retrofit.Builder() .baseUrl(basePath) .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(JacksonConverterFactory.create(Json.mapper())) + .addConverterFactory(JacksonConverterFactory.create(mapper)) .callFactory(new Play24CallFactory(wsClient, extraHeaders, extraQueryParams)) .addCallAdapterFactory(new Play24CallAdapterFactory()) .build() diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd936..20cbb0e7d6af 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index 158a7b060023..ead81434c62b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -218,4 +218,19 @@ F.Promise> testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + F.Promise> testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index fccdfd9063b7..29ab38c51b9e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index ca93793eb928..a9e1f16e7006 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -46,10 +52,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index bcc0c1468af1..ec4f41db5911 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8c80863eaa50..91f163f405ff 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,59 +25,64 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -95,15 +101,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +136,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +170,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +204,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -205,15 +239,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -233,15 +274,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -261,15 +309,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -289,15 +344,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -309,15 +371,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -329,15 +398,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -349,10 +425,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 9df2c41186a5..9a8e56b6b81a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 9a86f4a655d1..660ca6a43131 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -46,10 +52,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index d7e32f25cbe9..9f24f09077b8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 600622d7cabe..3978179bcf5d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java index a43ceea70647..63f1aa5dec93 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,12 +23,17 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -37,14 +43,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -55,15 +61,22 @@ public Animal className(String className) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -74,10 +87,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 07c2946dda33..483ba916ed5a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +61,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 365c359b845a..8753a7a89371 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +61,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c9ab40620c7..4df2dd311458 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,27 +24,32 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -62,15 +68,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +103,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -118,10 +138,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java index 65f5b799d252..065d28841ca9 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,44 +15,50 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -63,15 +69,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -82,15 +95,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -101,15 +121,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -120,15 +147,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -139,15 +173,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -158,10 +199,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java index d0e872ebd73e..8e87cb645ba3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -45,10 +51,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java index e72f96cee937..30d9d8f49615 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java index 4f388371ed58..60ea5045dbce 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java @@ -15,28 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -47,15 +53,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +79,15 @@ public Category name(String name) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java index b7b9081f44a5..012b0c20c5bb 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,13 +29,17 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -44,10 +50,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java index b0ae0657c799..0e55d62d5139 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -43,10 +49,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java index d9656d309a79..7d277b961a64 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -45,10 +51,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java index 500f5a63d0e8..3c6d99afb75a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java index 1711a75939af..8b046bd53c38 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,12 +23,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -66,7 +72,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -105,10 +110,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -119,15 +125,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -146,10 +159,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumClass.java index 658c48b7f623..d78b71854be4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java index 7148143b17d4..8bac5511683d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,18 +15,27 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -67,7 +76,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -108,7 +116,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -147,7 +154,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -186,14 +192,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -204,15 +210,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -223,15 +236,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -242,15 +262,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -261,15 +288,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -281,10 +315,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4b53c0068d53..98648e87cf25 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +56,22 @@ public FileSchemaTestClass file(java.io.File file) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -78,10 +91,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java index 28f3431520a3..4b4c4b0f7ad4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,67 +26,72 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -98,15 +104,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -119,15 +132,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -138,15 +158,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -160,15 +187,22 @@ public FormatTest number(BigDecimal number) { @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -181,15 +215,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -202,15 +243,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -221,15 +269,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -240,15 +295,22 @@ public FormatTest _byte(byte[] _byte) { **/ @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -260,15 +322,22 @@ public FormatTest binary(File binary) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -280,15 +349,22 @@ public FormatTest date(LocalDate date) { @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -300,15 +376,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -320,15 +403,22 @@ public FormatTest uuid(UUID uuid) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -339,10 +429,15 @@ public FormatTest password(String password) { **/ @NotNull @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f2175b7f513d..81e823b2fe8a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,48 +15,64 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java index 5b93accce61c..891bed365c49 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,23 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -71,18 +78,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -102,15 +108,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -129,15 +142,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -156,15 +176,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -183,10 +210,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7b2418c3fd87..b74ccaa2dd34 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,27 +27,32 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +64,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -78,15 +91,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -106,10 +126,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java index 8de17e10609a..5d57eb6e2516 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,17 +29,21 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -48,15 +54,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -67,10 +80,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 874cba97c69d..ec257a9e3c73 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -51,15 +57,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -70,15 +83,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -89,10 +109,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java index e606f768eb98..3bf61282d0db 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,13 +29,17 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -44,10 +50,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java index 9dfdb681267d..1cc42f664e45 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,25 +29,29 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +62,38 @@ public Name name(Integer name) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +104,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java index 7f083e23a3de..17217c202ce5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,25 +15,31 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +51,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java index 2c967b372749..6305ac84c009 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java @@ -15,34 +15,40 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -83,14 +89,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -101,15 +107,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -120,15 +133,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -139,15 +159,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -159,15 +186,22 @@ public Order shipDate(OffsetDateTime shipDate) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -178,15 +212,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -197,10 +238,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java index 17e6de1f014e..0b0917bcef61 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,33 +15,39 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +59,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +85,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +111,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterEnum.java index cde04c1aea85..5591f09ff23f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java index f5a50b7f8139..1dcd2fee24af 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,33 +25,37 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -90,10 +95,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -104,15 +110,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -124,15 +137,22 @@ public Pet category(Category category) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -143,15 +163,22 @@ public Pet name(String name) { **/ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -167,15 +194,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -195,15 +229,22 @@ public Pet addTagsItem(Tag tagsItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -214,10 +255,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 61b2e2debfde..3e4b5ee55df7 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,38 +15,50 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -57,10 +69,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java index 65fabe673de0..2ef7431f0bca 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -43,10 +49,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java index 42f80f36b72a..e2153173c05c 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java @@ -15,28 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -47,15 +53,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -66,10 +79,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0468a2364b18..4660869ef5b4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,35 +24,40 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,22 @@ public TypeHolderDefault stringItem(String stringItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -82,15 +95,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -101,15 +121,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +147,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -144,10 +178,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2912e8d03e37..dba5a5d25aa1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,35 +24,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +72,22 @@ public TypeHolderExample stringItem(String stringItem) { **/ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -82,15 +99,48 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -101,15 +151,22 @@ public TypeHolderExample integerItem(Integer integerItem) { **/ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +177,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { **/ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -144,10 +208,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { **/ @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -164,6 +233,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -171,7 +241,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -181,6 +251,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java index ebfc17610252..f46df9c9a933 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java @@ -15,52 +15,58 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -71,15 +77,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -90,15 +103,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -109,15 +129,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -128,15 +155,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -147,15 +181,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -166,15 +207,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -185,15 +233,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -204,10 +259,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java index 452a0b3c01aa..98f99c4a5140 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,131 +24,136 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -158,15 +164,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +191,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +217,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +243,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +277,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +303,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -282,15 +330,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -301,15 +356,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -320,15 +382,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -347,15 +416,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -374,15 +450,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -393,15 +476,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -413,15 +503,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -432,15 +529,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -451,15 +555,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -478,15 +589,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -505,15 +623,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -524,15 +649,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -544,15 +676,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -563,15 +702,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -582,15 +728,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -609,15 +762,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -636,15 +796,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -655,15 +822,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -675,15 +849,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -694,15 +875,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -713,15 +901,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -740,15 +935,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -767,10 +969,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.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/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index 1c6b07aa86de..6070a723366e 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -97,7 +97,7 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_version = "2.9.9" + jackson_version = "2.9.10" play_version = "2.5.14" swagger_annotations_version = "1.5.22" junit_version = "4.12" @@ -121,6 +121,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index e0ba78560f95..0dd2611317c4 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.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/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md index 29d71d3620d5..24e2d7f5be24 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/TypeHolderExample.md b/samples/client/petstore/java/retrofit2-play25/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md index bdf473df90dc..d03e871ce01b 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2-play25/git_push.sh b/samples/client/petstore/java/retrofit2-play25/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit2-play25/git_push.sh +++ b/samples/client/petstore/java/retrofit2-play25/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index e82fe6f2b111..7c072f8bd553 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -264,6 +264,11 @@ play-java-ws_2.11 ${play-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + junit @@ -279,9 +284,10 @@ ${java.version} 1.8.3 1.5.22 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 2.5.15 + 0.2.0 2.5.0 1.3.8 1.0.1 diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/ApiClient.java index a5776c695f9f..13dfce951a2d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/ApiClient.java @@ -8,6 +8,8 @@ import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import play.libs.Json; import play.libs.ws.WSClient; @@ -68,10 +70,14 @@ public S createService(Class serviceClass) { auth.applyToParams(extraQueryParams, extraHeaders); } + ObjectMapper mapper = Json.mapper(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return new Retrofit.Builder() .baseUrl(basePath) .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(JacksonConverterFactory.create(Json.mapper())) + .addConverterFactory(JacksonConverterFactory.create(mapper)) .callFactory(new Play25CallFactory(wsClient, extraHeaders, extraQueryParams)) .addCallAdapterFactory(new Play25CallAdapterFactory()) .build() diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd936..20cbb0e7d6af 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index 12e091d78eea..101757f03d0e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -218,4 +218,19 @@ CompletionStage> testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + CompletionStage> testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index fccdfd9063b7..29ab38c51b9e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index ca93793eb928..a9e1f16e7006 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -46,10 +52,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index bcc0c1468af1..ec4f41db5911 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8c80863eaa50..91f163f405ff 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,59 +25,64 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -95,15 +101,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +136,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +170,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +204,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -205,15 +239,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -233,15 +274,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -261,15 +309,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -289,15 +344,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -309,15 +371,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -329,15 +398,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -349,10 +425,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 9df2c41186a5..9a8e56b6b81a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 9a86f4a655d1..660ca6a43131 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -46,10 +52,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index d7e32f25cbe9..9f24f09077b8 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 600622d7cabe..3978179bcf5d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java index a43ceea70647..63f1aa5dec93 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,12 +23,17 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -37,14 +43,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -55,15 +61,22 @@ public Animal className(String className) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -74,10 +87,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 07c2946dda33..483ba916ed5a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +61,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 365c359b845a..8753a7a89371 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +61,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c9ab40620c7..4df2dd311458 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,27 +24,32 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -62,15 +68,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +103,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -118,10 +138,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java index 65f5b799d252..065d28841ca9 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,44 +15,50 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -63,15 +69,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -82,15 +95,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -101,15 +121,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -120,15 +147,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -139,15 +173,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -158,10 +199,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java index d0e872ebd73e..8e87cb645ba3 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -45,10 +51,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java index e72f96cee937..30d9d8f49615 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java index 4f388371ed58..60ea5045dbce 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java @@ -15,28 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -47,15 +53,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +79,15 @@ public Category name(String name) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java index b7b9081f44a5..012b0c20c5bb 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,13 +29,17 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -44,10 +50,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java index b0ae0657c799..0e55d62d5139 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -43,10 +49,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java index d9656d309a79..7d277b961a64 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -45,10 +51,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java index 500f5a63d0e8..3c6d99afb75a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java index 1711a75939af..8b046bd53c38 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,12 +23,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -66,7 +72,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -105,10 +110,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -119,15 +125,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -146,10 +159,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumClass.java index 658c48b7f623..d78b71854be4 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java index 7148143b17d4..8bac5511683d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,18 +15,27 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -67,7 +76,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -108,7 +116,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -147,7 +154,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -186,14 +192,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -204,15 +210,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -223,15 +236,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -242,15 +262,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -261,15 +288,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -281,10 +315,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4b53c0068d53..98648e87cf25 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +56,22 @@ public FileSchemaTestClass file(java.io.File file) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -78,10 +91,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java index f9637c522272..f91b09215d97 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,67 +26,72 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -98,15 +104,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -119,15 +132,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -138,15 +158,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -160,15 +187,22 @@ public FormatTest number(BigDecimal number) { @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -181,15 +215,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -202,15 +243,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -221,15 +269,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -240,15 +295,22 @@ public FormatTest _byte(byte[] _byte) { **/ @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -260,15 +322,22 @@ public FormatTest binary(File binary) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -280,15 +349,22 @@ public FormatTest date(LocalDate date) { @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -300,15 +376,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -320,15 +403,22 @@ public FormatTest uuid(UUID uuid) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -339,10 +429,15 @@ public FormatTest password(String password) { **/ @NotNull @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f2175b7f513d..81e823b2fe8a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,48 +15,64 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java index 5b93accce61c..891bed365c49 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,23 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -71,18 +78,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -102,15 +108,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -129,15 +142,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -156,15 +176,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -183,10 +210,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7d93a45c45f7..e0930dc40110 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,27 +27,32 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +64,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -78,15 +91,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -106,10 +126,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java index 8de17e10609a..5d57eb6e2516 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,17 +29,21 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -48,15 +54,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -67,10 +80,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 874cba97c69d..ec257a9e3c73 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -51,15 +57,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -70,15 +83,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -89,10 +109,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java index e606f768eb98..3bf61282d0db 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,13 +29,17 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -44,10 +50,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java index 9dfdb681267d..1cc42f664e45 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,25 +29,29 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +62,38 @@ public Name name(Integer name) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +104,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java index 7f083e23a3de..17217c202ce5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,25 +15,31 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +51,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java index b5aaf42748ae..3554e9b139be 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java @@ -15,34 +15,40 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -83,14 +89,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -101,15 +107,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -120,15 +133,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -139,15 +159,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -159,15 +186,22 @@ public Order shipDate(OffsetDateTime shipDate) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -178,15 +212,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -197,10 +238,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java index 17e6de1f014e..0b0917bcef61 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,33 +15,39 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +59,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +85,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +111,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterEnum.java index cde04c1aea85..5591f09ff23f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java index f5a50b7f8139..1dcd2fee24af 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,33 +25,37 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -90,10 +95,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -104,15 +110,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -124,15 +137,22 @@ public Pet category(Category category) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -143,15 +163,22 @@ public Pet name(String name) { **/ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -167,15 +194,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -195,15 +229,22 @@ public Pet addTagsItem(Tag tagsItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -214,10 +255,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 61b2e2debfde..3e4b5ee55df7 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,38 +15,50 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -57,10 +69,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java index 65fabe673de0..2ef7431f0bca 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -43,10 +49,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java index 42f80f36b72a..e2153173c05c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java @@ -15,28 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -47,15 +53,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -66,10 +79,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0468a2364b18..4660869ef5b4 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,35 +24,40 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,22 @@ public TypeHolderDefault stringItem(String stringItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -82,15 +95,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -101,15 +121,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +147,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -144,10 +178,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2912e8d03e37..dba5a5d25aa1 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,35 +24,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +72,22 @@ public TypeHolderExample stringItem(String stringItem) { **/ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -82,15 +99,48 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -101,15 +151,22 @@ public TypeHolderExample integerItem(Integer integerItem) { **/ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +177,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { **/ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -144,10 +208,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { **/ @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -164,6 +233,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -171,7 +241,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -181,6 +251,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java index ebfc17610252..f46df9c9a933 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java @@ -15,52 +15,58 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -71,15 +77,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -90,15 +103,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -109,15 +129,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -128,15 +155,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -147,15 +181,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -166,15 +207,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -185,15 +233,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -204,10 +259,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java index 452a0b3c01aa..98f99c4a5140 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,131 +24,136 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -158,15 +164,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +191,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +217,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +243,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +277,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +303,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -282,15 +330,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -301,15 +356,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -320,15 +382,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -347,15 +416,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -374,15 +450,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -393,15 +476,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -413,15 +503,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -432,15 +529,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -451,15 +555,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -478,15 +589,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -505,15 +623,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -524,15 +649,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -544,15 +676,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -563,15 +702,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -582,15 +728,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -609,15 +762,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -636,15 +796,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -655,15 +822,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -675,15 +849,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -694,15 +875,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -713,15 +901,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -740,15 +935,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -767,10 +969,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.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/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index f8182e093292..5a8bdb5e0540 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -97,8 +97,9 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" play_version = "2.6.7" swagger_annotations_version = "1.5.22" junit_version = "4.12" @@ -123,6 +124,7 @@ dependencies { 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_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/retrofit2-play26/build.sbt b/samples/client/petstore/java/retrofit2-play26/build.sbt index 700e77c21df7..545688cf09e4 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.sbt +++ b/samples/client/petstore/java/retrofit2-play26/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "javax.validation" % "validation-api" % "1.1.0.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "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.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-play26/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md index 29d71d3620d5..24e2d7f5be24 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2-play26/docs/TypeHolderExample.md b/samples/client/petstore/java/retrofit2-play26/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md index bdf473df90dc..d03e871ce01b 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2-play26/git_push.sh b/samples/client/petstore/java/retrofit2-play26/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit2-play26/git_push.sh +++ b/samples/client/petstore/java/retrofit2-play26/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index d03f83d54f9a..5ba1a7f38a2a 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -269,6 +269,11 @@ validation-api 1.1.0.Final + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + junit @@ -284,9 +289,10 @@ ${java.version} 1.8.3 1.5.22 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 2.6.7 + 0.2.0 2.5.0 1.3.8 1.0.1 diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java index 6daa98296f7c..fdee9f1921f6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java @@ -13,6 +13,7 @@ import retrofit2.Retrofit; import retrofit2.converter.scalars.ScalarsConverterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; +import org.openapitools.jackson.nullable.JsonNullableModule; import play.libs.Json; import play.libs.ws.WSClient; @@ -90,6 +91,8 @@ public S createService(Class serviceClass) { } if (defaultMapper == null) { defaultMapper = Json.mapper(); + JsonNullableModule jnm = new JsonNullableModule(); + defaultMapper.registerModule(jnm); } return new Retrofit.Builder() diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd936..20cbb0e7d6af 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index 12e091d78eea..101757f03d0e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -218,4 +218,19 @@ CompletionStage> testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + CompletionStage> testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index fccdfd9063b7..29ab38c51b9e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index ca93793eb928..a9e1f16e7006 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -46,10 +52,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index bcc0c1468af1..ec4f41db5911 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8c80863eaa50..91f163f405ff 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,59 +25,64 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -95,15 +101,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +136,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +170,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +204,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -205,15 +239,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -233,15 +274,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -261,15 +309,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -289,15 +344,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -309,15 +371,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -329,15 +398,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -349,10 +425,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 9df2c41186a5..9a8e56b6b81a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 9a86f4a655d1..660ca6a43131 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -46,10 +52,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index d7e32f25cbe9..9f24f09077b8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 600622d7cabe..3978179bcf5d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -45,10 +51,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index a43ceea70647..63f1aa5dec93 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,12 +23,17 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -37,14 +43,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -55,15 +61,22 @@ public Animal className(String className) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -74,10 +87,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 07c2946dda33..483ba916ed5a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +61,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 365c359b845a..8753a7a89371 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,19 +24,24 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +61,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index 1c9ab40620c7..4df2dd311458 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,27 +24,32 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -62,15 +68,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +103,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -118,10 +138,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index 65f5b799d252..065d28841ca9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,44 +15,50 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -63,15 +69,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -82,15 +95,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -101,15 +121,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -120,15 +147,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -139,15 +173,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -158,10 +199,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index d0e872ebd73e..8e87cb645ba3 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -45,10 +51,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index e72f96cee937..30d9d8f49615 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index 4f388371ed58..60ea5045dbce 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -15,28 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -47,15 +53,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +79,15 @@ public Category name(String name) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index b7b9081f44a5..012b0c20c5bb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,13 +29,17 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -44,10 +50,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index b0ae0657c799..0e55d62d5139 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -43,10 +49,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index d9656d309a79..7d277b961a64 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,19 +23,24 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -45,10 +51,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 500f5a63d0e8..3c6d99afb75a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index 1711a75939af..8b046bd53c38 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,12 +23,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -66,7 +72,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -105,10 +110,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -119,15 +125,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -146,10 +159,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumClass.java index 658c48b7f623..d78b71854be4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index 7148143b17d4..8bac5511683d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,18 +15,27 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -67,7 +76,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -108,7 +116,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -147,7 +154,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -186,14 +192,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -204,15 +210,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -223,15 +236,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -242,15 +262,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -261,15 +288,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -281,10 +315,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4b53c0068d53..98648e87cf25 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +23,28 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +56,22 @@ public FileSchemaTestClass file(java.io.File file) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -78,10 +91,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index f9637c522272..f91b09215d97 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,67 +26,72 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -98,15 +104,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -119,15 +132,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -138,15 +158,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -160,15 +187,22 @@ public FormatTest number(BigDecimal number) { @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -181,15 +215,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -202,15 +243,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -221,15 +269,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -240,15 +295,22 @@ public FormatTest _byte(byte[] _byte) { **/ @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -260,15 +322,22 @@ public FormatTest binary(File binary) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -280,15 +349,22 @@ public FormatTest date(LocalDate date) { @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -300,15 +376,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -320,15 +403,22 @@ public FormatTest uuid(UUID uuid) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -339,10 +429,15 @@ public FormatTest password(String password) { **/ @NotNull @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f2175b7f513d..81e823b2fe8a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,48 +15,64 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 5b93accce61c..891bed365c49 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,23 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -71,18 +78,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -102,15 +108,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -129,15 +142,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -156,15 +176,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -183,10 +210,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7d93a45c45f7..e0930dc40110 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,27 +27,32 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +64,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -78,15 +91,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -106,10 +126,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index 8de17e10609a..5d57eb6e2516 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,17 +29,21 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -48,15 +54,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -67,10 +80,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 874cba97c69d..ec257a9e3c73 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -51,15 +57,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -70,15 +83,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -89,10 +109,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index e606f768eb98..3bf61282d0db 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,13 +29,17 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -44,10 +50,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index 9dfdb681267d..1cc42f664e45 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -15,11 +15,13 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,25 +29,29 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +62,38 @@ public Name name(Integer name) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +104,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index 7f083e23a3de..17217c202ce5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,25 +15,31 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +51,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index b5aaf42748ae..3554e9b139be 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -15,34 +15,40 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -83,14 +89,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -101,15 +107,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -120,15 +133,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -139,15 +159,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -159,15 +186,22 @@ public Order shipDate(OffsetDateTime shipDate) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -178,15 +212,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -197,10 +238,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index 17e6de1f014e..0b0917bcef61 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,33 +15,39 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +59,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +85,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +111,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterEnum.java index cde04c1aea85..5591f09ff23f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index f5a50b7f8139..1dcd2fee24af 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,33 +25,37 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -90,10 +95,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -104,15 +110,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -124,15 +137,22 @@ public Pet category(Category category) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -143,15 +163,22 @@ public Pet name(String name) { **/ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -167,15 +194,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -195,15 +229,22 @@ public Pet addTagsItem(Tag tagsItem) { @javax.annotation.Nullable @Valid @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -214,10 +255,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 61b2e2debfde..3e4b5ee55df7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,38 +15,50 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -57,10 +69,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 65fabe673de0..2ef7431f0bca 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,24 +15,30 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -43,10 +49,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index 42f80f36b72a..e2153173c05c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -15,28 +15,34 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -47,15 +53,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -66,10 +79,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0468a2364b18..4660869ef5b4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,35 +24,40 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,22 @@ public TypeHolderDefault stringItem(String stringItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -82,15 +95,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -101,15 +121,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +147,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -144,10 +178,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { **/ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2912e8d03e37..dba5a5d25aa1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,35 +24,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +72,22 @@ public TypeHolderExample stringItem(String stringItem) { **/ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -82,15 +99,48 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -101,15 +151,22 @@ public TypeHolderExample integerItem(Integer integerItem) { **/ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -120,15 +177,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { **/ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -144,10 +208,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { **/ @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -164,6 +233,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -171,7 +241,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -181,6 +251,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index ebfc17610252..f46df9c9a933 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -15,52 +15,58 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -71,15 +77,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -90,15 +103,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -109,15 +129,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -128,15 +155,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -147,15 +181,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -166,15 +207,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -185,15 +233,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -204,10 +259,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index 452a0b3c01aa..98f99c4a5140 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,131 +24,136 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -158,15 +164,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +191,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +217,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +243,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +277,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +303,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -282,15 +330,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -301,15 +356,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -320,15 +382,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -347,15 +416,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -374,15 +450,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -393,15 +476,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -413,15 +503,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -432,15 +529,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -451,15 +555,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -478,15 +589,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -505,15 +623,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -524,15 +649,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -544,15 +676,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -563,15 +702,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -582,15 +728,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -609,15 +762,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -636,15 +796,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -655,15 +822,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -675,15 +849,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { @javax.annotation.Nullable @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -694,15 +875,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -713,15 +901,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -740,15 +935,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -767,10 +969,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.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/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 29d71d3620d5..24e2d7f5be24 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2/docs/TypeHolderExample.md b/samples/client/petstore/java/retrofit2/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/retrofit2/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/retrofit2/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/retrofit2/docs/UserApi.md b/samples/client/petstore/java/retrofit2/docs/UserApi.md index bdf473df90dc..d03e871ce01b 100644 --- a/samples/client/petstore/java/retrofit2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2/git_push.sh b/samples/client/petstore/java/retrofit2/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit2/git_push.sh +++ b/samples/client/petstore/java/retrofit2/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd936..20cbb0e7d6af 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index 79e12d56c039..69bcdb0b251c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -213,4 +213,19 @@ Call testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + Call testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 6639252ccb33..13e761a8d9c0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c3f2ca0a464..17e320b0a953 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7c4a5248c073..8a51fa9f778d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b016f1f3778f..a4a797bb487c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,49 +35,51 @@ public class AdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -96,15 +98,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +130,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +162,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +194,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -204,15 +226,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -231,15 +258,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -258,15 +290,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -285,15 +322,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -304,15 +346,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -323,15 +370,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -342,10 +394,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 10df3df74c74..4f2e3ef333e9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 33719cab2611..80ce73d422b5 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e37e04b01a6d..bc5cc81bf64e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfbf74f5b328..2e9c0c7ffd9f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java index 0a02419dbf16..dd6b313c58cd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,9 @@ public class Animal { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +53,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +77,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 4f016503d471..1af52a3a988d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 15d27a21f287..eba8d40a2893 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java index 7f6d476044d4..7ba0d8b77e0d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,17 +34,19 @@ public class ArrayTest { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -63,15 +65,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +97,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -117,10 +129,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java index ef40fe949fdf..dc70cf2b5975 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,7 +53,9 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -64,15 +66,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -83,15 +90,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -102,15 +114,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -121,15 +138,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -140,15 +162,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -159,10 +186,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java index c600502f716f..8829c547501d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,9 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -46,10 +48,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java index 29b3658551eb..d20d19aa53f7 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,9 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -44,10 +46,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java index 1968763722dc..f335f0b5217d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java @@ -37,7 +37,9 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +73,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java index 52245d70502d..83c30b802d49 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,9 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -45,10 +47,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java index e5ece3536d60..192c0ce6e5b6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,9 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -44,10 +46,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java index d877eb2f3706..2f8a4652247c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,9 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -46,10 +48,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java index 54483f2227d1..96610291473f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,9 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -44,10 +46,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java index a5aba01d533d..bbb97598ea37 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -72,7 +72,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -123,7 +123,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -131,9 +131,11 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -144,15 +146,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -171,10 +178,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index 679584204fb5..c08e4f6239de 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -73,7 +73,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -126,7 +126,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -228,7 +228,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -242,7 +242,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -253,15 +255,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -271,15 +278,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -290,15 +302,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -309,15 +326,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -328,10 +350,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 181141b92dc4..45ce4347b2dd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,13 +33,15 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +52,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -77,10 +84,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java index 583b12a0ebc8..36fe58976838 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -86,7 +86,9 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -99,15 +101,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -120,15 +127,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -139,15 +151,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -159,15 +176,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -180,15 +202,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -201,15 +228,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -220,15 +252,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -238,15 +275,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -257,15 +299,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -275,15 +322,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -294,15 +346,20 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -313,15 +370,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -331,10 +393,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 02225d278c47..8fcb26846436 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,27 +37,35 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index 329cb4c87b8d..b19863fb9931 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,7 +77,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -85,17 +85,19 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -114,15 +116,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -141,15 +148,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -168,15 +180,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -195,10 +212,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1826c8b064c7..815cf8d5e050 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,9 +45,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +60,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -77,15 +84,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -104,10 +116,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java index 3167560a9dd0..42a61d0d8776 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,7 +38,9 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -49,15 +51,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -68,10 +75,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84d2fcc4d396..db323b17602a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,7 +41,9 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -52,15 +54,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -71,15 +78,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -90,10 +102,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java index c13f1babe599..da9f1a20259d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,7 +34,9 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -45,10 +47,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java index 221821d4e191..f775f97b3f19 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java @@ -46,7 +46,9 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +58,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +96,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a068c2e1ee6..1a7bd689645f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,9 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +47,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java index 9ee41b5b8a92..8b4c1c910b72 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java @@ -89,7 +89,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -103,7 +103,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -114,15 +116,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -133,15 +140,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -152,15 +164,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -171,15 +188,20 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -190,15 +212,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -209,10 +236,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java index 690b6bde4be1..3db0e2e26c9a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,7 +42,9 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +55,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +79,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +103,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java index 59fe8406f43d..643184ae4fc1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -51,7 +51,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -96,7 +96,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -106,7 +106,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -117,15 +119,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -136,15 +143,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -154,15 +166,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -177,15 +194,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -204,15 +226,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -223,10 +250,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 84780d763a0d..2501babb56ea 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,17 +37,23 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -58,10 +64,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java index c6ccd2c33f6a..4ff598a6cfca 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,9 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -44,10 +46,13 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java index 504c51cc3e59..693247a2fd27 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java @@ -37,7 +37,9 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -67,10 +74,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8fc321bc0a20..e61b1492abc2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,7 +52,9 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +64,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +87,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +110,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +133,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +161,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d9496cbd7902..bf0f4550ccbf 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,10 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -52,7 +56,9 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +91,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +137,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +160,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +188,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -159,6 +211,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -166,7 +219,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -176,6 +229,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java index 1aedd044b588..3760c07c5927 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java @@ -61,7 +61,9 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -72,15 +74,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -91,15 +98,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -110,15 +122,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -129,15 +146,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -148,15 +170,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -167,15 +194,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -186,15 +218,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -205,10 +242,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java index ea15cdba33cf..4fce3d5e1c05 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -50,7 +50,7 @@ public class XmlItem { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -70,11 +70,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -94,11 +94,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -118,11 +118,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -142,13 +142,15 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -159,15 +161,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +185,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +209,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +233,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +265,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +289,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -281,15 +313,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -300,15 +337,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -319,15 +361,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -346,15 +393,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -373,15 +425,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -392,15 +449,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -411,15 +473,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -430,15 +497,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -449,15 +521,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -476,15 +553,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -503,15 +585,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -522,15 +609,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -541,15 +633,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -560,15 +657,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -579,15 +681,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -606,15 +713,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -633,15 +745,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -652,15 +769,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -671,15 +793,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -690,15 +817,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -709,15 +841,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -736,15 +873,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -763,10 +905,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.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/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index 29d71d3620d5..24e2d7f5be24 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2rx/docs/TypeHolderExample.md b/samples/client/petstore/java/retrofit2rx/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/retrofit2rx/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md index bdf473df90dc..d03e871ce01b 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2rx/git_push.sh b/samples/client/petstore/java/retrofit2rx/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit2rx/git_push.sh +++ b/samples/client/petstore/java/retrofit2rx/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd936..20cbb0e7d6af 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index f557b64a0b5a..cd8ff7deca0a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -213,4 +213,19 @@ Observable testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Observable<Void> + */ + @PUT("fake/test-query-paramters") + Observable testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 6639252ccb33..13e761a8d9c0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c3f2ca0a464..17e320b0a953 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7c4a5248c073..8a51fa9f778d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b016f1f3778f..a4a797bb487c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,49 +35,51 @@ public class AdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -96,15 +98,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +130,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +162,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +194,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -204,15 +226,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -231,15 +258,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -258,15 +290,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -285,15 +322,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -304,15 +346,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -323,15 +370,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -342,10 +394,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 10df3df74c74..4f2e3ef333e9 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 33719cab2611..80ce73d422b5 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e37e04b01a6d..bc5cc81bf64e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfbf74f5b328..2e9c0c7ffd9f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java index 0a02419dbf16..dd6b313c58cd 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,9 @@ public class Animal { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +53,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +77,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 4f016503d471..1af52a3a988d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 15d27a21f287..eba8d40a2893 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayTest.java index 7f6d476044d4..7ba0d8b77e0d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,17 +34,19 @@ public class ArrayTest { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -63,15 +65,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +97,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -117,10 +129,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Capitalization.java index ef40fe949fdf..dc70cf2b5975 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,7 +53,9 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -64,15 +66,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -83,15 +90,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -102,15 +114,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -121,15 +138,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -140,15 +162,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -159,10 +186,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Cat.java index c600502f716f..8829c547501d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,9 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -46,10 +48,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/CatAllOf.java index 29b3658551eb..d20d19aa53f7 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,9 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -44,10 +46,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Category.java index 1968763722dc..f335f0b5217d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Category.java @@ -37,7 +37,9 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +73,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ClassModel.java index 52245d70502d..83c30b802d49 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,9 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -45,10 +47,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Client.java index e5ece3536d60..192c0ce6e5b6 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,9 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -44,10 +46,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Dog.java index d877eb2f3706..2f8a4652247c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,9 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -46,10 +48,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/DogAllOf.java index 54483f2227d1..96610291473f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,9 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -44,10 +46,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumArrays.java index a5aba01d533d..bbb97598ea37 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -72,7 +72,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -123,7 +123,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -131,9 +131,11 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -144,15 +146,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -171,10 +178,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumTest.java index 679584204fb5..c08e4f6239de 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -73,7 +73,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -126,7 +126,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -228,7 +228,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -242,7 +242,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -253,15 +255,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -271,15 +278,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -290,15 +302,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -309,15 +326,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -328,10 +350,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 181141b92dc4..45ce4347b2dd 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,13 +33,15 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +52,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -77,10 +84,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FormatTest.java index 583b12a0ebc8..36fe58976838 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -86,7 +86,9 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -99,15 +101,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -120,15 +127,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -139,15 +151,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -159,15 +176,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -180,15 +202,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -201,15 +228,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -220,15 +252,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -238,15 +275,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -257,15 +299,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -275,15 +322,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -294,15 +346,20 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -313,15 +370,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -331,10 +393,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 02225d278c47..8fcb26846436 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,27 +37,35 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java index 329cb4c87b8d..b19863fb9931 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,7 +77,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -85,17 +85,19 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -114,15 +116,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -141,15 +148,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -168,15 +180,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -195,10 +212,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1826c8b064c7..815cf8d5e050 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,9 +45,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +60,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -77,15 +84,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -104,10 +116,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Model200Response.java index 3167560a9dd0..42a61d0d8776 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,7 +38,9 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -49,15 +51,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -68,10 +75,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84d2fcc4d396..db323b17602a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,7 +41,9 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -52,15 +54,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -71,15 +78,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -90,10 +102,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelReturn.java index c13f1babe599..da9f1a20259d 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,7 +34,9 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -45,10 +47,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Name.java index 221821d4e191..f775f97b3f19 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Name.java @@ -46,7 +46,9 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +58,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +96,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a068c2e1ee6..1a7bd689645f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,9 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +47,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Order.java index 9ee41b5b8a92..8b4c1c910b72 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Order.java @@ -89,7 +89,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -103,7 +103,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -114,15 +116,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -133,15 +140,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -152,15 +164,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -171,15 +188,20 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -190,15 +212,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -209,10 +236,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java index 690b6bde4be1..3db0e2e26c9a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,7 +42,9 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +55,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +79,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +103,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java index 59fe8406f43d..643184ae4fc1 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -51,7 +51,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -96,7 +96,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -106,7 +106,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -117,15 +119,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -136,15 +143,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -154,15 +166,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -177,15 +194,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -204,15 +226,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -223,10 +250,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 84780d763a0d..2501babb56ea 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,17 +37,23 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -58,10 +64,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/SpecialModelName.java index c6ccd2c33f6a..4ff598a6cfca 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,9 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -44,10 +46,13 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Tag.java index 504c51cc3e59..693247a2fd27 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Tag.java @@ -37,7 +37,9 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -67,10 +74,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8fc321bc0a20..e61b1492abc2 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,7 +52,9 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +64,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +87,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +110,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +133,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +161,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d9496cbd7902..bf0f4550ccbf 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,10 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -52,7 +56,9 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +91,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +137,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +160,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +188,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -159,6 +211,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -166,7 +219,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -176,6 +229,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/User.java index 1aedd044b588..3760c07c5927 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/User.java @@ -61,7 +61,9 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -72,15 +74,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -91,15 +98,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -110,15 +122,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -129,15 +146,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -148,15 +170,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -167,15 +194,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -186,15 +218,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -205,10 +242,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/XmlItem.java index ea15cdba33cf..4fce3d5e1c05 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -50,7 +50,7 @@ public class XmlItem { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -70,11 +70,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -94,11 +94,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -118,11 +118,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -142,13 +142,15 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -159,15 +161,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +185,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +209,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +233,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +265,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +289,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -281,15 +313,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -300,15 +337,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -319,15 +361,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -346,15 +393,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -373,15 +425,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -392,15 +449,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -411,15 +473,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -430,15 +497,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -449,15 +521,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -476,15 +553,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -503,15 +585,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -522,15 +609,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -541,15 +633,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -560,15 +657,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -579,15 +681,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -606,15 +713,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -633,15 +745,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -652,15 +769,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -671,15 +793,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -690,15 +817,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -709,15 +841,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -736,15 +873,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -763,10 +905,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.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/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 29d71d3620d5..24e2d7f5be24 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/TypeHolderExample.md b/samples/client/petstore/java/retrofit2rx2/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md index bdf473df90dc..d03e871ce01b 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2rx2/git_push.sh b/samples/client/petstore/java/retrofit2rx2/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/retrofit2rx2/git_push.sh +++ b/samples/client/petstore/java/retrofit2rx2/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd936..20cbb0e7d6af 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public String toString() { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 4ca310afcf8a..d3cd78e39f4b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -214,4 +214,19 @@ Completable testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Completable + */ + @PUT("fake/test-query-paramters") + Completable testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 6639252ccb33..13e761a8d9c0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesAnyType extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c3f2ca0a464..17e320b0a953 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesArray extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7c4a5248c073..8a51fa9f778d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesBoolean extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b016f1f3778f..a4a797bb487c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,49 +35,51 @@ public class AdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) - private Map mapString = new HashMap(); + private Map mapString = null; public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number"; @SerializedName(SERIALIZED_NAME_MAP_NUMBER) - private Map mapNumber = new HashMap(); + private Map mapNumber = null; public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer"; @SerializedName(SERIALIZED_NAME_MAP_INTEGER) - private Map mapInteger = new HashMap(); + private Map mapInteger = null; public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean"; @SerializedName(SERIALIZED_NAME_MAP_BOOLEAN) - private Map mapBoolean = new HashMap(); + private Map mapBoolean = null; public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap>(); + private Map> mapArrayInteger = null; public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype"; @SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap>(); + private Map> mapArrayAnytype = null; public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_STRING) - private Map> mapMapString = new HashMap>(); + private Map> mapMapString = null; public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype"; @SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap>(); + private Map> mapMapAnytype = null; public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; @SerializedName(SERIALIZED_NAME_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String SERIALIZED_NAME_ANYTYPE2 = "anytype_2"; @SerializedName(SERIALIZED_NAME_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String SERIALIZED_NAME_ANYTYPE3 = "anytype_3"; @SerializedName(SERIALIZED_NAME_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -96,15 +98,20 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -123,15 +130,20 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -150,15 +162,20 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -177,15 +194,20 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -204,15 +226,20 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -231,15 +258,20 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -258,15 +290,20 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -285,15 +322,20 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -304,15 +346,20 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -323,15 +370,20 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -342,10 +394,13 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 10df3df74c74..4f2e3ef333e9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesInteger extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 33719cab2611..80ce73d422b5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,7 +36,9 @@ public class AdditionalPropertiesNumber extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -47,10 +49,13 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e37e04b01a6d..bc5cc81bf64e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesObject extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfbf74f5b328..2e9c0c7ffd9f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,7 +35,9 @@ public class AdditionalPropertiesString extends HashMap { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -46,10 +48,13 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java index 0a02419dbf16..dd6b313c58cd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,9 @@ public class Animal { public Animal() { this.className = this.getClass().getSimpleName(); } + public Animal className(String className) { + this.className = className; return this; } @@ -51,15 +53,20 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -70,10 +77,13 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 4f016503d471..1af52a3a988d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 15d27a21f287..eba8d40a2893 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,9 +34,11 @@ public class ArrayOfNumberOnly { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -55,10 +57,13 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java index 7f6d476044d4..7ba0d8b77e0d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,17 +34,19 @@ public class ArrayTest { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -63,15 +65,20 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -90,15 +97,20 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -117,10 +129,13 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java index ef40fe949fdf..dc70cf2b5975 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -53,7 +53,9 @@ public class Capitalization { @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -64,15 +66,20 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -83,15 +90,20 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -102,15 +114,20 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -121,15 +138,20 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -140,15 +162,20 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -159,10 +186,13 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java index c600502f716f..8829c547501d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java @@ -35,7 +35,9 @@ public class Cat extends Animal { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -46,10 +48,13 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java index 29b3658551eb..d20d19aa53f7 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,9 @@ public class CatAllOf { @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -44,10 +46,13 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java index 1968763722dc..f335f0b5217d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java @@ -37,7 +37,9 @@ public class Category { @SerializedName(SERIALIZED_NAME_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -66,10 +73,13 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java index 52245d70502d..83c30b802d49 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,7 +34,9 @@ public class ClassModel { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -45,10 +47,13 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java index e5ece3536d60..192c0ce6e5b6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java @@ -33,7 +33,9 @@ public class Client { @SerializedName(SERIALIZED_NAME_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -44,10 +46,13 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java index d877eb2f3706..2f8a4652247c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java @@ -35,7 +35,9 @@ public class Dog extends Animal { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -46,10 +48,13 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java index 54483f2227d1..96610291473f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,9 @@ public class DogAllOf { @SerializedName(SERIALIZED_NAME_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -44,10 +46,13 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java index a5aba01d533d..bbb97598ea37 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -72,7 +72,7 @@ public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) @Override public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return JustSymbolEnum.fromValue(value); } } @@ -123,7 +123,7 @@ public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) @Override public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return ArrayEnumEnum.fromValue(value); } } @@ -131,9 +131,11 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -144,15 +146,20 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -171,10 +178,13 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index 679584204fb5..c08e4f6239de 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -73,7 +73,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) @Override public EnumStringEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringEnum.fromValue(value); } } @@ -126,7 +126,7 @@ public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enum @Override public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return EnumStringRequiredEnum.fromValue(value); } } @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + Integer value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(value); } } @@ -228,7 +228,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + Double value = jsonReader.nextDouble(); return EnumNumberEnum.fromValue(value); } } @@ -242,7 +242,9 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -253,15 +255,20 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -271,15 +278,20 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -290,15 +302,20 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -309,15 +326,20 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -328,10 +350,13 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 181141b92dc4..45ce4347b2dd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,13 +33,15 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file = null; + private java.io.File file; public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -50,15 +52,20 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -77,10 +84,13 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java index 583b12a0ebc8..36fe58976838 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -86,7 +86,9 @@ public class FormatTest { @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -99,15 +101,20 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -120,15 +127,20 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -139,15 +151,20 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -159,15 +176,20 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -180,15 +202,20 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -201,15 +228,20 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -220,15 +252,20 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -238,15 +275,20 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -257,15 +299,20 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -275,15 +322,20 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -294,15 +346,20 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -313,15 +370,20 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -331,10 +393,13 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 02225d278c47..8fcb26846436 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,27 +37,35 @@ public class HasOnlyReadOnly { @SerializedName(SERIALIZED_NAME_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index 329cb4c87b8d..b19863fb9931 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,7 @@ public class MapTest { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -77,7 +77,7 @@ public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) thro @Override public InnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return InnerEnum.fromValue(value); } } @@ -85,17 +85,19 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; @SerializedName(SERIALIZED_NAME_DIRECT_MAP) - private Map directMap = new HashMap(); + private Map directMap = null; public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) - private Map indirectMap = new HashMap(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -114,15 +116,20 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -141,15 +148,20 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -168,15 +180,20 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -195,10 +212,13 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1826c8b064c7..815cf8d5e050 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,9 +45,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String SERIALIZED_NAME_MAP = "map"; @SerializedName(SERIALIZED_NAME_MAP) - private Map map = new HashMap(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -58,15 +60,20 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -77,15 +84,20 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -104,10 +116,13 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java index 3167560a9dd0..42a61d0d8776 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,7 +38,9 @@ public class Model200Response { @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -49,15 +51,20 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -68,10 +75,13 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 84d2fcc4d396..db323b17602a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -41,7 +41,9 @@ public class ModelApiResponse { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -52,15 +54,20 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -71,15 +78,20 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -90,10 +102,13 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java index c13f1babe599..da9f1a20259d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,7 +34,9 @@ public class ModelReturn { @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -45,10 +47,13 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java index 221821d4e191..f775f97b3f19 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java @@ -46,7 +46,9 @@ public class Name { @SerializedName(SERIALIZED_NAME_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -56,25 +58,34 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -85,25 +96,32 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a068c2e1ee6..1a7bd689645f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,7 +34,9 @@ public class NumberOnly { @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -45,10 +47,13 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java index 9ee41b5b8a92..8b4c1c910b72 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java @@ -89,7 +89,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -103,7 +103,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -114,15 +116,20 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -133,15 +140,20 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -152,15 +164,20 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -171,15 +188,20 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -190,15 +212,20 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -209,10 +236,13 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java index 690b6bde4be1..3db0e2e26c9a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -42,7 +42,9 @@ public class OuterComposite { @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -53,15 +55,20 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -72,15 +79,20 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -91,10 +103,13 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java index 59fe8406f43d..643184ae4fc1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java @@ -39,7 +39,7 @@ public class Pet { public static final String SERIALIZED_NAME_CATEGORY = "category"; @SerializedName(SERIALIZED_NAME_CATEGORY) - private Category category = null; + private Category category; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -51,7 +51,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -96,7 +96,7 @@ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) thr @Override public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); + String value = jsonReader.nextString(); return StatusEnum.fromValue(value); } } @@ -106,7 +106,9 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -117,15 +119,20 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -136,15 +143,20 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -154,15 +166,20 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -177,15 +194,20 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -204,15 +226,20 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -223,10 +250,13 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 84780d763a0d..2501babb56ea 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,17 +37,23 @@ public class ReadOnlyFirst { @SerializedName(SERIALIZED_NAME_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -58,10 +64,13 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java index c6ccd2c33f6a..4ff598a6cfca 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,9 @@ public class SpecialModelName { @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -44,10 +46,13 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java index 504c51cc3e59..693247a2fd27 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java @@ -37,7 +37,9 @@ public class Tag { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -48,15 +50,20 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -67,10 +74,13 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8fc321bc0a20..e61b1492abc2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -52,7 +52,9 @@ public class TypeHolderDefault { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +64,20 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +87,20 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +110,20 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +133,20 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +161,13 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d9496cbd7902..bf0f4550ccbf 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,10 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_NUMBER_ITEM) private BigDecimal numberItem; + public static final String SERIALIZED_NAME_FLOAT_ITEM = "float_item"; + @SerializedName(SERIALIZED_NAME_FLOAT_ITEM) + private Float floatItem; + public static final String SERIALIZED_NAME_INTEGER_ITEM = "integer_item"; @SerializedName(SERIALIZED_NAME_INTEGER_ITEM) private Integer integerItem; @@ -52,7 +56,9 @@ public class TypeHolderExample { @SerializedName(SERIALIZED_NAME_ARRAY_ITEM) private List arrayItem = new ArrayList(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -62,15 +68,20 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -80,15 +91,43 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -98,15 +137,20 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -116,15 +160,20 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -139,10 +188,13 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -159,6 +211,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -166,7 +219,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -176,6 +229,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java index 1aedd044b588..3760c07c5927 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java @@ -61,7 +61,9 @@ public class User { @SerializedName(SERIALIZED_NAME_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -72,15 +74,20 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -91,15 +98,20 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -110,15 +122,20 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -129,15 +146,20 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -148,15 +170,20 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -167,15 +194,20 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -186,15 +218,20 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -205,10 +242,13 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java index ea15cdba33cf..4fce3d5e1c05 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -50,7 +50,7 @@ public class XmlItem { public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array"; @SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList(); + private List wrappedArray = null; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -70,11 +70,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array"; @SerializedName(SERIALIZED_NAME_NAME_ARRAY) - private List nameArray = new ArrayList(); + private List nameArray = null; public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList(); + private List nameWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -94,11 +94,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array"; @SerializedName(SERIALIZED_NAME_PREFIX_ARRAY) - private List prefixArray = new ArrayList(); + private List prefixArray = null; public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList(); + private List prefixWrappedArray = null; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -118,11 +118,11 @@ public class XmlItem { public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList(); + private List namespaceArray = null; public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; @SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList(); + private List namespaceWrappedArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -142,13 +142,15 @@ public class XmlItem { public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList(); + private List prefixNsArray = null; public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -159,15 +161,20 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -178,15 +185,20 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -197,15 +209,20 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -216,15 +233,20 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -243,15 +265,20 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -262,15 +289,20 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -281,15 +313,20 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -300,15 +337,20 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -319,15 +361,20 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -346,15 +393,20 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -373,15 +425,20 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -392,15 +449,20 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -411,15 +473,20 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -430,15 +497,20 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -449,15 +521,20 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -476,15 +553,20 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -503,15 +585,20 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -522,15 +609,20 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -541,15 +633,20 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -560,15 +657,20 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -579,15 +681,20 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -606,15 +713,20 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -633,15 +745,20 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -652,15 +769,20 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -671,15 +793,20 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -690,15 +817,20 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -709,15 +841,20 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -736,15 +873,20 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -763,10 +905,13 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.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/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index 78e71edb30f8..1d51eb1193c3 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -28,8 +28,8 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" vertx_version = "3.4.2" junit_version = "4.12" } diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 9224b4d80d59..4872227b32e5 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/vertx/docs/TypeHolderExample.md b/samples/client/petstore/java/vertx/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/vertx/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/vertx/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/vertx/docs/UserApi.md b/samples/client/petstore/java/vertx/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/vertx/docs/UserApi.md +++ b/samples/client/petstore/java/vertx/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/vertx/git_push.sh b/samples/client/petstore/java/vertx/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/vertx/git_push.sh +++ b/samples/client/petstore/java/vertx/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index aa79e5fe4099..54e985acc850 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -235,6 +235,11 @@ com.fasterxml.jackson.core jackson-databind ${jackson-databind} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} com.fasterxml.jackson.datatype @@ -261,8 +266,9 @@ UTF-8 3.4.2 1.5.22 - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 4.12 diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java index 74c626c9b4c3..84bad01a4ed2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import io.vertx.core.*; import io.vertx.core.buffer.Buffer; import io.vertx.core.file.AsyncFile; @@ -75,6 +76,8 @@ public ApiClient(Vertx vertx, JsonObject config) { this.objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); this.objectMapper.registerModule(new JavaTimeModule()); this.objectMapper.setDateFormat(dateFormat); + JsonNullableModule jnm = new JsonNullableModule(); + this.objectMapper.registerModule(jnm); // Setup authentications (key: authentication name, value: authentication). this.authentications = new HashMap<>(); @@ -437,7 +440,7 @@ public void invokeAPI(String path, String method, List queryParams, Ob updateParamsForAuth(authNames, queryParams, headerParams); - if (accepts != null) { + if (accepts != null && accepts.length > 0) { headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts)); } @@ -572,7 +575,7 @@ protected Handler>> buildResponseHandler(Ty return; } else { try { - resultContent = Json.mapper.readValue(httpResponse.bodyAsString(), returnType); + resultContent = this.objectMapper.readValue(httpResponse.bodyAsString(), returnType); result = Future.succeededFuture(resultContent); } catch (Exception e) { result = ApiException.fail(new DecodeException("Failed to decode:" + e.getMessage(), e)); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java index 0e836e197b81..ff2793b4245a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -43,4 +43,6 @@ public interface FakeApi { void testJsonFormData(String param, String param2, Handler> handler); + void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 4f04994cb415..9b74239af413 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -561,4 +561,71 @@ public void testJsonFormData(String param, String param2, Handler pipe, List ioutil, List http, List url, List context, Handler> resultHandler) { + Object localVarBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'http' is set + if (http == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'url' is set + if (url == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'context' is set + if (context == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat")); + return; + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + // header params + MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); + + // form params + // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) + Map localVarFormParams = new HashMap<>(); + + String[] localVarAccepts = { }; + String[] localVarContentTypes = { }; + String[] localVarAuthNames = new String[] { }; + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java index dee8abe5c9c0..42239d4edfc9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java @@ -356,6 +356,35 @@ public Single rxTestJsonFormData(String param, String param2) { delegate.testJsonFormData(param, param2, fut); })); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param resultHandler Asynchronous result handler + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> resultHandler) { + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, resultHandler); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, fut); + })); + } public static FakeApi newInstance(org.openapitools.client.api.FakeApi arg) { return arg != null ? new FakeApi(arg) : null; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dc8ea1e9ec3b..0b590e6f976e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index ce83908187aa..42cb666ee58a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ad502738c107..183ed21ce31a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index d0c2fc409c55..d18e80986aaf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index 2db426ab8bf8..16d4f8bc2fff 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2c247d819cee..8d9d9801c23e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index e1795a8bf25f..ee9a72719681 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private AsyncFile binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(AsyncFile binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(AsyncFile binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AsyncFile getBinary() { return binary; } + + public void setBinary(AsyncFile binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 021d59d2570c..3f48b4f8a065 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ad173f004a1c..110378778074 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index 0730133f9cbd..ffea4083f904 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index b8e18631bf1a..30bd83db599a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3f3030998f13..85e9389c1eea 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 99ddaa8d2eb8..158636a401fe 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index 66404193208f..da87f2d68304 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.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/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 70ecf2cc3aa8..1637b07938f1 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -112,8 +112,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.9" - jackson_databind_version = "2.9.9" + jackson_version = "2.9.10" + jackson_databind_version = "2.9.10" + jackson-databind-nullable-version = "0.2.0" jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.12" @@ -128,6 +129,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + compile "org.openapitools:jackson-databind-nullable:$jackson-databind-nullable-version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 9a2e47702013..bc84c13561eb 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/webclient/docs/TypeHolderExample.md b/samples/client/petstore/java/webclient/docs/TypeHolderExample.md index 16b91b0152f2..f8858da60664 100644 --- a/samples/client/petstore/java/webclient/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/webclient/docs/TypeHolderExample.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | **integerItem** | **Integer** | | **boolItem** | **Boolean** | | **arrayItem** | **List<Integer>** | | diff --git a/samples/client/petstore/java/webclient/docs/UserApi.md b/samples/client/petstore/java/webclient/docs/UserApi.md index 4154aba4f171..ca9f550c3167 100644 --- a/samples/client/petstore/java/webclient/docs/UserApi.md +++ b/samples/client/petstore/java/webclient/docs/UserApi.md @@ -101,7 +101,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -163,7 +163,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(null); // List | List of user object + List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { diff --git a/samples/client/petstore/java/webclient/git_push.sh b/samples/client/petstore/java/webclient/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/java/webclient/git_push.sh +++ b/samples/client/petstore/java/webclient/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index ee6480dc262e..d200a8d95e91 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -98,6 +98,11 @@ jackson-databind ${jackson-databind-version} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + com.fasterxml.jackson.datatype @@ -117,8 +122,9 @@ UTF-8 1.5.22 5.0.7.RELEASE - 2.9.9 - 2.9.9 + 2.9.10 + 2.9.10 + 0.2.0 4.12 3.1.8.RELEASE 0.7.8.RELEASE 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 b5cbc8fb9b30..6d7875d1c4ab 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 @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.core.ParameterizedTypeReference; @@ -94,6 +95,8 @@ public ApiClient() { mapper.setDateFormat(dateFormat); mapper.registerModule(new JavaTimeModule()); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); this.webClient = buildWebClient(mapper); this.init(); 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 805dc32e6c46..958f88eb87ac 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 @@ -587,4 +587,65 @@ public Mono testJsonFormData(String param, String param2) throws RestClien ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + Object postBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + String path = UriComponentsBuilder.fromPath("/fake/test-query-paramters").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + 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)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0df18c37e39f..d64c54a0c3cd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesAnyType name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0d9a6b145324..8befdaf58415 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesArray name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesArray name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8e85a1f22462..0d3f3b57eec3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesBoolean name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dc8ea1e9ec3b..0b590e6f976e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,57 +25,62 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - @JsonProperty(JSON_PROPERTY_MAP_STRING) - private Map mapString = new HashMap<>(); + private Map mapString = null; public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - private Map mapNumber = new HashMap<>(); + private Map mapNumber = null; public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - private Map mapInteger = new HashMap<>(); + private Map mapInteger = null; public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - private Map mapBoolean = new HashMap<>(); + private Map mapBoolean = null; public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - private Map> mapArrayInteger = new HashMap<>(); + private Map> mapArrayInteger = null; public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - private Map> mapArrayAnytype = new HashMap<>(); + private Map> mapArrayAnytype = null; public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - private Map> mapMapString = new HashMap<>(); + private Map> mapMapString = null; public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - private Map> mapMapAnytype = new HashMap<>(); + private Map> mapMapAnytype = null; public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @@ -93,15 +99,22 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { return mapString; } + + public void setMapString(Map mapString) { this.mapString = mapString; } + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @@ -120,15 +133,22 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { return mapNumber; } + + public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; return this; } @@ -147,15 +167,22 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { return mapInteger; } + + public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; return this; } @@ -174,15 +201,22 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { return mapBoolean; } + + public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; return this; } @@ -201,15 +235,22 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; } + + public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; return this; } @@ -228,15 +269,22 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { return mapArrayAnytype; } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; return this; } @@ -255,15 +303,22 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; } + + public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; return this; } @@ -282,15 +337,22 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; } + + public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; return this; } @@ -301,15 +363,22 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { return anytype1; } + + public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @@ -320,15 +389,22 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { return anytype2; } + + public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @@ -339,10 +415,15 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { return anytype3; } + + public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 77388b95d868..e8da68432a48 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesInteger name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesInteger name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f0a3318bca14..b687c4a3d63c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesNumber name(String name) { + this.name = name; return this; } @@ -44,10 +50,15 @@ public AdditionalPropertiesNumber name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 19d772f45228..3b53f64f5efa 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesObject name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesObject name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 09e6431c9168..25186b7689d8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public AdditionalPropertiesString name(String name) { + this.name = name; return this; } @@ -43,10 +49,15 @@ public AdditionalPropertiesString name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index a2d34d82f47d..5adbea35179b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -22,10 +23,15 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -35,14 +41,14 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; + public Animal className(String className) { + this.className = className; return this; } @@ -52,15 +58,22 @@ public Animal className(String className) { * @return className **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { return className; } + + public void setClassName(String className) { this.className = className; } + public Animal color(String color) { + this.color = color; return this; } @@ -71,10 +84,15 @@ public Animal color(String color) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { return color; } + + public void setColor(String color) { this.color = color; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index ce83908187aa..42cb666ee58a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber = null; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { return arrayArrayNumber; } + + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ad502738c107..183ed21ce31a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,17 +24,22 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber = null; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; return this; } @@ -52,10 +58,15 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { return arrayNumber; } + + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index d0c2fc409c55..d18e80986aaf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,25 +24,30 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - private List arrayOfString = new ArrayList<>(); + private List arrayOfString = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger = null; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = null; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; return this; } @@ -60,15 +66,22 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { return arrayOfString; } + + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -87,15 +100,22 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -114,10 +134,15 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index 1d4ebff15336..7f9a94212049 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -15,42 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; return this; } @@ -61,15 +67,22 @@ public Capitalization smallCamel(String smallCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { return smallCamel; } + + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; return this; } @@ -80,15 +93,22 @@ public Capitalization capitalCamel(String capitalCamel) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { return capitalCamel; } + + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; return this; } @@ -99,15 +119,22 @@ public Capitalization smallSnake(String smallSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { return smallSnake; } + + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; return this; } @@ -118,15 +145,22 @@ public Capitalization capitalSnake(String capitalSnake) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { return capitalSnake; } + + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -137,15 +171,22 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; return this; } @@ -156,10 +197,15 @@ public Capitalization ATT_NAME(String ATT_NAME) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { return ATT_NAME; } + + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index 11ffa39d9823..ce0cd907f1d9 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -43,10 +49,15 @@ public Cat declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index 1c12b1972cf1..cd1b9c7d0efb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; return this; } @@ -41,10 +47,15 @@ public CatAllOf declawed(Boolean declawed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { return declawed; } + + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index 652d69552d12..7dfa56ee6879 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; + public Category id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Category id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Category name(String name) { + this.name = name; return this; } @@ -63,10 +76,15 @@ public Category name(String name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index 16036936e7a7..5bf9e79f4c74 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -42,10 +48,15 @@ public ClassModel propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index a5c065a1dd09..c3e7af6af849 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @JsonProperty(JSON_PROPERTY_CLIENT) private String client; + public Client client(String client) { + this.client = client; return this; } @@ -41,10 +47,15 @@ public Client client(String client) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { return client; } + + public void setClient(String client) { this.client = client; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index 7ac3c33202e4..7f4e9437f8a8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,17 +23,22 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public Dog breed(String breed) { + this.breed = breed; return this; } @@ -43,10 +49,15 @@ public Dog breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index b79847a96e48..182ea0f394e7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; - @JsonProperty(JSON_PROPERTY_BREED) private String breed; + public DogAllOf breed(String breed) { + this.breed = breed; return this; } @@ -41,10 +47,15 @@ public DogAllOf breed(String breed) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { return breed; } + + public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index 2db426ab8bf8..16d4f8bc2fff 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,10 +23,15 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** @@ -64,7 +70,6 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,10 +108,11 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum = null; + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; return this; } @@ -117,15 +123,22 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { return justSymbol; } + + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; return this; } @@ -144,10 +157,15 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { return arrayEnum; } + + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumClass.java index a4cc808868de..e9102d974276 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index bde85ff2a096..0dee6d3e21eb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -15,16 +15,25 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** @@ -65,7 +74,6 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +114,6 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -145,7 +152,6 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -184,14 +190,14 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; return this; } @@ -202,15 +208,22 @@ public EnumTest enumString(EnumStringEnum enumString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { return enumString; } + + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; return this; } @@ -220,15 +233,22 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * @return enumStringRequired **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; return this; } @@ -239,15 +259,22 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; return this; } @@ -258,15 +285,22 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { return enumNumber; } + + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; return this; } @@ -277,10 +311,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { return outerEnum; } + + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2c247d819cee..8d9d9801c23e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,21 +23,26 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; - @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files = null; + public FileSchemaTestClass file(java.io.File file) { + this.file = file; return this; } @@ -47,15 +53,22 @@ public FileSchemaTestClass file(java.io.File file) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public java.io.File getFile() { return file; } + + public void setFile(java.io.File file) { this.file = file; } + public FileSchemaTestClass files(List files) { + this.files = files; return this; } @@ -74,10 +87,15 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { return files; } + + public void setFiles(List files) { this.files = files; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index 1b9426d9ab62..ff59c313fc1a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -25,65 +26,70 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @JsonProperty(JSON_PROPERTY_INT64) private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; public static final String JSON_PROPERTY_STRING = "string"; - @JsonProperty(JSON_PROPERTY_STRING) private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @JsonProperty(JSON_PROPERTY_BINARY) private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; + public FormatTest integer(Integer integer) { + this.integer = integer; return this; } @@ -96,15 +102,22 @@ public FormatTest integer(Integer integer) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { return integer; } + + public void setInteger(Integer integer) { this.integer = integer; } + public FormatTest int32(Integer int32) { + this.int32 = int32; return this; } @@ -117,15 +130,22 @@ public FormatTest int32(Integer int32) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { return int32; } + + public void setInt32(Integer int32) { this.int32 = int32; } + public FormatTest int64(Long int64) { + this.int64 = int64; return this; } @@ -136,15 +156,22 @@ public FormatTest int64(Long int64) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { return int64; } + + public void setInt64(Long int64) { this.int64 = int64; } + public FormatTest number(BigDecimal number) { + this.number = number; return this; } @@ -156,15 +183,22 @@ public FormatTest number(BigDecimal number) { * @return number **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { return number; } + + public void setNumber(BigDecimal number) { this.number = number; } + public FormatTest _float(Float _float) { + this._float = _float; return this; } @@ -177,15 +211,22 @@ public FormatTest _float(Float _float) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { return _float; } + + public void setFloat(Float _float) { this._float = _float; } + public FormatTest _double(Double _double) { + this._double = _double; return this; } @@ -198,15 +239,22 @@ public FormatTest _double(Double _double) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { return _double; } + + public void setDouble(Double _double) { this._double = _double; } + public FormatTest string(String string) { + this.string = string; return this; } @@ -217,15 +265,22 @@ public FormatTest string(String string) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { return string; } + + public void setString(String string) { this.string = string; } + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; return this; } @@ -235,15 +290,22 @@ public FormatTest _byte(byte[] _byte) { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { return _byte; } + + public void setByte(byte[] _byte) { this._byte = _byte; } + public FormatTest binary(File binary) { + this.binary = binary; return this; } @@ -254,15 +316,22 @@ public FormatTest binary(File binary) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { return binary; } + + public void setBinary(File binary) { this.binary = binary; } + public FormatTest date(LocalDate date) { + this.date = date; return this; } @@ -272,15 +341,22 @@ public FormatTest date(LocalDate date) { * @return date **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { return date; } + + public void setDate(LocalDate date) { this.date = date; } + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -291,15 +367,22 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -310,15 +393,22 @@ public FormatTest uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public FormatTest password(String password) { + this.password = password; return this; } @@ -328,10 +418,15 @@ public FormatTest password(String password) { * @return password **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ad6b28d9d1e9..0a3f0d464360 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -15,46 +15,62 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @JsonProperty(JSON_PROPERTY_FOO) private String foo; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + /** * Get foo * @return foo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { return foo; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 021d59d2570c..3f48b4f8a065 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,15 +24,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - private Map> mapMapOfString = new HashMap<>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -69,18 +76,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - private Map mapOfEnumString = new HashMap<>(); + private Map mapOfEnumString = null; public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - private Map directMap = new HashMap<>(); + private Map directMap = null; public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - private Map indirectMap = new HashMap<>(); + private Map indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; return this; } @@ -99,15 +105,22 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { return mapMapOfString; } + + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; return this; } @@ -126,15 +139,22 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { return mapOfEnumString; } + + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; return this; } @@ -153,15 +173,22 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { return directMap; } + + public void setDirectMap(Map directMap) { this.directMap = directMap; } + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; return this; } @@ -180,10 +207,15 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { return indirectMap; } + + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ad173f004a1c..110378778074 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -26,25 +27,30 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @JsonProperty(JSON_PROPERTY_MAP) - private Map map = new HashMap<>(); + private Map map = null; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; return this; } @@ -55,15 +61,22 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { return uuid; } + + public void setUuid(UUID uuid) { this.uuid = uuid; } + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; return this; } @@ -74,15 +87,22 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { return dateTime; } + + public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; return this; } @@ -101,10 +121,15 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { return map; } + + public void setMap(Map map) { this.map = map; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index d86df5d7eab1..b50537b496b2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -15,27 +15,33 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; + public Model200Response name(Integer name) { + this.name = name; return this; } @@ -46,15 +52,22 @@ public Model200Response name(Integer name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } @@ -65,10 +78,15 @@ public Model200Response propertyClass(String propertyClass) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { return propertyClass; } + + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 4c9a7f87b5a6..d39352361596 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -15,30 +15,36 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @JsonProperty(JSON_PROPERTY_CODE) private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @JsonProperty(JSON_PROPERTY_TYPE) private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; + public ModelApiResponse code(Integer code) { + this.code = code; return this; } @@ -49,15 +55,22 @@ public ModelApiResponse code(Integer code) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { return code; } + + public void setCode(Integer code) { this.code = code; } + public ModelApiResponse type(String type) { + this.type = type; return this; } @@ -68,15 +81,22 @@ public ModelApiResponse type(String type) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { return type; } + + public void setType(String type) { this.type = type; } + public ModelApiResponse message(String message) { + this.message = message; return this; } @@ -87,10 +107,15 @@ public ModelApiResponse message(String message) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { return message; } + + public void setMessage(String message) { this.message = message; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 9c9ac21a3fb7..6f66b80b2d13 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; + public ModelReturn _return(Integer _return) { + this._return = _return; return this; } @@ -42,10 +48,15 @@ public ModelReturn _return(Integer _return) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { return _return; } + + public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 47f89c54361f..e53996cb041f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -15,35 +15,41 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; + public Name name(Integer name) { + this.name = name; return this; } @@ -53,25 +59,38 @@ public Name name(Integer name) { * @return name **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { return name; } + + public void setName(Integer name) { this.name = name; } + /** * Get snakeCase * @return snakeCase **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { return snakeCase; } + + + public Name property(String property) { + this.property = property; return this; } @@ -82,25 +101,36 @@ public Name property(String property) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { return property; } + + public void setProperty(String property) { this.property = property; } + /** * Get _123number * @return _123number **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { return _123number; } + + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index f5331da226e7..f7f7722a99f1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -15,23 +15,29 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; return this; } @@ -42,10 +48,15 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { return justNumber; } + + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index 0730133f9cbd..ffea4083f904 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -15,32 +15,38 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -81,14 +87,14 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; + public Order id(Long id) { + this.id = id; return this; } @@ -99,15 +105,22 @@ public Order id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Order petId(Long petId) { + this.petId = petId; return this; } @@ -118,15 +131,22 @@ public Order petId(Long petId) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { return petId; } + + public void setPetId(Long petId) { this.petId = petId; } + public Order quantity(Integer quantity) { + this.quantity = quantity; return this; } @@ -137,15 +157,22 @@ public Order quantity(Integer quantity) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { return quantity; } + + public void setQuantity(Integer quantity) { this.quantity = quantity; } + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; return this; } @@ -156,15 +183,22 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { return shipDate; } + + public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + public Order status(StatusEnum status) { + this.status = status; return this; } @@ -175,15 +209,22 @@ public Order status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } + public Order complete(Boolean complete) { + this.complete = complete; return this; } @@ -194,10 +235,15 @@ public Order complete(Boolean complete) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { return complete; } + + public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 7193ba2a0c91..3082797d36a7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -15,31 +15,37 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; return this; } @@ -50,15 +56,22 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { return myNumber; } + + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + public OuterComposite myString(String myString) { + this.myString = myString; return this; } @@ -69,15 +82,22 @@ public OuterComposite myString(String myString) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { return myString; } + + public void setMyString(String myString) { this.myString = myString; } + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; return this; } @@ -88,10 +108,15 @@ public OuterComposite myBoolean(Boolean myBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { return myBoolean; } + + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterEnum.java index dacbbdfb2c91..308646a320c7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index b8e18631bf1a..30bd83db599a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -24,31 +25,35 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags = null; /** * pet status in the store @@ -88,10 +93,11 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; + public Pet id(Long id) { + this.id = id; return this; } @@ -102,15 +108,22 @@ public Pet id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Pet category(Category category) { + this.category = category; return this; } @@ -121,15 +134,22 @@ public Pet category(Category category) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; } + public Pet name(String name) { + this.name = name; return this; } @@ -139,15 +159,22 @@ public Pet name(String name) { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; return this; } @@ -162,15 +189,22 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { return photoUrls; } + + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + public Pet tags(List tags) { + this.tags = tags; return this; } @@ -189,15 +223,22 @@ public Pet addTagsItem(Tag tagsItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { return tags; } + + public void setTags(List tags) { this.tags = tags; } + public Pet status(StatusEnum status) { + this.status = status; return this; } @@ -208,10 +249,15 @@ public Pet status(StatusEnum status) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { return status; } + + public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b0949b9e2eac..7317b779090b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -15,36 +15,48 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @JsonProperty(JSON_PROPERTY_BAR) private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @JsonProperty(JSON_PROPERTY_BAZ) private String baz; + /** * Get bar * @return bar **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { return bar; } + + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; return this; } @@ -55,10 +67,15 @@ public ReadOnlyFirst baz(String baz) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { return baz; } + + public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index a9d03234061e..f43fc00dda24 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -15,22 +15,28 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @@ -41,10 +47,15 @@ public class SpecialModelName { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { return $specialPropertyName; } + + public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index 45f17b22cf38..f4b0cc056c93 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -15,26 +15,32 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @JsonProperty(JSON_PROPERTY_NAME) private String name; + public Tag id(Long id) { + this.id = id; return this; } @@ -45,15 +51,22 @@ public Tag id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public Tag name(String name) { + this.name = name; return this; } @@ -64,10 +77,15 @@ public Tag name(String name) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { return name; } + + public void setName(String name) { this.name = name; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3f3030998f13..85e9389c1eea 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,38 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +65,22 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +90,22 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +115,22 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +140,22 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +170,15 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 99ddaa8d2eb8..158636a401fe 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,33 +24,42 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; return this; } @@ -59,15 +69,22 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem **/ @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { return stringItem; } + + public void setStringItem(String stringItem) { this.stringItem = stringItem; } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; return this; } @@ -77,15 +94,47 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem **/ @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { return numberItem; } + + public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; return this; } @@ -95,15 +144,22 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem **/ @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { return integerItem; } + + public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; return this; } @@ -113,15 +169,22 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem **/ @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { return boolItem; } + + public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; return this; } @@ -136,10 +199,15 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem **/ @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { return arrayItem; } + + public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -156,6 +224,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +232,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -173,6 +242,7 @@ public String toString() { sb.append("class TypeHolderExample {\n"); sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 9ce7869e755f..da0fd2d11912 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -15,50 +15,56 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; - @JsonProperty(JSON_PROPERTY_ID) private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @JsonProperty(JSON_PROPERTY_USERNAME) private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @JsonProperty(JSON_PROPERTY_EMAIL) private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @JsonProperty(JSON_PROPERTY_PHONE) private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; + public User id(Long id) { + this.id = id; return this; } @@ -69,15 +75,22 @@ public User id(Long id) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { return id; } + + public void setId(Long id) { this.id = id; } + public User username(String username) { + this.username = username; return this; } @@ -88,15 +101,22 @@ public User username(String username) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { return username; } + + public void setUsername(String username) { this.username = username; } + public User firstName(String firstName) { + this.firstName = firstName; return this; } @@ -107,15 +127,22 @@ public User firstName(String firstName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { return firstName; } + + public void setFirstName(String firstName) { this.firstName = firstName; } + public User lastName(String lastName) { + this.lastName = lastName; return this; } @@ -126,15 +153,22 @@ public User lastName(String lastName) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { return lastName; } + + public void setLastName(String lastName) { this.lastName = lastName; } + public User email(String email) { + this.email = email; return this; } @@ -145,15 +179,22 @@ public User email(String email) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { return email; } + + public void setEmail(String email) { this.email = email; } + public User password(String password) { + this.password = password; return this; } @@ -164,15 +205,22 @@ public User password(String password) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { return password; } + + public void setPassword(String password) { this.password = password; } + public User phone(String phone) { + this.phone = phone; return this; } @@ -183,15 +231,22 @@ public User phone(String phone) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { return phone; } + + public void setPhone(String phone) { this.phone = phone; } + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; return this; } @@ -202,10 +257,15 @@ public User userStatus(Integer userStatus) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { return userStatus; } + + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java index 66404193208f..da87f2d68304 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,129 +24,134 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray = null; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray = null; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray = null; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray = null; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray = null; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray = null; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray = null; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray = null; + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; return this; } @@ -156,15 +162,22 @@ public XmlItem attributeString(String attributeString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { return attributeString; } + + public void setAttributeString(String attributeString) { this.attributeString = attributeString; } + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; return this; } @@ -175,15 +188,22 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { return attributeNumber; } + + public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; return this; } @@ -194,15 +214,22 @@ public XmlItem attributeInteger(Integer attributeInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { return attributeInteger; } + + public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; return this; } @@ -213,15 +240,22 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { return attributeBoolean; } + + public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; return this; } @@ -240,15 +274,22 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { return wrappedArray; } + + public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } + public XmlItem nameString(String nameString) { + this.nameString = nameString; return this; } @@ -259,15 +300,22 @@ public XmlItem nameString(String nameString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { return nameString; } + + public void setNameString(String nameString) { this.nameString = nameString; } + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; return this; } @@ -278,15 +326,22 @@ public XmlItem nameNumber(BigDecimal nameNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { return nameNumber; } + + public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; return this; } @@ -297,15 +352,22 @@ public XmlItem nameInteger(Integer nameInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { return nameInteger; } + + public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; return this; } @@ -316,15 +378,22 @@ public XmlItem nameBoolean(Boolean nameBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { return nameBoolean; } + + public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; return this; } @@ -343,15 +412,22 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { return nameArray; } + + public void setNameArray(List nameArray) { this.nameArray = nameArray; } + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; return this; } @@ -370,15 +446,22 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { return nameWrappedArray; } + + public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; return this; } @@ -389,15 +472,22 @@ public XmlItem prefixString(String prefixString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { return prefixString; } + + public void setPrefixString(String prefixString) { this.prefixString = prefixString; } + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; return this; } @@ -408,15 +498,22 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { return prefixNumber; } + + public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; return this; } @@ -427,15 +524,22 @@ public XmlItem prefixInteger(Integer prefixInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { return prefixInteger; } + + public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; return this; } @@ -446,15 +550,22 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { return prefixBoolean; } + + public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; return this; } @@ -473,15 +584,22 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { return prefixArray; } + + public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; return this; } @@ -500,15 +618,22 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { return prefixWrappedArray; } + + public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; return this; } @@ -519,15 +644,22 @@ public XmlItem namespaceString(String namespaceString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { return namespaceString; } + + public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; return this; } @@ -538,15 +670,22 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { return namespaceNumber; } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; return this; } @@ -557,15 +696,22 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { return namespaceInteger; } + + public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; return this; } @@ -576,15 +722,22 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { return namespaceBoolean; } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; return this; } @@ -603,15 +756,22 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { return namespaceArray; } + + public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; return this; } @@ -630,15 +790,22 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; return this; } @@ -649,15 +816,22 @@ public XmlItem prefixNsString(String prefixNsString) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { return prefixNsString; } + + public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; return this; } @@ -668,15 +842,22 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; return this; } @@ -687,15 +868,22 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { return prefixNsInteger; } + + public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; return this; } @@ -706,15 +894,22 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { **/ @javax.annotation.Nullable @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; return this; } @@ -733,15 +928,22 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { return prefixNsArray; } + + public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; return this; } @@ -760,10 +962,15 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { **/ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION b/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject.js b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject.js new file mode 100644 index 000000000000..99eff4f58385 --- /dev/null +++ b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject.js @@ -0,0 +1,21 @@ +goog.provide('API.Client.inline_object'); + +/** + * @record + */ +API.Client.InlineObject = function() {} + +/** + * Updated name of the pet + * @type {!string} + * @export + */ +API.Client.InlineObject.prototype.name; + +/** + * Updated status of the pet + * @type {!string} + * @export + */ +API.Client.InlineObject.prototype.status; + diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject1.js b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject1.js new file mode 100644 index 000000000000..745eaacd234e --- /dev/null +++ b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject1.js @@ -0,0 +1,21 @@ +goog.provide('API.Client.inline_object_1'); + +/** + * @record + */ +API.Client.InlineObject1 = function() {} + +/** + * Additional data to pass to server + * @type {!string} + * @export + */ +API.Client.InlineObject1.prototype.additionalMetadata; + +/** + * file to upload + * @type {!Object} + * @export + */ +API.Client.InlineObject1.prototype.file; + diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js index 6d065b731c50..7c217bd6291a 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js @@ -165,10 +165,11 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param {!Array} tags Tags to filter by + * @param {!number=} opt_maxCount Maximum number of items to return * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise>} */ -API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_maxCount, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet/findByTags'; @@ -185,6 +186,10 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest queryParameters['tags'] = tags; } + if (opt_maxCount !== undefined) { + queryParameters['maxCount'] = opt_maxCount; + } + /** @type {!Object} */ var httpRequestParams = { method: 'GET', diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.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/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index d66a692c691a..711b08bb799e 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index c46ac4f53833..46868a5f7d4d 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -671,3 +672,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let pipe = ["null"]; // [String] | +let ioutil = ["null"]; // [String] | +let http = ["null"]; // [String] | +let url = ["null"]; // [String] | +let context = ["null"]; // [String] | +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### 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/javascript-es6/docs/TypeHolderExample.md b/samples/client/petstore/javascript-es6/docs/TypeHolderExample.md index 142d4268b574..44ba1e3aef7f 100644 --- a/samples/client/petstore/javascript-es6/docs/TypeHolderExample.md +++ b/samples/client/petstore/javascript-es6/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | **Number** | | +**floatItem** | **Number** | | **integerItem** | **Number** | | **boolItem** | **Boolean** | | **arrayItem** | **[Number]** | | diff --git a/samples/client/petstore/javascript-es6/git_push.sh b/samples/client/petstore/javascript-es6/git_push.sh index 04dd5df38e83..ced3be2b0c7b 100644 --- a/samples/client/petstore/javascript-es6/git_push.sh +++ b/samples/client/petstore/javascript-es6/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -36,10 +42,10 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 24b2405dc923..854b8face478 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -647,5 +647,70 @@ export default class FakeApi { ); } + /** + * Callback function to receive the result of the testQueryParameterCollectionFormat operation. + * @callback module:api/FakeApi~testQueryParameterCollectionFormatCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response + */ + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, callback) { + let postBody = null; + // verify the required parameter 'pipe' is set + if (pipe === undefined || pipe === null) { + throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil === undefined || ioutil === null) { + throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http === undefined || http === null) { + throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url === undefined || url === null) { + throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context === undefined || context === null) { + throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + let pathParams = { + }; + let queryParams = { + 'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'), + 'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'), + 'http': this.apiClient.buildCollectionParam(http, 'space'), + 'url': this.apiClient.buildCollectionParam(url, 'csv'), + 'context': this.apiClient.buildCollectionParam(context, 'multi') + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/fake/test-query-paramters', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + } diff --git a/samples/client/petstore/javascript-es6/src/model/TypeHolderExample.js b/samples/client/petstore/javascript-es6/src/model/TypeHolderExample.js index 523f16e45391..fa969870f8fa 100644 --- a/samples/client/petstore/javascript-es6/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript-es6/src/model/TypeHolderExample.js @@ -24,13 +24,14 @@ class TypeHolderExample { * @alias module:model/TypeHolderExample * @param stringItem {String} * @param numberItem {Number} + * @param floatItem {Number} * @param integerItem {Number} * @param boolItem {Boolean} * @param arrayItem {Array.} */ - constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) { + constructor(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem) { - TypeHolderExample.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem); + TypeHolderExample.initialize(this, stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } /** @@ -38,9 +39,10 @@ class TypeHolderExample { * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). * Only for internal use. */ - static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) { + static initialize(obj, stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem) { obj['string_item'] = stringItem; obj['number_item'] = numberItem; + obj['float_item'] = floatItem; obj['integer_item'] = integerItem; obj['bool_item'] = boolItem; obj['array_item'] = arrayItem; @@ -63,6 +65,9 @@ class TypeHolderExample { if (data.hasOwnProperty('number_item')) { obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number'); } + if (data.hasOwnProperty('float_item')) { + obj['float_item'] = ApiClient.convertToType(data['float_item'], 'Number'); + } if (data.hasOwnProperty('integer_item')) { obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number'); } @@ -89,6 +94,11 @@ TypeHolderExample.prototype['string_item'] = undefined; */ TypeHolderExample.prototype['number_item'] = undefined; +/** + * @member {Number} float_item + */ +TypeHolderExample.prototype['float_item'] = undefined; + /** * @member {Number} integer_item */ diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.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/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index a37ff17a1088..b325aae54043 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -132,6 +132,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 88125f185d85..f28125722b03 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -658,3 +659,55 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let pipe = ["null"]; // [String] | +let ioutil = ["null"]; // [String] | +let http = ["null"]; // [String] | +let url = ["null"]; // [String] | +let context = ["null"]; // [String] | +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### 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/javascript-promise-es6/docs/TypeHolderExample.md b/samples/client/petstore/javascript-promise-es6/docs/TypeHolderExample.md index 142d4268b574..44ba1e3aef7f 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/TypeHolderExample.md +++ b/samples/client/petstore/javascript-promise-es6/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | **Number** | | +**floatItem** | **Number** | | **integerItem** | **Number** | | **boolItem** | **Boolean** | | **arrayItem** | **[Number]** | | diff --git a/samples/client/petstore/javascript-promise-es6/git_push.sh b/samples/client/petstore/javascript-promise-es6/git_push.sh index 04dd5df38e83..ced3be2b0c7b 100644 --- a/samples/client/petstore/javascript-promise-es6/git_push.sh +++ b/samples/client/petstore/javascript-promise-es6/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -36,10 +42,10 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 18b335d4def0..f8b26290b2b6 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -746,4 +746,78 @@ export default class FakeApi { } + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) { + let postBody = null; + // verify the required parameter 'pipe' is set + if (pipe === undefined || pipe === null) { + throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil === undefined || ioutil === null) { + throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http === undefined || http === null) { + throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url === undefined || url === null) { + throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context === undefined || context === null) { + throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + let pathParams = { + }; + let queryParams = { + 'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'), + 'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'), + 'http': this.apiClient.buildCollectionParam(http, 'space'), + 'url': this.apiClient.buildCollectionParam(url, 'csv'), + 'context': this.apiClient.buildCollectionParam(context, 'multi') + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = []; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/fake/test-query-paramters', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) { + return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + } diff --git a/samples/client/petstore/javascript-promise-es6/src/model/TypeHolderExample.js b/samples/client/petstore/javascript-promise-es6/src/model/TypeHolderExample.js index 523f16e45391..fa969870f8fa 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/TypeHolderExample.js @@ -24,13 +24,14 @@ class TypeHolderExample { * @alias module:model/TypeHolderExample * @param stringItem {String} * @param numberItem {Number} + * @param floatItem {Number} * @param integerItem {Number} * @param boolItem {Boolean} * @param arrayItem {Array.} */ - constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) { + constructor(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem) { - TypeHolderExample.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem); + TypeHolderExample.initialize(this, stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } /** @@ -38,9 +39,10 @@ class TypeHolderExample { * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). * Only for internal use. */ - static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) { + static initialize(obj, stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem) { obj['string_item'] = stringItem; obj['number_item'] = numberItem; + obj['float_item'] = floatItem; obj['integer_item'] = integerItem; obj['bool_item'] = boolItem; obj['array_item'] = arrayItem; @@ -63,6 +65,9 @@ class TypeHolderExample { if (data.hasOwnProperty('number_item')) { obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number'); } + if (data.hasOwnProperty('float_item')) { + obj['float_item'] = ApiClient.convertToType(data['float_item'], 'Number'); + } if (data.hasOwnProperty('integer_item')) { obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number'); } @@ -89,6 +94,11 @@ TypeHolderExample.prototype['string_item'] = undefined; */ TypeHolderExample.prototype['number_item'] = undefined; +/** + * @member {Number} float_item + */ +TypeHolderExample.prototype['float_item'] = undefined; + /** * @member {Number} integer_item */ diff --git a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise/.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/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 1e20aa84af1c..95124df42847 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -120,6 +120,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-promise/docs/FakeApi.md b/samples/client/petstore/javascript-promise/docs/FakeApi.md index b5a3986744a0..37ce18eea22e 100644 --- a/samples/client/petstore/javascript-promise/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -671,3 +672,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +var OpenApiPetstore = require('open_api_petstore'); + +var apiInstance = new OpenApiPetstore.FakeApi(); +var pipe = ["null"]; // [String] | +var ioutil = ["null"]; // [String] | +var http = ["null"]; // [String] | +var url = ["null"]; // [String] | +var context = ["null"]; // [String] | +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context).then(function() { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### 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/javascript-promise/docs/TypeHolderExample.md b/samples/client/petstore/javascript-promise/docs/TypeHolderExample.md index 142d4268b574..44ba1e3aef7f 100644 --- a/samples/client/petstore/javascript-promise/docs/TypeHolderExample.md +++ b/samples/client/petstore/javascript-promise/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | **Number** | | +**floatItem** | **Number** | | **integerItem** | **Number** | | **boolItem** | **Boolean** | | **arrayItem** | **[Number]** | | diff --git a/samples/client/petstore/javascript-promise/git_push.sh b/samples/client/petstore/javascript-promise/git_push.sh index 04dd5df38e83..ced3be2b0c7b 100644 --- a/samples/client/petstore/javascript-promise/git_push.sh +++ b/samples/client/petstore/javascript-promise/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -36,10 +42,10 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/javascript-promise/package.json b/samples/client/petstore/javascript-promise/package.json index 5a24b0488c59..d194fab67c27 100644 --- a/samples/client/petstore/javascript-promise/package.json +++ b/samples/client/petstore/javascript-promise/package.json @@ -11,7 +11,7 @@ "fs": false }, "dependencies": { - "superagent": "3.7.0" + "superagent": "5.1.0" }, "devDependencies": { "expect.js": "^0.3.1", diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 1734d524fb06..29ed1e076b75 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 a7f790440a06..74f778a6bfee 100644 --- a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d5a4c3534538..3800f2cf8bf5 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * Do not edit the class manually. * @@ -782,6 +782,97 @@ return response_and_data.data; }); } + + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + this.testQueryParameterCollectionFormatWithHttpInfo = function(pipe, ioutil, http, url, context) { + var postBody = null; + // verify the required parameter 'pipe' is set + if (pipe === undefined || pipe === null) { + throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil === undefined || ioutil === null) { + throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http === undefined || http === null) { + throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url === undefined || url === null) { + throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context === undefined || context === null) { + throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + 'pipe': { + value: pipe, + collectionFormat: 'csv' + }, + 'ioutil': { + value: ioutil, + collectionFormat: 'csv' + }, + 'http': { + value: http, + collectionFormat: 'space' + }, + 'url': { + value: url, + collectionFormat: 'csv' + }, + 'context': { + value: context, + collectionFormat: 'multi' + }, + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = null; + return this.apiClient.callApi( + '/fake/test-query-paramters', 'PUT', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testQueryParameterCollectionFormat = function(pipe, ioutil, http, url, context) { + return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) + .then(function(response_and_data) { + return response_and_data.data; + }); + } }; return exports; diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js index 19561a368b47..2a0a629cb425 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 e38d94bbacdd..fd64a8dfee93 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8301399541dd..031d73f35d7a 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 53eb96980ca9..382a7357f6c8 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 a92a4ab5a22f..cecf2c59213a 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f6bd3640800a..d7d95d6f3d83 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d36ecc495ed4..95aaebf7fe34 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 7d063336200b..76b95bbaf41d 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 37161bd8c3b9..3717f057a7d7 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d9e860e64707..ed0ca18ae558 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f299469e4508..a9effc216a2a 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 49f7aef8b325..7ecf4647415d 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 68a58595cb96..9821bda6f369 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 0c4edc9a3808..f8005b361620 100644 --- a/samples/client/petstore/javascript-promise/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise/src/model/Animal.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 efd7fdf421d2..6011f93e75b2 100644 --- a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 fdf87fde4eb7..bb7dd73d559e 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 2b24c19bfeae..7d80c845e825 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 60600762ce14..efe293ba6757 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 bdba5b0cc38e..b3207c9a0699 100644 --- a/samples/client/petstore/javascript-promise/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise/src/model/Capitalization.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f5f9ebf49a76..73da1a524a7c 100644 --- a/samples/client/petstore/javascript-promise/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise/src/model/Cat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 b64eee29e11a..5d4d19b002cc 100644 --- a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 a8fa9b082f0c..d3f8d2aa0e2a 100644 --- a/samples/client/petstore/javascript-promise/src/model/Category.js +++ b/samples/client/petstore/javascript-promise/src/model/Category.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 13e05a6f3616..2373b3137865 100644 --- a/samples/client/petstore/javascript-promise/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise/src/model/ClassModel.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 aa4ca0493f58..f02a07582915 100644 --- a/samples/client/petstore/javascript-promise/src/model/Client.js +++ b/samples/client/petstore/javascript-promise/src/model/Client.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 138d5d13fb0f..b6fe9b5049c1 100644 --- a/samples/client/petstore/javascript-promise/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise/src/model/Dog.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 5d6a9a1072d9..9eacf74d93ac 100644 --- a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8580dfd308fc..8304294fdadf 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 9c335fdfbb0d..aa25795818c8 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 038926ccdb88..2efaa249e18d 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8042cfad4b9a..88b1399c8197 100644 --- a/samples/client/petstore/javascript-promise/src/model/File.js +++ b/samples/client/petstore/javascript-promise/src/model/File.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 e29880db9aee..69e6dcade164 100644 --- a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 5772988329a0..8866361379df 100644 --- a/samples/client/petstore/javascript-promise/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise/src/model/FormatTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 3fe20b3023a3..312ef38e1836 100644 --- a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 7aa754788449..f4c27ceaea8d 100644 --- a/samples/client/petstore/javascript-promise/src/model/List.js +++ b/samples/client/petstore/javascript-promise/src/model/List.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d04243f15df0..8b678073ab0e 100644 --- a/samples/client/petstore/javascript-promise/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise/src/model/MapTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 c5461ad5476e..7fa59aaf15f3 100644 --- a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 078f612468a8..5b6d8743c591 100644 --- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f2c210aeb0d5..a345caa97499 100644 --- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8e2caf658e24..602b72337167 100644 --- a/samples/client/petstore/javascript-promise/src/model/Name.js +++ b/samples/client/petstore/javascript-promise/src/model/Name.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 3d99a053817d..6d81191fa44f 100644 --- a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 4b4250c6a74e..0751dc6135d8 100644 --- a/samples/client/petstore/javascript-promise/src/model/Order.js +++ b/samples/client/petstore/javascript-promise/src/model/Order.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 99e0a5c5d974..4d0e2b48f689 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 03931bc72322..623e129d20ba 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 0c1fdcd196eb..05869ad02b97 100644 --- a/samples/client/petstore/javascript-promise/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise/src/model/Pet.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 72c17a9f3e01..fd5fa4e34b45 100644 --- a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f1fc92e8f310..ee7294ffaa6a 100644 --- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 953b2938d3f9..1bafd62e191e 100644 --- a/samples/client/petstore/javascript-promise/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise/src/model/Tag.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 187d7930a9eb..a60013ff60e4 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 504ba75bfccf..fe9658132a1f 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * Do not edit the class manually. * @@ -44,15 +44,17 @@ * @class * @param stringItem {String} * @param numberItem {Number} + * @param floatItem {Number} * @param integerItem {Number} * @param boolItem {Boolean} * @param arrayItem {Array.} */ - var exports = function(stringItem, numberItem, integerItem, boolItem, arrayItem) { + var exports = function(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem) { var _this = this; _this['string_item'] = stringItem; _this['number_item'] = numberItem; + _this['float_item'] = floatItem; _this['integer_item'] = integerItem; _this['bool_item'] = boolItem; _this['array_item'] = arrayItem; @@ -74,6 +76,9 @@ if (data.hasOwnProperty('number_item')) { obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number'); } + if (data.hasOwnProperty('float_item')) { + obj['float_item'] = ApiClient.convertToType(data['float_item'], 'Number'); + } if (data.hasOwnProperty('integer_item')) { obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number'); } @@ -95,6 +100,10 @@ * @member {Number} number_item */ exports.prototype['number_item'] = undefined; + /** + * @member {Number} float_item + */ + exports.prototype['float_item'] = undefined; /** * @member {Number} integer_item */ diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index 1cb456b754fd..d62b9ec76640 100644 --- a/samples/client/petstore/javascript-promise/src/model/User.js +++ b/samples/client/petstore/javascript-promise/src/model/User.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 1d3419997f09..744060478d68 100644 --- a/samples/client/petstore/javascript-promise/src/model/XmlItem.js +++ b/samples/client/petstore/javascript-promise/src/model/XmlItem.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/javascript/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript/.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/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 153f22fa4e4c..c11860f76757 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -123,6 +123,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md index b2d599002dad..24e490409e6d 100644 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ b/samples/client/petstore/javascript/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -697,3 +698,58 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +var OpenApiPetstore = require('open_api_petstore'); + +var apiInstance = new OpenApiPetstore.FakeApi(); +var pipe = ["null"]; // [String] | +var ioutil = ["null"]; // [String] | +var http = ["null"]; // [String] | +var url = ["null"]; // [String] | +var context = ["null"]; // [String] | +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}; +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, callback); +``` + +### Parameters + + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### 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/javascript/docs/TypeHolderExample.md b/samples/client/petstore/javascript/docs/TypeHolderExample.md index 142d4268b574..44ba1e3aef7f 100644 --- a/samples/client/petstore/javascript/docs/TypeHolderExample.md +++ b/samples/client/petstore/javascript/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **stringItem** | **String** | | **numberItem** | **Number** | | +**floatItem** | **Number** | | **integerItem** | **Number** | | **boolItem** | **Boolean** | | **arrayItem** | **[Number]** | | diff --git a/samples/client/petstore/javascript/git_push.sh b/samples/client/petstore/javascript/git_push.sh index 04dd5df38e83..ced3be2b0c7b 100644 --- a/samples/client/petstore/javascript/git_push.sh +++ b/samples/client/petstore/javascript/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -36,10 +42,10 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/javascript/package.json b/samples/client/petstore/javascript/package.json index 5a24b0488c59..d194fab67c27 100644 --- a/samples/client/petstore/javascript/package.json +++ b/samples/client/petstore/javascript/package.json @@ -11,7 +11,7 @@ "fs": false }, "dependencies": { - "superagent": "3.7.0" + "superagent": "5.1.0" }, "devDependencies": { "expect.js": "^0.3.1", diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index e7e8ba7491d9..967190b9b541 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 6b31599a377d..8035a77c3fab 100644 --- a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 fc77d90b9106..2d193bd4f238 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * Do not edit the class manually. * @@ -684,6 +684,88 @@ authNames, contentTypes, accepts, returnType, null, callback ); } + + /** + * Callback function to receive the result of the testQueryParameterCollectionFormat operation. + * @callback module:api/FakeApi~testQueryParameterCollectionFormatCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response + */ + this.testQueryParameterCollectionFormat = function(pipe, ioutil, http, url, context, callback) { + var postBody = null; + // verify the required parameter 'pipe' is set + if (pipe === undefined || pipe === null) { + throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil === undefined || ioutil === null) { + throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http === undefined || http === null) { + throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url === undefined || url === null) { + throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context === undefined || context === null) { + throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + 'pipe': { + value: pipe, + collectionFormat: 'csv' + }, + 'ioutil': { + value: ioutil, + collectionFormat: 'csv' + }, + 'http': { + value: http, + collectionFormat: 'space' + }, + 'url': { + value: url, + collectionFormat: 'csv' + }, + 'context': { + value: context, + collectionFormat: 'multi' + }, + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = null; + return this.apiClient.callApi( + '/fake/test-query-paramters', 'PUT', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } }; return exports; diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js index ffa2dc40733e..4b5656563c5c 100644 --- a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 17255a361b04..17d669d87b16 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f51e3b64a5de..f7ff37301eac 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 0999e8ab4d30..4def0c296529 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 a92a4ab5a22f..cecf2c59213a 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f6bd3640800a..d7d95d6f3d83 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d36ecc495ed4..95aaebf7fe34 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 7d063336200b..76b95bbaf41d 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 37161bd8c3b9..3717f057a7d7 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d9e860e64707..ed0ca18ae558 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f299469e4508..a9effc216a2a 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 49f7aef8b325..7ecf4647415d 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 68a58595cb96..9821bda6f369 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 0c4edc9a3808..f8005b361620 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 efd7fdf421d2..6011f93e75b2 100644 --- a/samples/client/petstore/javascript/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 fdf87fde4eb7..bb7dd73d559e 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 2b24c19bfeae..7d80c845e825 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 60600762ce14..efe293ba6757 100644 --- a/samples/client/petstore/javascript/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 bdba5b0cc38e..b3207c9a0699 100644 --- a/samples/client/petstore/javascript/src/model/Capitalization.js +++ b/samples/client/petstore/javascript/src/model/Capitalization.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f5f9ebf49a76..73da1a524a7c 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 b64eee29e11a..5d4d19b002cc 100644 --- a/samples/client/petstore/javascript/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript/src/model/CatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 a8fa9b082f0c..d3f8d2aa0e2a 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 13e05a6f3616..2373b3137865 100644 --- a/samples/client/petstore/javascript/src/model/ClassModel.js +++ b/samples/client/petstore/javascript/src/model/ClassModel.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 aa4ca0493f58..f02a07582915 100644 --- a/samples/client/petstore/javascript/src/model/Client.js +++ b/samples/client/petstore/javascript/src/model/Client.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 138d5d13fb0f..b6fe9b5049c1 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 5d6a9a1072d9..9eacf74d93ac 100644 --- a/samples/client/petstore/javascript/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript/src/model/DogAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8580dfd308fc..8304294fdadf 100644 --- a/samples/client/petstore/javascript/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript/src/model/EnumArrays.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 9c335fdfbb0d..aa25795818c8 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 038926ccdb88..2efaa249e18d 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8042cfad4b9a..88b1399c8197 100644 --- a/samples/client/petstore/javascript/src/model/File.js +++ b/samples/client/petstore/javascript/src/model/File.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 e29880db9aee..69e6dcade164 100644 --- a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 5772988329a0..8866361379df 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 3fe20b3023a3..312ef38e1836 100644 --- a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 7aa754788449..f4c27ceaea8d 100644 --- a/samples/client/petstore/javascript/src/model/List.js +++ b/samples/client/petstore/javascript/src/model/List.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 d04243f15df0..8b678073ab0e 100644 --- a/samples/client/petstore/javascript/src/model/MapTest.js +++ b/samples/client/petstore/javascript/src/model/MapTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 c5461ad5476e..7fa59aaf15f3 100644 --- a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 078f612468a8..5b6d8743c591 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f2c210aeb0d5..a345caa97499 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 8e2caf658e24..602b72337167 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 3d99a053817d..6d81191fa44f 100644 --- a/samples/client/petstore/javascript/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript/src/model/NumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 4b4250c6a74e..0751dc6135d8 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 99e0a5c5d974..4d0e2b48f689 100644 --- a/samples/client/petstore/javascript/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 03931bc72322..623e129d20ba 100644 --- a/samples/client/petstore/javascript/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript/src/model/OuterEnum.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 0c1fdcd196eb..05869ad02b97 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 72c17a9f3e01..fd5fa4e34b45 100644 --- a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 f1fc92e8f310..ee7294ffaa6a 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 953b2938d3f9..1bafd62e191e 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 187d7930a9eb..a60013ff60e4 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 504ba75bfccf..fe9658132a1f 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderExample.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * Do not edit the class manually. * @@ -44,15 +44,17 @@ * @class * @param stringItem {String} * @param numberItem {Number} + * @param floatItem {Number} * @param integerItem {Number} * @param boolItem {Boolean} * @param arrayItem {Array.} */ - var exports = function(stringItem, numberItem, integerItem, boolItem, arrayItem) { + var exports = function(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem) { var _this = this; _this['string_item'] = stringItem; _this['number_item'] = numberItem; + _this['float_item'] = floatItem; _this['integer_item'] = integerItem; _this['bool_item'] = boolItem; _this['array_item'] = arrayItem; @@ -74,6 +76,9 @@ if (data.hasOwnProperty('number_item')) { obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number'); } + if (data.hasOwnProperty('float_item')) { + obj['float_item'] = ApiClient.convertToType(data['float_item'], 'Number'); + } if (data.hasOwnProperty('integer_item')) { obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number'); } @@ -95,6 +100,10 @@ * @member {Number} number_item */ exports.prototype['number_item'] = undefined; + /** + * @member {Number} float_item + */ + exports.prototype['float_item'] = undefined; /** * @member {Number} integer_item */ diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index 1cb456b754fd..d62b9ec76640 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * 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 1d3419997f09..744060478d68 100644 --- a/samples/client/petstore/javascript/src/model/XmlItem.js +++ b/samples/client/petstore/javascript/src/model/XmlItem.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator-ignore b/samples/client/petstore/kotlin-multiplatform/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator-ignore rename to samples/client/petstore/kotlin-multiplatform/.openapi-generator-ignore diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/README.md b/samples/client/petstore/kotlin-multiplatform/README.md new file mode 100644 index 000000000000..308e8b1c99ef --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/README.md @@ -0,0 +1,81 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.50 + +## Build + +``` +./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. + + + +## 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-multiplatform/build.gradle b/samples/client/petstore/kotlin-multiplatform/build.gradle new file mode 100644 index 000000000000..c976992112f3 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/build.gradle @@ -0,0 +1,138 @@ +apply plugin: 'kotlin-multiplatform' +apply plugin: 'kotlinx-serialization' + +group 'org.openapitools' +version '1.0.0' + +ext { + kotlin_version = '1.3.50' + kotlinx_version = '1.1.0' + coroutines_version = '1.3.1' + serialization_version = '0.12.0' + ktor_version = '1.2.4' +} + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50" // $kotlin_version + classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.50" // $kotlin_version + } +} + +repositories { + jcenter() +} + +kotlin { + jvm() + iosArm64() { binaries { framework { freeCompilerArgs.add("-Xobjc-generics") } } } + iosX64() { binaries { framework { freeCompilerArgs.add("-Xobjc-generics") } } } + + sourceSets { + commonMain { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version" + implementation "io.ktor:ktor-client-core:$ktor_version" + implementation "io.ktor:ktor-client-json:$ktor_version" + implementation "io.ktor:ktor-client-serialization:$ktor_version" + } + } + + commonTest { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-test-common" + implementation "org.jetbrains.kotlin:kotlin-test-annotations-common" + implementation "io.ktor:ktor-client-mock:$ktor_version" + } + } + + jvmMain { + dependsOn commonMain + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version" + implementation "io.ktor:ktor-client-core-jvm:$ktor_version" + implementation "io.ktor:ktor-client-json-jvm:$ktor_version" + implementation "io.ktor:ktor-client-serialization-jvm:$ktor_version" + } + } + + jvmTest { + dependsOn commonTest + dependencies { + implementation "org.jetbrains.kotlin:kotlin-test" + implementation "org.jetbrains.kotlin:kotlin-test-junit" + implementation "io.ktor:ktor-client-mock-jvm:$ktor_version" + } + } + + iosMain { + dependsOn commonMain + dependencies { + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version" + implementation "io.ktor:ktor-client-ios:$ktor_version" + } + } + + iosTest { + dependsOn commonTest + dependencies { + implementation "io.ktor:ktor-client-mock-native:$ktor_version" + } + } + + iosArm64().compilations.main.defaultSourceSet { + dependsOn iosMain + dependencies { + implementation "io.ktor:ktor-client-ios-iosarm64:$ktor_version" + implementation "io.ktor:ktor-client-json-iosarm64:$ktor_version" + implementation "io.ktor:ktor-client-serialization-iosarm64:$ktor_version" + } + } + + iosArm64().compilations.test.defaultSourceSet { + dependsOn iosTest + } + + iosX64().compilations.main.defaultSourceSet { + dependsOn iosMain + dependencies { + implementation "io.ktor:ktor-client-ios-iosx64:$ktor_version" + implementation "io.ktor:ktor-client-json-iosx64:$ktor_version" + implementation "io.ktor:ktor-client-serialization-iosx64:$ktor_version" + } + } + + iosX64().compilations.test.defaultSourceSet { + dependsOn iosTest + } + + all { + languageSettings { + useExperimentalAnnotation('kotlin.Experimental') + } + } + } +} + +task iosTest { + def device = project.findProperty("device")?.toString() ?: "iPhone 8" + dependsOn 'linkDebugTestIosX64' + group = JavaBasePlugin.VERIFICATION_GROUP + description = "Execute unit tests on ${device} simulator" + doLast { + def binary = kotlin.targets.iosX64.binaries.getTest('DEBUG') + exec { commandLine 'xcrun', 'simctl', 'spawn', device, binary.outputFile } + } +} + +configurations { // workaround for https://youtrack.jetbrains.com/issue/KT-27170 + compileClasspath +} diff --git a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md new file mode 100644 index 000000000000..6b4c6bf27795 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/docs/Category.md b/samples/client/petstore/kotlin-multiplatform/docs/Category.md new file mode 100644 index 000000000000..2c28a670fc79 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/docs/Order.md b/samples/client/petstore/kotlin-multiplatform/docs/Order.md new file mode 100644 index 000000000000..4683c14c1cbe --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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** | **kotlin.String** | | [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-multiplatform/docs/Pet.md b/samples/client/petstore/kotlin-multiplatform/docs/Pet.md new file mode 100644 index 000000000000..ec7756007379 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md new file mode 100644 index 000000000000..38df230ae673 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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 : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | 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** | **io.ktor.client.request.forms.InputProvider**| 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-multiplatform/docs/StoreApi.md b/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md new file mode 100644 index 000000000000..f4986041af8c --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/docs/Tag.md b/samples/client/petstore/kotlin-multiplatform/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/docs/User.md b/samples/client/petstore/kotlin-multiplatform/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/docs/UserApi.md b/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md new file mode 100644 index 000000000000..0f55f06bc629 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/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-multiplatform/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000000..2c6137b87896 Binary files /dev/null and b/samples/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..ce3ca77db54b --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue May 17 23:08:05 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip diff --git a/samples/client/petstore/kotlin-multiplatform/gradlew b/samples/client/petstore/kotlin-multiplatform/gradlew new file mode 100644 index 000000000000..9d82f7891513 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# 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 + +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" ] ; 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, switch paths to Windows format before running java +if $cygwin ; 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=$((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 + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/samples/client/petstore/kotlin-multiplatform/gradlew.bat b/samples/client/petstore/kotlin-multiplatform/gradlew.bat new file mode 100644 index 000000000000..5f192121eb4f --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/gradlew.bat @@ -0,0 +1,90 @@ +@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 + +@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= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@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 +if "%@eval[2+2]" == "4" goto 4NT_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=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +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/client/petstore/rust-reqwest/pom.xml b/samples/client/petstore/kotlin-multiplatform/pom.xml similarity index 81% rename from samples/client/petstore/rust-reqwest/pom.xml rename to samples/client/petstore/kotlin-multiplatform/pom.xml index 8ef695226a9f..bf62ae66e66c 100644 --- a/samples/client/petstore/rust-reqwest/pom.xml +++ b/samples/client/petstore/kotlin-multiplatform/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - org.openapitools - RustReqwestPetstoreClientTests + io.swagger + KotlinMultiPlatformClientTests pom 1.0-SNAPSHOT - Rust (reqwest) Petstore Client + Kotlin MultiPlatform Petstore Client @@ -33,9 +33,10 @@ exec - cargo + /bin/bash - check + gradlew + build diff --git a/samples/client/petstore/kotlin-multiplatform/settings.gradle b/samples/client/petstore/kotlin-multiplatform/settings.gradle new file mode 100644 index 000000000000..b000833f485c --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/settings.gradle @@ -0,0 +1,2 @@ +enableFeaturePreview('GRADLE_METADATA') +rootProject.name = 'kotlin-client-petstore-multiplatform' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..59c49b3efdf9 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,320 @@ +/** +* 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.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class PetApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + suspend fun addPet(body: Pet) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + */ + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun findPetsByStatus(status: kotlin.Array) : HttpResponse> { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + status?.apply { localVariableQuery["status"] = toMultiValue(this, "csv") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap().map { value.toTypedArray() } + } + + @Serializable +private class FindPetsByStatusResponse(val value: List) { + @Serializer(FindPetsByStatusResponse::class) + companion object : KSerializer { + private val serializer: KSerializer> = Pet.serializer().list + override val descriptor = StringDescriptor.withName("FindPetsByStatusResponse") + override fun serialize(encoder: Encoder, obj: FindPetsByStatusResponse) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = FindPetsByStatusResponse(serializer.deserialize(decoder)) + } +} + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun findPetsByTags(tags: kotlin.Array) : HttpResponse> { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + tags?.apply { localVariableQuery["tags"] = toMultiValue(this, "csv") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap().map { value.toTypedArray() } + } + + @Serializable +private class FindPetsByTagsResponse(val value: List) { + @Serializer(FindPetsByTagsResponse::class) + companion object : KSerializer { + private val serializer: KSerializer> = Pet.serializer().list + override val descriptor = StringDescriptor.withName("FindPetsByTagsResponse") + override fun serialize(encoder: Encoder, obj: FindPetsByTagsResponse) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = FindPetsByTagsResponse(serializer.deserialize(decoder)) + } +} + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + @Suppress("UNCHECKED_CAST") + suspend fun getPetById(petId: kotlin.Long) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + suspend fun updatePet(body: Pet) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * 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 + */ + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : HttpResponse { + + val localVariableBody = + ParametersBuilder().also { + name?.apply { it.append("name", name.toString()) } + status?.apply { it.append("status", status.toString()) } + }.build() + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return urlEncodedFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?) : HttpResponse { + + val localVariableBody = + formData { + additionalMetadata?.apply { append("additionalMetadata", additionalMetadata) } + file?.apply { append("file", file) } + } + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return multipartFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + serializer.setMapper(FindPetsByStatusResponse::class, FindPetsByStatusResponse.serializer()) + serializer.setMapper(FindPetsByTagsResponse::class, FindPetsByTagsResponse.serializer()) + + } + } +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..86f32c9f9789 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,175 @@ +/** +* 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.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class StoreApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * 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 + */ + suspend fun deleteOrder(orderId: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + @Suppress("UNCHECKED_CAST") + suspend fun getInventory() : HttpResponse> { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap().map { value } + } + + @Serializable +private class GetInventoryResponse(val value: Map) { + @Serializer(GetInventoryResponse::class) + companion object : KSerializer { + private val serializer: KSerializer> = (kotlin.String.serializer() to kotlin.Int.serializer()).map + override val descriptor = StringDescriptor.withName("GetInventoryResponse") + override fun serialize(encoder: Encoder, obj: GetInventoryResponse) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = GetInventoryResponse(serializer.deserialize(decoder)) + } +} + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun getOrderById(orderId: kotlin.Long) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + @Suppress("UNCHECKED_CAST") + suspend fun placeOrder(body: Order) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + serializer.setMapper(GetInventoryResponse::class, GetInventoryResponse.serializer()) + + } + } +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..1977979c1d93 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,304 @@ +/** +* 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.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class UserApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + suspend fun createUser(body: User) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + suspend fun createUsersWithArrayInput(body: kotlin.Array) : HttpResponse { + + val localVariableBody = CreateUsersWithArrayInputRequest(body.asList()) + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + @Serializable +private class CreateUsersWithArrayInputRequest(val value: List) { + @Serializer(CreateUsersWithArrayInputRequest::class) + companion object : KSerializer { + private val serializer: KSerializer> = User.serializer().list + override val descriptor = StringDescriptor.withName("CreateUsersWithArrayInputRequest") + override fun serialize(encoder: Encoder, obj: CreateUsersWithArrayInputRequest) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = CreateUsersWithArrayInputRequest(serializer.deserialize(decoder)) + } +} + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + suspend fun createUsersWithListInput(body: kotlin.Array) : HttpResponse { + + val localVariableBody = CreateUsersWithListInputRequest(body.asList()) + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + @Serializable +private class CreateUsersWithListInputRequest(val value: List) { + @Serializer(CreateUsersWithListInputRequest::class) + companion object : KSerializer { + private val serializer: KSerializer> = User.serializer().list + override val descriptor = StringDescriptor.withName("CreateUsersWithListInputRequest") + override fun serialize(encoder: Encoder, obj: CreateUsersWithListInputRequest) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = CreateUsersWithListInputRequest(serializer.deserialize(decoder)) + } +} + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + suspend fun deleteUser(username: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + @Suppress("UNCHECKED_CAST") + suspend fun getUserByName(username: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + @Suppress("UNCHECKED_CAST") + suspend fun loginUser(username: kotlin.String, password: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + username?.apply { localVariableQuery["username"] = listOf("$username") } + password?.apply { localVariableQuery["password"] = listOf("$password") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Logs out current logged in user session + * + * @return void + */ + suspend fun logoutUser() : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * 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 + */ + suspend fun updateUser(username: kotlin.String, body: User) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + serializer.setMapper(CreateUsersWithArrayInputRequest::class, CreateUsersWithArrayInputRequest.serializer()) + serializer.setMapper(CreateUsersWithListInputRequest::class, CreateUsersWithListInputRequest.serializer()) + + } + } +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..f97cb88d2338 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = Map> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipes" -> "|" + "ssv" -> " " + 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-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..66a5140d254f --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,129 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.call.call +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.JsonFeature +import io.ktor.client.features.json.JsonSerializer +import io.ktor.client.features.json.serializer.KotlinxSerializer +import io.ktor.client.request.accept +import io.ktor.client.request.forms.FormDataContent +import io.ktor.client.request.forms.MultiPartFormDataContent +import io.ktor.client.request.header +import io.ktor.client.request.parameter +import io.ktor.client.response.HttpResponse +import io.ktor.client.utils.EmptyContent +import io.ktor.http.* +import io.ktor.http.content.OutgoingContent +import io.ktor.http.content.PartData +import kotlinx.serialization.UnstableDefault +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration + +import org.openapitools.client.apis.* +import org.openapitools.client.models.* + +open class ApiClient( + private val baseUrl: String, + httpClientEngine: HttpClientEngine?, + serializer: KotlinxSerializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: String, + httpClientEngine: HttpClientEngine?, + jsonConfiguration: JsonConfiguration) : + this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + private val serializer: JsonSerializer by lazy { + serializer.apply { setMappers(this) }.ignoreOutgoingContent() + } + + private val client: HttpClient by lazy { + val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } + val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } + httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) + } + + companion object { + protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) + + private fun setMappers(serializer: KotlinxSerializer) { + + PetApi.setMappers(serializer) + + StoreApi.setMappers(serializer) + + UserApi.setMappers(serializer) + + serializer.setMapper(ApiResponse::class, ApiResponse.serializer()) + serializer.setMapper(Category::class, Category.serializer()) + serializer.setMapper(Order::class, Order.serializer()) + serializer.setMapper(Pet::class, Pet.serializer()) + serializer.setMapper(Tag::class, Tag.serializer()) + serializer.setMapper(User::class, User.serializer()) + } + } + + protected suspend fun multipartFormRequest(requestConfig: RequestConfig, body: List?): HttpResponse { + return request(requestConfig, MultiPartFormDataContent(body ?: listOf())) + } + + protected suspend fun urlEncodedFormRequest(requestConfig: RequestConfig, body: Parameters?): HttpResponse { + return request(requestConfig, FormDataContent(body ?: Parameters.Empty)) + } + + protected suspend fun jsonRequest(requestConfig: RequestConfig, body: Any? = null): HttpResponse { + val contentType = (requestConfig.headers[HttpHeaders.ContentType]?.let { ContentType.parse(it) } + ?: ContentType.Application.Json) + return if (body != null) request(requestConfig, serializer.write(body, contentType)) + else request(requestConfig) + } + + protected suspend fun request(requestConfig: RequestConfig, body: OutgoingContent = EmptyContent): HttpResponse { + val headers = requestConfig.headers + + return client.call { + this.url { + this.takeFrom(URLBuilder(baseUrl)) + appendPath(requestConfig.path.trimStart('/').split('/')) + requestConfig.query.forEach { query -> + query.value.forEach { value -> + parameter(query.key, value) + } + } + } + this.method = requestConfig.method.httpMethod + headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + this.body = body + + }.response + } + + private fun URLBuilder.appendPath(components: List): URLBuilder = apply { + encodedPath = encodedPath.trimEnd('/') + components.joinToString("/", prefix = "/") { it.encodeURLQueryComponent() } + } + + private val RequestMethod.httpMethod: HttpMethod + get() = when (this) { + RequestMethod.DELETE -> HttpMethod.Delete + RequestMethod.GET -> HttpMethod.Get + RequestMethod.HEAD -> HttpMethod.Head + RequestMethod.PATCH -> HttpMethod.Patch + RequestMethod.PUT -> HttpMethod.Put + RequestMethod.POST -> HttpMethod.Post + RequestMethod.OPTIONS -> HttpMethod.Options + } +} + +// https://github.com/ktorio/ktor/issues/851 +private fun JsonSerializer.ignoreOutgoingContent() = IgnoreOutgoingContentJsonSerializer(this) + +private class IgnoreOutgoingContentJsonSerializer(private val delegate: JsonSerializer) : JsonSerializer by delegate { + override fun write(data: Any): OutgoingContent { + if (data is OutgoingContent) return data + return delegate.write(data) + } +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt new file mode 100644 index 000000000000..c457eb4bce0b --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt @@ -0,0 +1,51 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.call.TypeInfo +import io.ktor.client.call.typeInfo +import io.ktor.http.Headers +import io.ktor.http.isSuccess + +open class HttpResponse(val response: io.ktor.client.response.HttpResponse, val provider: BodyProvider) { + val status: Int = response.status.value + val success: Boolean = response.status.isSuccess() + val headers: Map> = response.headers.mapEntries() + suspend fun body(): T = provider.body(response) + suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type) + + companion object { + private fun Headers.mapEntries(): Map> { + val result = mutableMapOf>() + entries().forEach { result[it.key] = it.value } + return result + } + } +} + +interface BodyProvider { + suspend fun body(response: io.ktor.client.response.HttpResponse): T + suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V +} + +class TypedBodyProvider(private val type: TypeInfo) : BodyProvider { + @Suppress("UNCHECKED_CAST") + override suspend fun body(response: io.ktor.client.response.HttpResponse): T = + response.call.receive(type) as T + + @Suppress("UNCHECKED_CAST") + override suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V = + response.call.receive(type) as V +} + +class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider { + override suspend fun body(response: io.ktor.client.response.HttpResponse): T = + block(provider.body(response)) + + override suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V = + provider.typedBody(response, type) +} + +inline fun io.ktor.client.response.HttpResponse.wrap(): HttpResponse = + HttpResponse(this, TypedBodyProvider(typeInfo())) + +fun HttpResponse.map(block: T.() -> V): HttpResponse = + HttpResponse(response, MappedBodyProvider(provider, block)) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..53e689237d71 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/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: Map> = mapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/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-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..51ab6ed93980 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,29 @@ +/** +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +@Serializable +data class ApiResponse ( + @SerialName(value = "code") val code: kotlin.Int? = null, + @SerialName(value = "type") val type: kotlin.String? = null, + @SerialName(value = "message") val message: kotlin.String? = null +) + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..96432c658ada --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,27 @@ +/** +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * A category for a pet + * @param id + * @param name + */ +@Serializable +data class Category ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "name") val name: kotlin.String? = null +) + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..e949395ce4ef --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,56 @@ +/** +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +@Serializable +data class Order ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "petId") val petId: kotlin.Long? = null, + @SerialName(value = "quantity") val quantity: kotlin.Int? = null, + @SerialName(value = "shipDate") val shipDate: kotlin.String? = null, + /* Order Status */ + @SerialName(value = "status") val status: Order.Status? = null, + @SerialName(value = "complete") val complete: kotlin.Boolean? = null +) +{ + + /** + * Order Status + * Values: placed,approved,delivered + */ + @Serializable(with = Status.Serializer::class) + enum class Status(val value: kotlin.String){ + + placed("placed"), + + approved("approved"), + + delivered("delivered"); + + + object Serializer : CommonEnumSerializer("Status", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..dc2f8b0b0ef3 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,58 @@ +/** +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * 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 + */ +@Serializable +data class Pet ( + @SerialName(value = "name") @Required val name: kotlin.String, + @SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array, + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "category") val category: Category? = null, + @SerialName(value = "tags") val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerialName(value = "status") val status: Pet.Status? = null +) +{ + + /** + * pet status in the store + * Values: available,pending,sold + */ + @Serializable(with = Status.Serializer::class) + enum class Status(val value: kotlin.String){ + + available("available"), + + pending("pending"), + + sold("sold"); + + + object Serializer : CommonEnumSerializer("Status", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..b21e51bf8d3b --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,27 @@ +/** +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * A tag for a pet + * @param id + * @param name + */ +@Serializable +data class Tag ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "name") val name: kotlin.String? = null +) + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..7d52e737d49e --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,40 @@ +/** +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * 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 + */ +@Serializable +data class User ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "username") val username: kotlin.String? = null, + @SerialName(value = "firstName") val firstName: kotlin.String? = null, + @SerialName(value = "lastName") val lastName: kotlin.String? = null, + @SerialName(value = "email") val email: kotlin.String? = null, + @SerialName(value = "password") val password: kotlin.String? = null, + @SerialName(value = "phone") val phone: kotlin.String? = null, + /* User Status */ + @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null +) + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonTest/kotlin/util/Coroutine.kt b/samples/client/petstore/kotlin-multiplatform/src/commonTest/kotlin/util/Coroutine.kt new file mode 100644 index 000000000000..fcff288bfef6 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/commonTest/kotlin/util/Coroutine.kt @@ -0,0 +1,23 @@ +/** +* 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 util + +import kotlinx.coroutines.CoroutineScope + +/** +* Block the current thread until execution of the given coroutine is complete. +* +* @param block The coroutine code. +* @return The result of the coroutine. +*/ +internal expect fun runTest(block: suspend CoroutineScope.() -> T): T diff --git a/samples/client/petstore/kotlin-multiplatform/src/iosTest/kotlin/util/Coroutine.kt b/samples/client/petstore/kotlin-multiplatform/src/iosTest/kotlin/util/Coroutine.kt new file mode 100644 index 000000000000..b8b36f3f7596 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/iosTest/kotlin/util/Coroutine.kt @@ -0,0 +1,18 @@ +/** +* 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 util + +import kotlinx.coroutines.CoroutineScope +import kotlin.coroutines.EmptyCoroutineContext + +internal actual fun runTest(block: suspend CoroutineScope.() -> T): T = kotlinx.coroutines.runBlocking(EmptyCoroutineContext, block) diff --git a/samples/client/petstore/kotlin-multiplatform/src/jvmTest/kotlin/util/Coroutine.kt b/samples/client/petstore/kotlin-multiplatform/src/jvmTest/kotlin/util/Coroutine.kt new file mode 100644 index 000000000000..b8b36f3f7596 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/src/jvmTest/kotlin/util/Coroutine.kt @@ -0,0 +1,18 @@ +/** +* 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 util + +import kotlinx.coroutines.CoroutineScope +import kotlin.coroutines.EmptyCoroutineContext + +internal actual fun runTest(block: suspend CoroutineScope.() -> T): T = kotlinx.coroutines.runBlocking(EmptyCoroutineContext, block) diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.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/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index 9c09efacf7da..ea93e1745279 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -51,7 +51,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -97,7 +99,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -144,7 +148,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -191,7 +197,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -238,7 +246,10 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers @@ -282,7 +293,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -330,7 +343,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -379,7 +394,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers diff --git a/samples/client/petstore/kotlin-string/docs/StoreApi.md b/samples/client/petstore/kotlin-string/docs/StoreApi.md index eed73ae300aa..f4986041af8c 100644 --- a/samples/client/petstore/kotlin-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-string/docs/StoreApi.md @@ -92,7 +92,10 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers diff --git a/samples/client/petstore/kotlin-string/settings.gradle b/samples/client/petstore/kotlin-string/settings.gradle index 39b507d9963f..9699edc87133 100644 --- a/samples/client/petstore/kotlin-string/settings.gradle +++ b/samples/client/petstore/kotlin-string/settings.gradle @@ -1 +1,2 @@ + rootProject.name = 'kotlin-petstore-string' \ No newline at end of file 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 36c7ad826136..15f63f2a1b5b 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 @@ -51,8 +51,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -82,8 +82,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -113,8 +113,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -144,8 +144,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -175,8 +175,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Pet - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -205,8 +205,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -237,8 +237,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -270,8 +270,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as ApiResponse - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 891b91d68142..90d681f8f347 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 @@ -50,8 +50,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -80,8 +80,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -111,8 +111,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -142,8 +142,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 ea538f439a1d..daaaeae31508 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 @@ -50,8 +50,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -80,8 +80,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -110,8 +110,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -140,8 +140,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -171,8 +171,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as User - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -203,8 +203,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.String - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -232,8 +232,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -263,8 +263,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index c2c3f1f0eaea..f97cb88d2338 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -12,9 +12,12 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } -fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { +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.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) } } \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8a7cc13a29c8..def00253aed0 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -15,11 +15,18 @@ 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() @@ -46,9 +53,9 @@ open class ApiClient(val baseUrl: String) { mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") } protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { @@ -61,13 +68,31 @@ open class ApiClient(val baseUrl: String) { } return when(mediaType) { JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> TODO("responseBody currently only supports JSON body.") + 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()) { + 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 { diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47109faf6125..ada15fee7a1b 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -19,6 +19,7 @@ import com.squareup.moshi.Json * @param type * @param message */ + data class ApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, @@ -26,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt index f068a02b1a03..426a0e515928 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -18,12 +18,11 @@ import com.squareup.moshi.Json * @param id * @param name */ + data class Category ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt index a263c25f33c2..38be465c021b 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -22,6 +22,7 @@ import com.squareup.moshi.Json * @param status Order Status * @param complete */ + data class Order ( @Json(name = "id") val id: kotlin.Long? = null, @@ -36,23 +37,23 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) { +) +{ /** * Order Status * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ - @Json(name = "placed") - placed("placed"), + @Json(name = "placed") placed("placed"), - @Json(name = "approved") - approved("approved"), + @Json(name = "approved") approved("approved"), - @Json(name = "delivered") - delivered("delivered"); + @Json(name = "delivered") delivered("delivered"); + } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index 88a536ea6227..d870b69e5e7f 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param tags * @param status pet status in the store */ + data class Pet ( @Json(name = "name") val name: kotlin.String, @@ -38,23 +39,23 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) { +) +{ /** * pet status in the store * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ - @Json(name = "available") - available("available"), + @Json(name = "available") available("available"), - @Json(name = "pending") - pending("pending"), + @Json(name = "pending") pending("pending"), - @Json(name = "sold") - sold("sold"); + @Json(name = "sold") sold("sold"); + } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index e67b899b1ff8..f9ef87e13fbf 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -18,12 +18,11 @@ import com.squareup.moshi.Json * @param id * @param name */ + data class Tag ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt index 6a66d8e523b9..dfd63806da94 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param phone * @param userStatus User Status */ + data class User ( @Json(name = "id") val id: kotlin.Long? = null, @@ -42,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.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/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index 9c09efacf7da..ea93e1745279 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -51,7 +51,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -97,7 +99,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -144,7 +148,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -191,7 +197,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -238,7 +246,10 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers @@ -282,7 +293,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -330,7 +343,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -379,7 +394,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers diff --git a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md index eed73ae300aa..f4986041af8c 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md @@ -92,7 +92,10 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers diff --git a/samples/client/petstore/kotlin-threetenbp/settings.gradle b/samples/client/petstore/kotlin-threetenbp/settings.gradle index e786c8eb23fe..1f071e0d3ca6 100644 --- a/samples/client/petstore/kotlin-threetenbp/settings.gradle +++ b/samples/client/petstore/kotlin-threetenbp/settings.gradle @@ -1 +1,2 @@ + rootProject.name = 'kotlin-petstore-threetenbp' \ No newline at end of file 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 36c7ad826136..15f63f2a1b5b 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 @@ -51,8 +51,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -82,8 +82,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -113,8 +113,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -144,8 +144,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -175,8 +175,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Pet - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -205,8 +205,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -237,8 +237,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -270,8 +270,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as ApiResponse - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 891b91d68142..90d681f8f347 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 @@ -50,8 +50,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -80,8 +80,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -111,8 +111,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -142,8 +142,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 ea538f439a1d..daaaeae31508 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 @@ -50,8 +50,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -80,8 +80,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -110,8 +110,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -140,8 +140,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -171,8 +171,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as User - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -203,8 +203,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.String - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -232,8 +232,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -263,8 +263,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index c2c3f1f0eaea..f97cb88d2338 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -12,9 +12,12 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } -fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { +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.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) } } \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8a7cc13a29c8..def00253aed0 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -15,11 +15,18 @@ 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() @@ -46,9 +53,9 @@ open class ApiClient(val baseUrl: String) { mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") } protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { @@ -61,13 +68,31 @@ open class ApiClient(val baseUrl: String) { } return when(mediaType) { JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> TODO("responseBody currently only supports JSON body.") + 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()) { + 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 { diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47109faf6125..ada15fee7a1b 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -19,6 +19,7 @@ import com.squareup.moshi.Json * @param type * @param message */ + data class ApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, @@ -26,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt index f068a02b1a03..426a0e515928 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -18,12 +18,11 @@ import com.squareup.moshi.Json * @param id * @param name */ + data class Category ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt index 916fe3094b23..abf5219de339 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -22,6 +22,7 @@ import com.squareup.moshi.Json * @param status Order Status * @param complete */ + data class Order ( @Json(name = "id") val id: kotlin.Long? = null, @@ -36,23 +37,23 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) { +) +{ /** * Order Status * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ - @Json(name = "placed") - placed("placed"), + @Json(name = "placed") placed("placed"), - @Json(name = "approved") - approved("approved"), + @Json(name = "approved") approved("approved"), - @Json(name = "delivered") - delivered("delivered"); + @Json(name = "delivered") delivered("delivered"); + } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt index 88a536ea6227..d870b69e5e7f 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param tags * @param status pet status in the store */ + data class Pet ( @Json(name = "name") val name: kotlin.String, @@ -38,23 +39,23 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) { +) +{ /** * pet status in the store * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ - @Json(name = "available") - available("available"), + @Json(name = "available") available("available"), - @Json(name = "pending") - pending("pending"), + @Json(name = "pending") pending("pending"), - @Json(name = "sold") - sold("sold"); + @Json(name = "sold") sold("sold"); + } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt index e67b899b1ff8..f9ef87e13fbf 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -18,12 +18,11 @@ import com.squareup.moshi.Json * @param id * @param name */ + data class Tag ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt index 6a66d8e523b9..dfd63806da94 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param phone * @param userStatus User Status */ + data class User ( @Json(name = "id") val id: kotlin.Long? = null, @@ -42,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.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/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt index bead1dcc3597..48ecd493a1ef 100644 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt @@ -40,8 +40,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational reponses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Rediration responses.") ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") else -> throw kotlin.IllegalStateException("Undefined ResponseType.") diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 9c09efacf7da..ea93e1745279 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -51,7 +51,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -97,7 +99,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -144,7 +148,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -191,7 +197,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -238,7 +246,10 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers @@ -282,7 +293,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -330,7 +343,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -379,7 +394,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers diff --git a/samples/client/petstore/kotlin/docs/StoreApi.md b/samples/client/petstore/kotlin/docs/StoreApi.md index eed73ae300aa..f4986041af8c 100644 --- a/samples/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/client/petstore/kotlin/docs/StoreApi.md @@ -92,7 +92,10 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers diff --git a/samples/client/petstore/kotlin/settings.gradle b/samples/client/petstore/kotlin/settings.gradle index 17e020387e21..7540d01de36c 100644 --- a/samples/client/petstore/kotlin/settings.gradle +++ b/samples/client/petstore/kotlin/settings.gradle @@ -1 +1,2 @@ + rootProject.name = 'kotlin-petstore-client' \ No newline at end of file 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 36c7ad826136..15f63f2a1b5b 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 @@ -51,8 +51,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -82,8 +82,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -113,8 +113,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -144,8 +144,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -175,8 +175,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Pet - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -205,8 +205,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -237,8 +237,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -270,8 +270,8 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as ApiResponse - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 891b91d68142..90d681f8f347 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 @@ -50,8 +50,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -80,8 +80,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -111,8 +111,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -142,8 +142,8 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } 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 ea538f439a1d..daaaeae31508 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 @@ -50,8 +50,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -80,8 +80,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -110,8 +110,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -140,8 +140,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -171,8 +171,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as User - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -203,8 +203,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.String - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -232,8 +232,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } @@ -263,8 +263,8 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index c2c3f1f0eaea..f97cb88d2338 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -12,9 +12,12 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } -fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { +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.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) } } \ No newline at end of file diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8a7cc13a29c8..def00253aed0 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -15,11 +15,18 @@ 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() @@ -46,9 +53,9 @@ open class ApiClient(val baseUrl: String) { mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") } protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { @@ -61,13 +68,31 @@ open class ApiClient(val baseUrl: String) { } return when(mediaType) { JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> TODO("responseBody currently only supports JSON body.") + 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()) { + 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 { diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47109faf6125..ada15fee7a1b 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -19,6 +19,7 @@ import com.squareup.moshi.Json * @param type * @param message */ + data class ApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, @@ -26,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index f068a02b1a03..426a0e515928 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -18,12 +18,11 @@ import com.squareup.moshi.Json * @param id * @param name */ + data class Category ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 00e62b88092c..2e9074a650ab 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -22,6 +22,7 @@ import com.squareup.moshi.Json * @param status Order Status * @param complete */ + data class Order ( @Json(name = "id") val id: kotlin.Long? = null, @@ -36,23 +37,23 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) { +) +{ /** * Order Status * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ - @Json(name = "placed") - placed("placed"), + @Json(name = "placed") placed("placed"), - @Json(name = "approved") - approved("approved"), + @Json(name = "approved") approved("approved"), - @Json(name = "delivered") - delivered("delivered"); + @Json(name = "delivered") delivered("delivered"); + } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index 88a536ea6227..d870b69e5e7f 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param tags * @param status pet status in the store */ + data class Pet ( @Json(name = "name") val name: kotlin.String, @@ -38,23 +39,23 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) { +) +{ /** * pet status in the store * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ - @Json(name = "available") - available("available"), + @Json(name = "available") available("available"), - @Json(name = "pending") - pending("pending"), + @Json(name = "pending") pending("pending"), - @Json(name = "sold") - sold("sold"); + @Json(name = "sold") sold("sold"); + } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index e67b899b1ff8..f9ef87e13fbf 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -18,12 +18,11 @@ import com.squareup.moshi.Json * @param id * @param name */ + data class Tag ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) { - -} +) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 6a66d8e523b9..dfd63806da94 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param phone * @param userStatus User Status */ + data class User ( @Json(name = "id") val id: kotlin.Long? = null, @@ -42,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) { - -} +) diff --git a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator-ignore b/samples/client/petstore/nim/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/dart2/openapi-browser-client/.openapi-generator-ignore rename to samples/client/petstore/nim/.openapi-generator-ignore diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/nim/README.md b/samples/client/petstore/nim/README.md new file mode 100644 index 000000000000..11a5499e00e0 --- /dev/null +++ b/samples/client/petstore/nim/README.md @@ -0,0 +1,54 @@ +# Nim API client for OpenAPI Petstore (Package: petstore) + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.NimClientCodegen + +## Installation + +Put the package under your project folder and add the following to the nimble file of your project: + +``` +import petstore +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Module | Proc | HTTP request | Description +------------ | ------------- | ------------- | ------------- +api_pet | addPet | **POST** /pet | Add a new pet to the store +api_pet | deletePet | **DELETE** /pet/{petId} | Deletes a pet +api_pet | findPetsByStatus | **GET** /pet/findByStatus | Finds Pets by status +api_pet | findPetsByTags | **GET** /pet/findByTags | Finds Pets by tags +api_pet | getPetById | **GET** /pet/{petId} | Find pet by ID +api_pet | updatePet | **PUT** /pet | Update an existing pet +api_pet | updatePetWithForm | **POST** /pet/{petId} | Updates a pet in the store with form data +api_pet | uploadFile | **POST** /pet/{petId}/uploadImage | uploads an image +api_store | deleteOrder | **DELETE** /store/order/{orderId} | Delete purchase order by ID +api_store | getInventory | **GET** /store/inventory | Returns pet inventories by status +api_store | getOrderById | **GET** /store/order/{orderId} | Find purchase order by ID +api_store | placeOrder | **POST** /store/order | Place an order for a pet +api_user | createUser | **POST** /user | Create user +api_user | createUsersWithArrayInput | **POST** /user/createWithArray | Creates list of users with given input array +api_user | createUsersWithListInput | **POST** /user/createWithList | Creates list of users with given input array +api_user | deleteUser | **DELETE** /user/{username} | Delete user +api_user | getUserByName | **GET** /user/{username} | Get user by user name +api_user | loginUser | **GET** /user/login | Logs user into the system +api_user | logoutUser | **GET** /user/logout | Logs out current logged in user session +api_user | updateUser | **PUT** /user/{username} | Updated user + + +To generate documentation with Nim DocGen, use: + +``` +nim doc --project --index:on petstore.nim +``` + diff --git a/samples/client/petstore/nim/config.nim b/samples/client/petstore/nim/config.nim new file mode 100644 index 000000000000..a0790844b38c --- /dev/null +++ b/samples/client/petstore/nim/config.nim @@ -0,0 +1 @@ +const useragent* = "OpenAPI-Generator/1.0.0/nim" diff --git a/samples/client/petstore/nim/petstore.nim b/samples/client/petstore/nim/petstore.nim new file mode 100644 index 000000000000..21f854f172b6 --- /dev/null +++ b/samples/client/petstore/nim/petstore.nim @@ -0,0 +1,32 @@ +# +# 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://openapi-generator.tech +# + +# Models +import petstore/models/model_api_response +import petstore/models/model_category +import petstore/models/model_order +import petstore/models/model_pet +import petstore/models/model_tag +import petstore/models/model_user + +export model_api_response +export model_category +export model_order +export model_pet +export model_tag +export model_user + +# APIs +import petstore/apis/api_pet +import petstore/apis/api_store +import petstore/apis/api_user + +export api_pet +export api_store +export api_user diff --git a/samples/client/petstore/nim/petstore/apis/api_pet.nim b/samples/client/petstore/nim/petstore/apis/api_pet.nim new file mode 100644 index 000000000000..9858c523647e --- /dev/null +++ b/samples/client/petstore/nim/petstore/apis/api_pet.nim @@ -0,0 +1,107 @@ +# +# 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://openapi-generator.tech +# + +import httpclient +import json +import logging +import marshal +import options +import strformat +import strutils +import tables +import typetraits +import uri + +import ../models/model_api_response +import ../models/model_pet + +const basepath = "http://petstore.swagger.io/v2" + +template constructResult[T](response: Response): untyped = + if response.code in {Http200, Http201, Http202, Http204, Http206}: + try: + when name(stripGenericParams(T.typedesc).typedesc) == name(Table): + (some(json.to(parseJson(response.body), T.typedesc)), response) + else: + (some(marshal.to[T](response.body)), response) + except JsonParsingError: + # The server returned a malformed response though the response code is 2XX + # TODO: need better error handling + error("JsonParsingError") + (none(T.typedesc), response) + else: + (none(T.typedesc), response) + + +proc addPet*(httpClient: HttpClient, body: Pet): Response = + ## Add a new pet to the store + httpClient.headers["Content-Type"] = "application/json" + httpClient.post(basepath & "/pet", $(%body)) + + +proc deletePet*(httpClient: HttpClient, petId: int64, api_key: string): Response = + ## Deletes a pet + httpClient.headers["api_key"] = api_key + httpClient.delete(basepath & fmt"/pet/{petId}") + + +proc findPetsByStatus*(httpClient: HttpClient, status: seq[Status]): (Option[seq[Pet]], Response) = + ## Finds Pets by status + let query_for_api_call = encodeQuery([ + ("status", $status.join(",")), # Status values that need to be considered for filter + ]) + + let response = httpClient.get(basepath & "/pet/findByStatus" & "?" & query_for_api_call) + constructResult[seq[Pet]](response) + + +proc findPetsByTags*(httpClient: HttpClient, tags: seq[string]): (Option[seq[Pet]], Response) {.deprecated.} = + ## Finds Pets by tags + let query_for_api_call = encodeQuery([ + ("tags", $tags.join(",")), # Tags to filter by + ]) + + let response = httpClient.get(basepath & "/pet/findByTags" & "?" & query_for_api_call) + constructResult[seq[Pet]](response) + + +proc getPetById*(httpClient: HttpClient, petId: int64): (Option[Pet], Response) = + ## Find pet by ID + + let response = httpClient.get(basepath & fmt"/pet/{petId}") + constructResult[Pet](response) + + +proc updatePet*(httpClient: HttpClient, body: Pet): Response = + ## Update an existing pet + httpClient.headers["Content-Type"] = "application/json" + httpClient.put(basepath & "/pet", $(%body)) + + +proc updatePetWithForm*(httpClient: HttpClient, petId: int64, name: string, status: string): Response = + ## Updates a pet in the store with form data + httpClient.headers["Content-Type"] = "application/x-www-form-urlencoded" + let query_for_api_call = encodeQuery([ + ("name", $name), # Updated name of the pet + ("status", $status), # Updated status of the pet + ]) + httpClient.post(basepath & fmt"/pet/{petId}", $query_for_api_call) + + +proc uploadFile*(httpClient: HttpClient, petId: int64, additionalMetadata: string, file: string): (Option[ApiResponse], Response) = + ## uploads an image + httpClient.headers["Content-Type"] = "multipart/form-data" + let query_for_api_call = newMultipartData({ + "additionalMetadata": $additionalMetadata, # Additional data to pass to server + "file": $file, # file to upload + }) + + let response = httpClient.post(basepath & fmt"/pet/{petId}/uploadImage", multipart=query_for_api_call) + constructResult[ApiResponse](response) + diff --git a/samples/client/petstore/nim/petstore/apis/api_store.nim b/samples/client/petstore/nim/petstore/apis/api_store.nim new file mode 100644 index 000000000000..3c518e8dd31a --- /dev/null +++ b/samples/client/petstore/nim/petstore/apis/api_store.nim @@ -0,0 +1,66 @@ +# +# 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://openapi-generator.tech +# + +import httpclient +import json +import logging +import marshal +import options +import strformat +import strutils +import tables +import typetraits +import uri + +import ../models/model_order + +const basepath = "http://petstore.swagger.io/v2" + +template constructResult[T](response: Response): untyped = + if response.code in {Http200, Http201, Http202, Http204, Http206}: + try: + when name(stripGenericParams(T.typedesc).typedesc) == name(Table): + (some(json.to(parseJson(response.body), T.typedesc)), response) + else: + (some(marshal.to[T](response.body)), response) + except JsonParsingError: + # The server returned a malformed response though the response code is 2XX + # TODO: need better error handling + error("JsonParsingError") + (none(T.typedesc), response) + else: + (none(T.typedesc), response) + + +proc deleteOrder*(httpClient: HttpClient, orderId: string): Response = + ## Delete purchase order by ID + httpClient.delete(basepath & fmt"/store/order/{orderId}") + + +proc getInventory*(httpClient: HttpClient): (Option[Table[string, int]], Response) = + ## Returns pet inventories by status + + let response = httpClient.get(basepath & "/store/inventory") + constructResult[Table[string, int]](response) + + +proc getOrderById*(httpClient: HttpClient, orderId: int64): (Option[Order], Response) = + ## Find purchase order by ID + + let response = httpClient.get(basepath & fmt"/store/order/{orderId}") + constructResult[Order](response) + + +proc placeOrder*(httpClient: HttpClient, body: Order): (Option[Order], Response) = + ## Place an order for a pet + httpClient.headers["Content-Type"] = "application/json" + + let response = httpClient.post(basepath & "/store/order", $(%body)) + constructResult[Order](response) + diff --git a/samples/client/petstore/nim/petstore/apis/api_user.nim b/samples/client/petstore/nim/petstore/apis/api_user.nim new file mode 100644 index 000000000000..87bef06818e4 --- /dev/null +++ b/samples/client/petstore/nim/petstore/apis/api_user.nim @@ -0,0 +1,91 @@ +# +# 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://openapi-generator.tech +# + +import httpclient +import json +import logging +import marshal +import options +import strformat +import strutils +import tables +import typetraits +import uri + +import ../models/model_user + +const basepath = "http://petstore.swagger.io/v2" + +template constructResult[T](response: Response): untyped = + if response.code in {Http200, Http201, Http202, Http204, Http206}: + try: + when name(stripGenericParams(T.typedesc).typedesc) == name(Table): + (some(json.to(parseJson(response.body), T.typedesc)), response) + else: + (some(marshal.to[T](response.body)), response) + except JsonParsingError: + # The server returned a malformed response though the response code is 2XX + # TODO: need better error handling + error("JsonParsingError") + (none(T.typedesc), response) + else: + (none(T.typedesc), response) + + +proc createUser*(httpClient: HttpClient, body: User): Response = + ## Create user + httpClient.headers["Content-Type"] = "application/json" + httpClient.post(basepath & "/user", $(%body)) + + +proc createUsersWithArrayInput*(httpClient: HttpClient, body: seq[User]): Response = + ## Creates list of users with given input array + httpClient.headers["Content-Type"] = "application/json" + httpClient.post(basepath & "/user/createWithArray", $(%body)) + + +proc createUsersWithListInput*(httpClient: HttpClient, body: seq[User]): Response = + ## Creates list of users with given input array + httpClient.headers["Content-Type"] = "application/json" + httpClient.post(basepath & "/user/createWithList", $(%body)) + + +proc deleteUser*(httpClient: HttpClient, username: string): Response = + ## Delete user + httpClient.delete(basepath & fmt"/user/{username}") + + +proc getUserByName*(httpClient: HttpClient, username: string): (Option[User], Response) = + ## Get user by user name + + let response = httpClient.get(basepath & fmt"/user/{username}") + constructResult[User](response) + + +proc loginUser*(httpClient: HttpClient, username: string, password: string): (Option[string], Response) = + ## Logs user into the system + let query_for_api_call = encodeQuery([ + ("username", $username), # The user name for login + ("password", $password), # The password for login in clear text + ]) + + let response = httpClient.get(basepath & "/user/login" & "?" & query_for_api_call) + constructResult[string](response) + + +proc logoutUser*(httpClient: HttpClient): Response = + ## Logs out current logged in user session + httpClient.get(basepath & "/user/logout") + + +proc updateUser*(httpClient: HttpClient, username: string, body: User): Response = + ## Updated user + httpClient.headers["Content-Type"] = "application/json" + httpClient.put(basepath & fmt"/user/{username}", $(%body)) + diff --git a/samples/client/petstore/nim/petstore/models/model_api_response.nim b/samples/client/petstore/nim/petstore/models/model_api_response.nim new file mode 100644 index 000000000000..78f22e081ca0 --- /dev/null +++ b/samples/client/petstore/nim/petstore/models/model_api_response.nim @@ -0,0 +1,18 @@ +# +# 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://openapi-generator.tech +# + +import json +import tables + + +type ApiResponse* = object + ## Describes the result of uploading an image resource + code*: int + `type`*: string + message*: string diff --git a/samples/client/petstore/nim/petstore/models/model_category.nim b/samples/client/petstore/nim/petstore/models/model_category.nim new file mode 100644 index 000000000000..a1331c1ef415 --- /dev/null +++ b/samples/client/petstore/nim/petstore/models/model_category.nim @@ -0,0 +1,17 @@ +# +# 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://openapi-generator.tech +# + +import json +import tables + + +type Category* = object + ## A category for a pet + id*: int64 + name*: string diff --git a/samples/client/petstore/nim/petstore/models/model_order.nim b/samples/client/petstore/nim/petstore/models/model_order.nim new file mode 100644 index 000000000000..e2bb9e9cd7c7 --- /dev/null +++ b/samples/client/petstore/nim/petstore/models/model_order.nim @@ -0,0 +1,40 @@ +# +# 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://openapi-generator.tech +# + +import json +import tables + + +type Status* {.pure.} = enum + Placed + Approved + Delivered + +type Order* = object + ## An order for a pets from the pet store + id*: int64 + petId*: int64 + quantity*: int + shipDate*: string + status*: Status ## Order Status + complete*: bool + +func `%`*(v: Status): JsonNode = + let str = case v: + of Status.Placed: "placed" + of Status.Approved: "approved" + of Status.Delivered: "delivered" + + JsonNode(kind: JString, str: str) + +func `$`*(v: Status): string = + result = case v: + of Status.Placed: "placed" + of Status.Approved: "approved" + of Status.Delivered: "delivered" diff --git a/samples/client/petstore/nim/petstore/models/model_pet.nim b/samples/client/petstore/nim/petstore/models/model_pet.nim new file mode 100644 index 000000000000..c2431a743c66 --- /dev/null +++ b/samples/client/petstore/nim/petstore/models/model_pet.nim @@ -0,0 +1,42 @@ +# +# 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://openapi-generator.tech +# + +import json +import tables + +import model_category +import model_tag + +type Status* {.pure.} = enum + Available + Pending + Sold + +type Pet* = object + ## A pet for sale in the pet store + id*: int64 + category*: Category + name*: string + photoUrls*: seq[string] + tags*: seq[Tag] + status*: Status ## pet status in the store + +func `%`*(v: Status): JsonNode = + let str = case v: + of Status.Available: "available" + of Status.Pending: "pending" + of Status.Sold: "sold" + + JsonNode(kind: JString, str: str) + +func `$`*(v: Status): string = + result = case v: + of Status.Available: "available" + of Status.Pending: "pending" + of Status.Sold: "sold" diff --git a/samples/client/petstore/nim/petstore/models/model_tag.nim b/samples/client/petstore/nim/petstore/models/model_tag.nim new file mode 100644 index 000000000000..28f518d6b6c0 --- /dev/null +++ b/samples/client/petstore/nim/petstore/models/model_tag.nim @@ -0,0 +1,17 @@ +# +# 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://openapi-generator.tech +# + +import json +import tables + + +type Tag* = object + ## A tag for a pet + id*: int64 + name*: string diff --git a/samples/client/petstore/nim/petstore/models/model_user.nim b/samples/client/petstore/nim/petstore/models/model_user.nim new file mode 100644 index 000000000000..e487793080e5 --- /dev/null +++ b/samples/client/petstore/nim/petstore/models/model_user.nim @@ -0,0 +1,23 @@ +# +# 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://openapi-generator.tech +# + +import json +import tables + + +type User* = object + ## A User who is purchasing from the pet store + id*: int64 + username*: string + firstName*: string + lastName*: string + email*: string + password*: string + phone*: string + userStatus*: int ## User Status diff --git a/samples/client/petstore/nim/sample_client.nim b/samples/client/petstore/nim/sample_client.nim new file mode 100644 index 000000000000..6340c902e6eb --- /dev/null +++ b/samples/client/petstore/nim/sample_client.nim @@ -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 +# +# Generated by: https://openapi-generator.tech +# + +import httpclient +import logging +import options + +import petstore + +import config + +let logger = newConsoleLogger() +addHandler(logger) + +let client = newHttpClient() +client.headers["User-Agent"] = config.useragent diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.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/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index ee3b37778233..6f5090566a95 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -383,6 +383,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 71f47ac441d7..0aa13eb6104c 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -22,6 +22,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -667,3 +668,56 @@ No authorization required [[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) +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context) + + + +To test the collection format in query parameters + +### Example +```perl +use Data::Dumper; +use WWW::OpenAPIClient::FakeApi; +my $api_instance = WWW::OpenAPIClient::FakeApi->new( +); + +my $pipe = [("null")]; # ARRAY[string] | +my $ioutil = [("null")]; # ARRAY[string] | +my $http = [("null")]; # ARRAY[string] | +my $url = [("null")]; # ARRAY[string] | +my $context = [("null")]; # ARRAY[string] | + +eval { + $api_instance->test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context); +}; +if ($@) { + warn "Exception when calling FakeApi->test_query_parameter_collection_format: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**ARRAY[string]**](string.md)| | + **ioutil** | [**ARRAY[string]**](string.md)| | + **http** | [**ARRAY[string]**](string.md)| | + **url** | [**ARRAY[string]**](string.md)| | + **context** | [**ARRAY[string]**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/perl/docs/TypeHolderExample.md b/samples/client/petstore/perl/docs/TypeHolderExample.md index 2f83a6109199..563163afdf8e 100644 --- a/samples/client/petstore/perl/docs/TypeHolderExample.md +++ b/samples/client/petstore/perl/docs/TypeHolderExample.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **string** | | **number_item** | **double** | | +**float_item** | **double** | | **integer_item** | **int** | | **bool_item** | **boolean** | | **array_item** | **ARRAY[int]** | | diff --git a/samples/client/petstore/perl/git_push.sh b/samples/client/petstore/perl/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/perl/git_push.sh +++ b/samples/client/petstore/perl/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index 5309ef4b29ca..facf8615da12 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -1169,4 +1169,129 @@ sub test_json_form_data { return; } +# +# test_query_parameter_collection_format +# +# +# +# @param ARRAY[string] $pipe (required) +# @param ARRAY[string] $ioutil (required) +# @param ARRAY[string] $http (required) +# @param ARRAY[string] $url (required) +# @param ARRAY[string] $context (required) +{ + my $params = { + 'pipe' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'ioutil' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'http' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'url' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'context' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ 'test_query_parameter_collection_format' } = { + summary => '', + params => $params, + returns => undef, + }; +} +# @return void +# +sub test_query_parameter_collection_format { + my ($self, %args) = @_; + + # verify the required parameter 'pipe' is set + unless (exists $args{'pipe'}) { + croak("Missing the required parameter 'pipe' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'ioutil' is set + unless (exists $args{'ioutil'}) { + croak("Missing the required parameter 'ioutil' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'http' is set + unless (exists $args{'http'}) { + croak("Missing the required parameter 'http' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'url' is set + unless (exists $args{'url'}) { + croak("Missing the required parameter 'url' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'context' is set + unless (exists $args{'context'}) { + croak("Missing the required parameter 'context' when calling test_query_parameter_collection_format"); + } + + # parse inputs + my $_resource_path = '/fake/test-query-paramters'; + + my $_method = 'PUT'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + # query params + if ( exists $args{'pipe'}) { + $query_params->{'pipe'} = $self->{api_client}->to_query_value($args{'pipe'}); + } + + # query params + if ( exists $args{'ioutil'}) { + $query_params->{'ioutil'} = $self->{api_client}->to_query_value($args{'ioutil'}); + } + + # query params + if ( exists $args{'http'}) { + $query_params->{'http'} = $self->{api_client}->to_query_value($args{'http'}); + } + + # query params + if ( exists $args{'url'}) { + $query_params->{'url'} = $self->{api_client}->to_query_value($args{'url'}); + } + + # query params + if ( exists $args{'context'}) { + $query_params->{'context'} = $self->{api_client}->to_query_value($args{'context'}); + } + + my $_body_data; + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; +} + 1; diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TypeHolderExample.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TypeHolderExample.pm index 84e327b91413..4376ad54954a 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TypeHolderExample.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/TypeHolderExample.pm @@ -175,6 +175,13 @@ __PACKAGE__->method_documentation({ format => '', read_only => '', }, + 'float_item' => { + datatype => 'double', + base_name => 'float_item', + description => '', + format => '', + read_only => '', + }, 'integer_item' => { datatype => 'int', base_name => 'integer_item', @@ -201,6 +208,7 @@ __PACKAGE__->method_documentation({ __PACKAGE__->openapi_types( { 'string_item' => 'string', 'number_item' => 'double', + 'float_item' => 'double', 'integer_item' => 'int', 'bool_item' => 'boolean', 'array_item' => 'ARRAY[int]' @@ -209,6 +217,7 @@ __PACKAGE__->openapi_types( { __PACKAGE__->attribute_map( { 'string_item' => 'string_item', 'number_item' => 'number_item', + 'float_item' => 'float_item', 'integer_item' => 'integer_item', 'bool_item' => 'bool_item', 'array_item' => 'array_item' diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.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/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 918f708ef908..f84c670fa306 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index 21ca8b4d4790..c2ac9a71e31d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -796,3 +797,66 @@ No authorization required [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + + + +To test the collection format in query parameters + +### Example + +```php +testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**string[]**](../Model/string.md)| | + **ioutil** | [**string[]**](../Model/string.md)| | + **http** | [**string[]**](../Model/string.md)| | + **url** | [**string[]**](../Model/string.md)| | + **context** | [**string[]**](../Model/string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TypeHolderExample.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TypeHolderExample.md index b3bcd15377a8..bafe6adae497 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TypeHolderExample.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **string** | | **number_item** | **float** | | +**float_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | **array_item** | **int[]** | | diff --git a/samples/client/petstore/php/OpenAPIClient-php/git_push.sh b/samples/client/petstore/php/OpenAPIClient-php/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/git_push.sh +++ b/samples/client/petstore/php/OpenAPIClient-php/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 03826caff9a8..48d47497a776 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 d3f96368a9d9..cad495723c51 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** @@ -3513,6 +3513,297 @@ protected function testJsonFormDataRequest($param, $param2) ); } + /** + * Operation testQueryParameterCollectionFormat + * + * @param string[] $pipe pipe (required) + * @param string[] $ioutil ioutil (required) + * @param string[] $http http (required) + * @param string[] $url url (required) + * @param string[] $context context (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + { + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context); + } + + /** + * Operation testQueryParameterCollectionFormatWithHttpInfo + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context) + { + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testQueryParameterCollectionFormatAsync + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context) + { + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testQueryParameterCollectionFormatAsyncWithHttpInfo + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + { + $returnType = ''; + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testQueryParameterCollectionFormat' + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context) + { + // verify the required parameter 'pipe' is set + if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pipe when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'ioutil' is set + if ($ioutil === null || (is_array($ioutil) && count($ioutil) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'http' is set + if ($http === null || (is_array($http) && count($http) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $http when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'url' is set + if ($url === null || (is_array($url) && count($url) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'context' is set + if ($context === null || (is_array($context) && count($context) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' + ); + } + + $resourcePath = '/fake/test-query-paramters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pipe)) { + $pipe = ObjectSerializer::serializeCollection($pipe, 'csv', true); + } + if ($pipe !== null) { + $queryParams['pipe'] = ObjectSerializer::toQueryValue($pipe); + } + // query params + if (is_array($ioutil)) { + $ioutil = ObjectSerializer::serializeCollection($ioutil, 'csv', true); + } + if ($ioutil !== null) { + $queryParams['ioutil'] = ObjectSerializer::toQueryValue($ioutil); + } + // query params + if (is_array($http)) { + $http = ObjectSerializer::serializeCollection($http, 'space', true); + } + if ($http !== null) { + $queryParams['http'] = ObjectSerializer::toQueryValue($http); + } + // query params + if (is_array($url)) { + $url = ObjectSerializer::serializeCollection($url, 'csv', true); + } + if ($url !== null) { + $queryParams['url'] = ObjectSerializer::toQueryValue($url); + } + // query params + if (is_array($context)) { + $context = ObjectSerializer::serializeCollection($context, 'multi', true); + } + if ($context !== null) { + $queryParams['context'] = ObjectSerializer::toQueryValue($context); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * 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 1259483af5d0..3eb54829f1df 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5c269cbede8a..0e44d2cfef36 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 8040fe95e960..1b79e4dad9be 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 058ef039c2e9..383b0556db09 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 93c6fe56f7f4..333d0a7f2fe6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index b88973842036..501dcac0458d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 0448f78fafd7..df285d652bf3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 8087b6fc4d05..0bf2b7f55519 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 fa670102eb8c..8cc76ce8d8ae 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c582ca020a5e..d603dea6cf20 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 365158b215c1..7356db34be2f 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e308b7a70a78..7ade96c13788 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 3c46324e9f04..659cbd2df243 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 667f2bb00033..9fe67b2a5e52 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 8333432433d0..ad1b652f01fe 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ddfa967fe315..ac6d9082b733 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 30f673754f9e..c1c82d76cdac 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 70c86d8d19df..e32b6781485e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1015e7480897..a76f5d3acb3e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b9eca45a71c6..f7b3381a8839 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 0cd8bbc0f5e4..774560b79d81 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a4beb8007e54..55fd5cda68be 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 760ad2a81aa0..3bb9a232581e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6a34329d7be7..29c35d5df876 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4834bda03449..a7b2ae94562b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6e7930ab2928..0f025e7227a2 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b7c9762765fb..6a0a37286693 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a7c17fe156b5..7d8024ced11f 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 289f1d86db6e..c28dd01ffada 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 839b4b16754a..61140467fd8c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 56d3ff0421b0..06de6bc11ce2 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7654a9107e80..6260508cfd57 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 0c359e2a2404..f89f41deaf48 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 af8b9dd060c0..ab9030610d79 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 700378d0a22c..08017cad244e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c1923d9d2910..8d1b080c9460 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7522a7911788..1b37ce50fc4b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 be08a19c7991..e0dbe01e2c1a 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b5fece9a78d3..7167b7abbd21 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 08fc12f5b08e..5554b691ef41 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 d183cdd53fe6..b8d680ea28d6 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6c29d9067fb2..4af627fd82a9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 83efd3332b8d..ebfc25987897 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6e656b15335b..2579c56894af 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 3efa6e1f5ce2..4d0d721e7186 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5f565a4bffd6..c7a8d103733d 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4fcaff7b54fd..040fb6ebaa17 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 652f37b69fcf..4f2a6d0accb5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7bb118029cd7..6cd441183cc7 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 43507bf63de0..3fc3e71f80cc 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e7042d471c5b..6d0b39f9d3be 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 9ccc3c47e4ee..3794ed5ea482 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** @@ -59,6 +59,7 @@ class TypeHolderExample implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'string_item' => 'string', 'number_item' => 'float', + 'float_item' => 'float', 'integer_item' => 'int', 'bool_item' => 'bool', 'array_item' => 'int[]' @@ -72,6 +73,7 @@ class TypeHolderExample implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'string_item' => null, 'number_item' => null, + 'float_item' => 'float', 'integer_item' => null, 'bool_item' => null, 'array_item' => null @@ -106,6 +108,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'string_item' => 'string_item', 'number_item' => 'number_item', + 'float_item' => 'float_item', 'integer_item' => 'integer_item', 'bool_item' => 'bool_item', 'array_item' => 'array_item' @@ -119,6 +122,7 @@ public static function openAPIFormats() protected static $setters = [ 'string_item' => 'setStringItem', 'number_item' => 'setNumberItem', + 'float_item' => 'setFloatItem', 'integer_item' => 'setIntegerItem', 'bool_item' => 'setBoolItem', 'array_item' => 'setArrayItem' @@ -132,6 +136,7 @@ public static function openAPIFormats() protected static $getters = [ 'string_item' => 'getStringItem', 'number_item' => 'getNumberItem', + 'float_item' => 'getFloatItem', 'integer_item' => 'getIntegerItem', 'bool_item' => 'getBoolItem', 'array_item' => 'getArrayItem' @@ -199,6 +204,7 @@ public function __construct(array $data = null) { $this->container['string_item'] = isset($data['string_item']) ? $data['string_item'] : null; $this->container['number_item'] = isset($data['number_item']) ? $data['number_item'] : null; + $this->container['float_item'] = isset($data['float_item']) ? $data['float_item'] : null; $this->container['integer_item'] = isset($data['integer_item']) ? $data['integer_item'] : null; $this->container['bool_item'] = isset($data['bool_item']) ? $data['bool_item'] : null; $this->container['array_item'] = isset($data['array_item']) ? $data['array_item'] : null; @@ -219,6 +225,9 @@ public function listInvalidProperties() if ($this->container['number_item'] === null) { $invalidProperties[] = "'number_item' can't be null"; } + if ($this->container['float_item'] === null) { + $invalidProperties[] = "'float_item' can't be null"; + } if ($this->container['integer_item'] === null) { $invalidProperties[] = "'integer_item' can't be null"; } @@ -291,6 +300,30 @@ public function setNumberItem($number_item) return $this; } + /** + * Gets float_item + * + * @return float + */ + public function getFloatItem() + { + return $this->container['float_item']; + } + + /** + * Sets float_item + * + * @param float $float_item float_item + * + * @return $this + */ + public function setFloatItem($float_item) + { + $this->container['float_item'] = $float_item; + + return $this; + } + /** * Gets integer_item * 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 6744b9c21f92..75fc5ba92fef 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c1f72e97ca15..81c18ddef3b7 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index e2faef5275eb..15f94983bdb3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7ff12ef96142..404dd3de11cb 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c28d4a2feccd..d61da9640580 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** @@ -201,4 +201,14 @@ public function testTestInlineAdditionalProperties() public function testTestJsonFormData() { } + + /** + * Test case for testQueryParameterCollectionFormat + * + * . + * + */ + public function testTestQueryParameterCollectionFormat() + { + } } 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 2697a21342ed..a12926190162 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 2d04e353fe36..70753715c118 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 fe51ce2f3ef1..dad95dc00962 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6ee055793ada..c259663e3677 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 9d4fe764e90f..21cd0fd78200 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a19d64191293..05585247198f 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 38c092033e0a..efefca395cf4 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 22370b43a0bc..1440461dac9c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 3dea9a4c9c97..9c4087ade820 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 235cd1b2033e..bc92b467ed93 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 23d4b25baf7b..d3d7cfdf8d88 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 310107ce66c2..da2b49e27bb1 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 598ba353ef5a..809a41d34de9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ff127b649011..859e3b46c24b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a80c4a544373..41a1d726e5e9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7c52127e1ad6..3a2a8f5dc3bd 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 322fdbc15549..e10bc0fa6985 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 02d5965efb02..0b49b85de13c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f5574208ccb2..ab8ff01a4ee4 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1b7bbab78395..a8bcadb2c8fb 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 70be8dbb25e1..f36da9bfb818 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 063847ceb90e..7ee3aff0d2d4 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c4a9eaee088d..366763cc4793 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 17c4ce9e975d..db2ff4704079 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 bbdf71bcb638..1cd276f64b4f 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4c0b5b97fef3..8d80ec35b5bc 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7f83f3312bfb..fa8eb1e05504 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 76d1f2fb6759..aa700d564ed7 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5c042591be14..fd60879723d1 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e67751dd8613..6c1b925b3249 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7cedfeed44a7..0a687d8f4f58 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 25df1e7911c8..48b43992ad38 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 14a38f611a13..ad56b4c97f15 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c59fa9106a46..a67445e0802c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b88485f7f446..4408ec2905c5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 43843dba2b11..95b170613d3e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e93a5e46d18a..01462779b4c9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f3fb739ffada..f7d5f487c011 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 fef2a5102d81..760b03bfc260 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 9536eb775bfb..5c21fd7e6c00 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 137d9c605d12..4a5a5427630d 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b16b2c37a9b6..1674c2c4fac7 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 33b7848030d6..5721f0514853 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1fce252c5dc0..1820dbcc7a9b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ebf93790131b..4f164e3e120c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 bae67b14a323..2a1251350c40 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 37d48bb4936b..ffd01f163f2c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 44ded9d7088e..782f96abd160 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** @@ -92,6 +92,13 @@ public function testPropertyNumberItem() { } + /** + * Test attribute "float_item" + */ + public function testPropertyFloatItem() + { + } + /** * Test attribute "integer_item" */ 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 6a8cb63d036c..a2d4e2aad2ae 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 067c711b4e4d..29ac7f77125b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.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/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index 27a0490dc04e..8534592c1506 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -14,7 +14,7 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index 3aa6aadb2b78..6ad90d76d774 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -764,3 +765,63 @@ No authorization required [[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) +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md b/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md index d59718cdcb16..2a410ded8e35 100644 --- a/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md +++ b/samples/client/petstore/python-asyncio/docs/TypeHolderExample.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **str** | | **number_item** | **float** | | +**float_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | **array_item** | **list[int]** | | diff --git a/samples/client/petstore/python-asyncio/git_push.sh b/samples/client/petstore/python-asyncio/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/python-asyncio/git_push.sh +++ b/samples/client/petstore/python-asyncio/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index 1847804c552b..00333bfd2c47 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -1580,3 +1580,144 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'csv' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 886cf0bd9add..23b51a35e9d1 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -66,6 +66,9 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ self.username = username """Username for HTTP basic authentication """ @@ -223,11 +226,15 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py index 8f2b5d6b7d3b..745fe95da2c0 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_example.py @@ -33,6 +33,7 @@ class TypeHolderExample(object): openapi_types = { 'string_item': 'str', 'number_item': 'float', + 'float_item': 'float', 'integer_item': 'int', 'bool_item': 'bool', 'array_item': 'list[int]' @@ -41,16 +42,18 @@ class TypeHolderExample(object): attribute_map = { 'string_item': 'string_item', 'number_item': 'number_item', + 'float_item': 'float_item', 'integer_item': 'integer_item', 'bool_item': 'bool_item', 'array_item': 'array_item' } - def __init__(self, string_item=None, number_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 + def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 self._string_item = None self._number_item = None + self._float_item = None self._integer_item = None self._bool_item = None self._array_item = None @@ -58,6 +61,7 @@ def __init__(self, string_item=None, number_item=None, integer_item=None, bool_i self.string_item = string_item self.number_item = number_item + self.float_item = float_item self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item @@ -108,6 +112,29 @@ def number_item(self, number_item): self._number_item = number_item + @property + def float_item(self): + """Gets the float_item of this TypeHolderExample. # noqa: E501 + + + :return: The float_item of this TypeHolderExample. # noqa: E501 + :rtype: float + """ + return self._float_item + + @float_item.setter + def float_item(self, float_item): + """Sets the float_item of this TypeHolderExample. + + + :param float_item: The float_item of this TypeHolderExample. # noqa: E501 + :type: float + """ + if float_item is None: + raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 + + self._float_item = float_item + @property def integer_item(self): """Gets the integer_item of this TypeHolderExample. # noqa: E501 diff --git a/samples/client/petstore/python-asyncio/setup.py b/samples/client/petstore/python-asyncio/setup.py index 3fda51261b96..bf6cb115fc6f 100644 --- a/samples/client/petstore/python-asyncio/setup.py +++ b/samples/client/petstore/python-asyncio/setup.py @@ -32,7 +32,7 @@ url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 diff --git a/samples/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/client/petstore/python-experimental/.openapi-generator/VERSION index 479c313e87b9..0e97bd19efbf 100644 --- a/samples/client/petstore/python-experimental/.openapi-generator/VERSION +++ b/samples/client/petstore/python-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 8f84fade2fb5..2a5a1f6c149d 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -14,7 +14,7 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git @@ -77,6 +77,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_enum_serialize**](docs/FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | @@ -152,9 +153,11 @@ Class | Method | HTTP request | Description - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) - [Tag](docs/Tag.md) - [TypeHolderDefault](docs/TypeHolderDefault.md) - [TypeHolderExample](docs/TypeHolderExample.md) diff --git a/samples/client/petstore/python-experimental/docs/Animal.md b/samples/client/petstore/python-experimental/docs/Animal.md index 7ed4ba541fa3..e59166a62e83 100644 --- a/samples/client/petstore/python-experimental/docs/Animal.md +++ b/samples/client/petstore/python-experimental/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Cat.md b/samples/client/petstore/python-experimental/docs/Cat.md index 8d30565d014e..8bdbf9b3bcca 100644 --- a/samples/client/petstore/python-experimental/docs/Cat.md +++ b/samples/client/petstore/python-experimental/docs/Cat.md @@ -3,7 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | **declawed** | **bool** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Category.md b/samples/client/petstore/python-experimental/docs/Category.md index 7e5c1e316499..33b2242d703f 100644 --- a/samples/client/petstore/python-experimental/docs/Category.md +++ b/samples/client/petstore/python-experimental/docs/Category.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**name** | **str** | | defaults to 'default-name' **id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Dog.md b/samples/client/petstore/python-experimental/docs/Dog.md index f727487975c4..81de56780725 100644 --- a/samples/client/petstore/python-experimental/docs/Dog.md +++ b/samples/client/petstore/python-experimental/docs/Dog.md @@ -3,7 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | **breed** | **str** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/EnumClass.md b/samples/client/petstore/python-experimental/docs/EnumClass.md index 67f017becd0c..510dff4df0cf 100644 --- a/samples/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/client/petstore/python-experimental/docs/EnumClass.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to '-efg' [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/EnumTest.md b/samples/client/petstore/python-experimental/docs/EnumTest.md index c4c1630250ff..5fc28b6c1ce3 100644 --- a/samples/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/client/petstore/python-experimental/docs/EnumTest.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enum_string** | **str** | | [optional] **enum_string_required** | **str** | | +**enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 5aa5443d06f8..94280a712344 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_enum_serialize**](FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | @@ -179,8 +180,61 @@ No authorization required [[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) +# **fake_outer_enum_serialize** +> OuterEnum fake_outer_enum_serialize() + + + +Test serialization of outer enum + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = OuterEnum("placed") # OuterEnum | Input enum as post body (optional) + +try: + api_response = api_instance.fake_outer_enum_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterEnum**](str.md)| Input enum as post body | [optional] + +### Return type + +[**OuterEnum**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output enum | - | + +[[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) + # **fake_outer_number_serialize** -> float fake_outer_number_serialize() +> OuterNumber fake_outer_number_serialize() @@ -197,7 +251,7 @@ from pprint import pprint # Create an instance of the API class api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) +body = OuterNumber(3.4) # OuterNumber | Input number as post body (optional) try: api_response = api_instance.fake_outer_number_serialize(body=body) @@ -210,11 +264,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] + **body** | [**OuterNumber**](float.md)| Input number as post body | [optional] ### Return type -**float** +[**OuterNumber**](OuterNumber.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/FormatTest.md b/samples/client/petstore/python-experimental/docs/FormatTest.md index 31d92e2a750e..1bf152e6828b 100644 --- a/samples/client/petstore/python-experimental/docs/FormatTest.md +++ b/samples/client/petstore/python-experimental/docs/FormatTest.md @@ -3,19 +3,19 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | **float** | | +**byte** | **str** | | +**date** | **date** | | +**password** | **str** | | **integer** | **int** | | [optional] **int32** | **int** | | [optional] **int64** | **int** | | [optional] -**number** | **float** | | **float** | **float** | | [optional] **double** | **float** | | [optional] **string** | **str** | | [optional] -**byte** | **str** | | **binary** | **file** | | [optional] -**date** | **date** | | **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] -**password** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/MapTest.md b/samples/client/petstore/python-experimental/docs/MapTest.md index a5601691f885..ee6036eb2f42 100644 --- a/samples/client/petstore/python-experimental/docs/MapTest.md +++ b/samples/client/petstore/python-experimental/docs/MapTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | **dict(str, dict(str, str))** | | [optional] **map_of_enum_string** | **dict(str, str)** | | [optional] **direct_map** | **dict(str, bool)** | | [optional] -**indirect_map** | **dict(str, bool)** | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Order.md b/samples/client/petstore/python-experimental/docs/Order.md index b5f7b22d34cf..c21210a3bd59 100644 --- a/samples/client/petstore/python-experimental/docs/Order.md +++ b/samples/client/petstore/python-experimental/docs/Order.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **quantity** | **int** | | [optional] **ship_date** | **datetime** | | [optional] **status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to False] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/OuterComposite.md b/samples/client/petstore/python-experimental/docs/OuterComposite.md index bab07ad559eb..3df277a30fa5 100644 --- a/samples/client/petstore/python-experimental/docs/OuterComposite.md +++ b/samples/client/petstore/python-experimental/docs/OuterComposite.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/client/petstore/python-experimental/docs/OuterEnum.md b/samples/client/petstore/python-experimental/docs/OuterEnum.md index 06d413b01680..cba017068980 100644 --- a/samples/client/petstore/python-experimental/docs/OuterEnum.md +++ b/samples/client/petstore/python-experimental/docs/OuterEnum.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**value** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/Category.md b/samples/client/petstore/python-experimental/docs/OuterNumber.md similarity index 57% rename from samples/client/petstore/dart2/openapi-browser-client/docs/Category.md rename to samples/client/petstore/python-experimental/docs/OuterNumber.md index cc0d1633b59c..5d75342bd8e3 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/Category.md +++ b/samples/client/petstore/python-experimental/docs/OuterNumber.md @@ -1,15 +1,9 @@ -# openapi.model.Category - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` +# OuterNumber ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**value** | **float** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Pet.md b/samples/client/petstore/python-experimental/docs/Pet.md index 9e15090300f8..15185316feae 100644 --- a/samples/client/petstore/python-experimental/docs/Pet.md +++ b/samples/client/petstore/python-experimental/docs/Pet.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] **name** | **str** | | **photo_urls** | **list[str]** | | +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] **tags** | [**list[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [optional] diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Category.md b/samples/client/petstore/python-experimental/docs/StringBooleanMap.md similarity index 57% rename from samples/client/petstore/dart2/flutter_petstore/openapi/docs/Category.md rename to samples/client/petstore/python-experimental/docs/StringBooleanMap.md index cc0d1633b59c..7abf11ec68b1 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Category.md +++ b/samples/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -1,15 +1,8 @@ -# openapi.model.Category - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` +# StringBooleanMap ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md index fc82b9a827dd..7ec864de09df 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md @@ -3,13 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] -**number_item** | **float** | | [default to 1.234] -**integer_item** | **int** | | [default to -2] -**bool_item** | **bool** | | [default to True] +**array_item** | **list[int]** | | +**string_item** | **str** | | defaults to 'what' +**number_item** | **float** | | defaults to 1.234 +**integer_item** | **int** | | defaults to -2 +**bool_item** | **bool** | | defaults to True **date_item** | **date** | | [optional] **datetime_item** | **datetime** | | [optional] -**array_item** | **list[int]** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md index bb334f9925bc..71f302f8d9ff 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md @@ -3,11 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] -**number_item** | **float** | | [default to 1.234] -**integer_item** | **int** | | [default to -2] **bool_item** | **bool** | | **array_item** | **list[int]** | | +**string_item** | **str** | | defaults to 'what' +**number_item** | **float** | | defaults to 1.234 +**integer_item** | **int** | | defaults to -2 [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/git_push.sh b/samples/client/petstore/python-experimental/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/python-experimental/git_push.sh +++ b/samples/client/petstore/python-experimental/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/python-experimental/openapi_client/api_client.py b/samples/client/petstore/python-experimental/openapi_client/api_client.py deleted file mode 100644 index efe3e5c3789f..000000000000 --- a/samples/client/petstore/python-experimental/openapi_client/api_client.py +++ /dev/null @@ -1,658 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import datetime -import inspect -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote - -from petstore_api.configuration import Configuration -import petstore_api.models -from petstore_api import rest -from petstore_api.exceptions import ApiValueError - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __del__(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(petstore_api.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datatime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return 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) - 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)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - from dateutil.parser import parse - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datatime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - from dateutil.parser import parse - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): - return data - - used_data = data - if not isinstance(data, (list, dict)): - used_data = [data] - keyword_args = {} - positional_args = [] - if klass.openapi_types is not None: - for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in used_data): - value = used_data[klass.attribute_map[attr]] - keyword_args[attr] = self.__deserialize(value, attr_type) - - end_index = None - argspec = inspect.getargspec(getattr(klass, '__init__')) - if argspec.defaults: - end_index = -len(argspec.defaults) - required_positional_args = argspec.args[1:end_index] - - for index, req_positional_arg in enumerate(required_positional_args): - if keyword_args and req_positional_arg in keyword_args: - positional_args.append(keyword_args[req_positional_arg]) - del keyword_args[req_positional_arg] - elif (not keyword_args and index < len(used_data) and - isinstance(used_data, list)): - positional_args.append(used_data[index]) - - instance = klass(*positional_args, **keyword_args) - - if hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/samples/client/petstore/python-experimental/petstore_api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/__init__.py index 45d51fe90b8a..905c4d344909 100644 --- a/samples/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/__init__.py @@ -71,9 +71,11 @@ from petstore_api.models.order import Order from petstore_api.models.outer_composite import OuterComposite from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_number import OuterNumber from petstore_api.models.pet import Pet from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap from petstore_api.models.tag import Tag from petstore_api.models.type_holder_default import TypeHolderDefault from petstore_api.models.type_holder_example import TypeHolderExample diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 01d055616ebc..1c429821437f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -18,10 +18,14 @@ import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 +from petstore_api.exceptions import ( ApiTypeError, ApiValueError ) +from petstore_api.model_utils import ( + check_allowed_values, + check_validations +) class AnotherFakeApi(object): @@ -36,122 +40,269 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def call_123_test_special_tags(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + def __call_123_test_special_tags(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Client: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 - return data - - def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True) - >>> result = thread.get() + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = Endpoint( + settings={ + 'response_type': 'Client', + 'auth': [], + 'endpoint_path': '/another-fake/dummy', + 'operation_id': 'call_123_test_special_tags', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'Client', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__call_123_test_special_tags + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint Args: - body (Client): client model - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Client: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations + ) - local_var_params = locals() + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + else: + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method call_123_test_special_tags" % key + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - header_params = {} + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - form_params = [] - local_var_files = {} + self.__validate_inputs(kwargs) - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + params = self.__gather_params(kwargs) - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - # Authentication setting - auth_settings = [] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '/another-fake/dummy', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index 0f14ef6739d0..4b41defbc5a8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -18,10 +18,14 @@ import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 +from petstore_api.exceptions import ( ApiTypeError, ApiValueError ) +from petstore_api.model_utils import ( + check_allowed_values, + check_validations +) class FakeApi(object): @@ -36,1877 +40,1653 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_xml_item(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 - else: - (data) = self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 - return data - - def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['xml_item'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_xml_item" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'xml_item' is set - if ('xml_item' not in local_var_params or - local_var_params['xml_item'] is None): - raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'xml_item' in local_var_params: - body_params = local_var_params['xml_item'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/create_xml_item', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_boolean_serialize(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - bool: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 - return data - - def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - bool: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_boolean_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/outer/boolean', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='bool', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_composite_serialize(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (OuterComposite): Input composite as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + def __create_xml_item(self, xml_item, **kwargs): # noqa: E501 + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param XmlItem xml_item: XmlItem Body (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - OuterComposite: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 - return data - - def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (OuterComposite): Input composite as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - OuterComposite: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_composite_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/outer/composite', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OuterComposite', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def fake_outer_number_serialize(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_number_serialize(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (float): Input number as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - float: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 - return data - - def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (float): Input number as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - float: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_number_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/outer/number', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='float', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def fake_outer_string_serialize(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_string_serialize(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (str): Input string as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - str: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 - return data - - def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - body (str): Input string as post body. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['xml_item'] = xml_item + return self.call_with_http_info(**kwargs) + + self.create_xml_item = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/create_xml_item', + 'operation_id': 'create_xml_item', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'xml_item', + ], + 'required': [ + 'xml_item', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'xml_item': 'XmlItem', + }, + 'attribute_map': { + }, + 'location_map': { + 'xml_item': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/xml', + 'application/xml; charset=utf-8', + 'application/xml; charset=utf-16', + 'text/xml', + 'text/xml; charset=utf-8', + 'text/xml; charset=utf-16' + ] + }, + api_client=api_client, + callable=__create_xml_item + ) + + def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool body: Input boolean as post body + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - str: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method fake_outer_string_serialize" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/outer/string', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_body_with_file_schema(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.fake_outer_boolean_serialize = Endpoint( + settings={ + 'response_type': 'bool', + 'auth': [], + 'endpoint_path': '/fake/outer/boolean', + 'operation_id': 'fake_outer_boolean_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'bool', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_outer_boolean_serialize + ) + + def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param OuterComposite body: Input composite as post body + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 - return data - - def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: OuterComposite + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.fake_outer_composite_serialize = Endpoint( + settings={ + 'response_type': 'OuterComposite', + 'auth': [], + 'endpoint_path': '/fake/outer/composite', + 'operation_id': 'fake_outer_composite_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'OuterComposite', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_outer_composite_serialize + ) + + def __fake_outer_enum_serialize(self, **kwargs): # noqa: E501 + """fake_outer_enum_serialize # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_enum_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param OuterEnum body: Input enum as post body + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_file_schema" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/body-with-file-schema', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): body (User): - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: OuterEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.fake_outer_enum_serialize = Endpoint( + settings={ + 'response_type': 'OuterEnum', + 'auth': [], + 'endpoint_path': '/fake/outer/enum', + 'operation_id': 'fake_outer_enum_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'OuterEnum', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_outer_enum_serialize + ) + + def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param OuterNumber body: Input number as post body + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 - else: - (data) = self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 - return data - - def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): body (User): - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: OuterNumber + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.fake_outer_number_serialize = Endpoint( + settings={ + 'response_type': 'OuterNumber', + 'auth': [], + 'endpoint_path': '/fake/outer/number', + 'operation_id': 'fake_outer_number_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'OuterNumber', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_outer_number_serialize + ) + + def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str body: Input string as post body + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['query', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_body_with_query_params" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'query' is set - if ('query' not in local_var_params or - local_var_params['query'] is None): - raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'query' in local_var_params: - query_params.append(('query', local_var_params['query'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/body-with-query-params', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_client_model(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.fake_outer_string_serialize = Endpoint( + settings={ + 'response_type': 'str', + 'auth': [], + 'endpoint_path': '/fake/outer/string', + 'operation_id': 'fake_outer_string_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'str', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_outer_string_serialize + ) + + def __test_body_with_file_schema(self, body, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param FileSchemaTestClass body: (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Client: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 - return data - - def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_client_model_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-file-schema', + 'operation_id': 'test_body_with_file_schema', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'FileSchemaTestClass', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_file_schema + ) + + def __test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str query: (required) + :param User body: (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Client: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_client_model" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_endpoint_enums_length_one(self, query_integer=3, query_string='brillig', path_string='hello', path_integer=34, header_number=1.234, **kwargs): # noqa: E501 - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string='brillig', path_string='hello', path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to 'brillig', must be one of ['brillig'] - path_string (str): defaults to 'hello', must be one of ['hello'] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['query'] = query + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-query-params', + 'operation_id': 'test_body_with_query_params', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'query', + 'body', + ], + 'required': [ + 'query', + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'query': 'str', + 'body': 'User', + }, + 'attribute_map': { + 'query': 'query', + }, + 'location_map': { + 'query': 'query', + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_query_params + ) + + def __test_client_model(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_endpoint_enums_length_one_with_http_info(query_integer=query_integer, query_string=query_string, path_string=path_string, path_integer=path_integer, header_number=header_number, **kwargs) # noqa: E501 - else: - (data) = self.test_endpoint_enums_length_one_with_http_info(query_integer=query_integer, query_string=query_string, path_string=path_string, path_integer=path_integer, header_number=header_number, **kwargs) # noqa: E501 - return data - - def test_endpoint_enums_length_one_with_http_info(self, query_integer=None, query_string=None, path_string=None, path_integer=None, header_number=None, **kwargs): # noqa: E501 - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_endpoint_enums_length_one_with_http_info(async_req=True) - >>> result = thread.get() - - Args: - - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to 'brillig', must be one of ['brillig'] - path_string (str): defaults to 'hello', must be one of ['hello'] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.test_client_model = Endpoint( + settings={ + 'response_type': 'Client', + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_client_model', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'Client', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_client_model + ) + + def __test_endpoint_enums_length_one(self, query_integer, query_string, path_string, path_integer, header_number, **kwargs): # noqa: E501 + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_enums_length_one(query_integer, query_string, path_string, path_integer, header_number, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int query_integer: (required) + :param str query_string: (required) + :param str path_string: (required) + :param int path_integer: (required) + :param float header_number: (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['query_integer', 'query_string', 'path_string', 'path_integer', 'header_number'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_endpoint_enums_length_one" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'query_integer' is set - if ('query_integer' not in local_var_params or - local_var_params['query_integer'] is None): - raise ApiValueError("Missing the required parameter `query_integer` when calling `test_endpoint_enums_length_one`") # noqa: E501 - # verify the required parameter 'query_string' is set - if ('query_string' not in local_var_params or - local_var_params['query_string'] is None): - raise ApiValueError("Missing the required parameter `query_string` when calling `test_endpoint_enums_length_one`") # noqa: E501 - # verify the required parameter 'path_string' is set - if ('path_string' not in local_var_params or - local_var_params['path_string'] is None): - raise ApiValueError("Missing the required parameter `path_string` when calling `test_endpoint_enums_length_one`") # noqa: E501 - # verify the required parameter 'path_integer' is set - if ('path_integer' not in local_var_params or - local_var_params['path_integer'] is None): - raise ApiValueError("Missing the required parameter `path_integer` when calling `test_endpoint_enums_length_one`") # noqa: E501 - # verify the required parameter 'header_number' is set - if ('header_number' not in local_var_params or - local_var_params['header_number'] is None): - raise ApiValueError("Missing the required parameter `header_number` when calling `test_endpoint_enums_length_one`") # noqa: E501 - allowed_values = [3] # noqa: E501 - if ('query_integer' in local_var_params and - local_var_params['query_integer'] not in allowed_values): - raise ValueError( - "Invalid value for `query_integer` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['query_integer'], allowed_values) + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) - allowed_values = ["brillig"] # noqa: E501 - if ('query_string' in local_var_params and - local_var_params['query_string'] not in allowed_values): - raise ValueError( - "Invalid value for `query_string` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['query_string'], allowed_values) + kwargs['query_integer'] = query_integer + kwargs['query_string'] = query_string + kwargs['path_string'] = path_string + kwargs['path_integer'] = path_integer + kwargs['header_number'] = header_number + return self.call_with_http_info(**kwargs) + + self.test_endpoint_enums_length_one = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/enums-of-length-one/{path_string}/{path_integer}', + 'operation_id': 'test_endpoint_enums_length_one', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'query_integer', + 'query_string', + 'path_string', + 'path_integer', + 'header_number', + ], + 'required': [ + 'query_integer', + 'query_string', + 'path_string', + 'path_integer', + 'header_number', + ], + 'nullable': [ + ], + 'enum': [ + 'query_integer', + 'query_string', + 'path_string', + 'path_integer', + 'header_number', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('query_integer',): { + + "3": 3 + }, + ('query_string',): { + + "BRILLIG": "brillig" + }, + ('path_string',): { + + "HELLO": "hello" + }, + ('path_integer',): { + + "34": 34 + }, + ('header_number',): { + + "1.234": 1.234 + }, + }, + 'openapi_types': { + 'query_integer': 'int', + 'query_string': 'str', + 'path_string': 'str', + 'path_integer': 'int', + 'header_number': 'float', + }, + 'attribute_map': { + 'query_integer': 'query_integer', + 'query_string': 'query_string', + 'path_string': 'path_string', + 'path_integer': 'path_integer', + 'header_number': 'header_number', + }, + 'location_map': { + 'query_integer': 'query', + 'query_string': 'query', + 'path_string': 'path', + 'path_integer': 'path', + 'header_number': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_endpoint_enums_length_one + ) + + def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) - allowed_values = ["hello"] # noqa: E501 - if ('path_string' in local_var_params and - local_var_params['path_string'] not in allowed_values): - raise ValueError( - "Invalid value for `path_string` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['path_string'], allowed_values) + kwargs['number'] = number + kwargs['double'] = double + kwargs['pattern_without_delimiter'] = pattern_without_delimiter + kwargs['byte'] = byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'http_basic_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_endpoint_parameters', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + 'integer', + 'int32', + 'int64', + 'float', + 'string', + 'binary', + 'date', + 'date_time', + 'password', + 'param_callback', + ], + 'required': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'integer', + 'int32', + 'float', + 'string', + 'password', + ] + }, + root_map={ + 'validations': { + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + }, + ('string',): { + + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'number': 'float', + 'double': 'float', + 'pattern_without_delimiter': 'str', + 'byte': 'str', + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'float': 'float', + 'string': 'str', + 'binary': 'file', + 'date': 'date', + 'date_time': 'datetime', + 'password': 'str', + 'param_callback': 'str', + }, + 'attribute_map': { + 'number': 'number', + 'double': 'double', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'float': 'float', + 'string': 'string', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'param_callback': 'callback', + }, + 'location_map': { + 'number': 'form', + 'double': 'form', + 'pattern_without_delimiter': 'form', + 'byte': 'form', + 'integer': 'form', + 'int32': 'form', + 'int64': 'form', + 'float': 'form', + 'string': 'form', + 'binary': 'form', + 'date': 'form', + 'date_time': 'form', + 'password': 'form', + 'param_callback': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_endpoint_parameters + ) + + def __test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) - allowed_values = [34] # noqa: E501 - if ('path_integer' in local_var_params and - local_var_params['path_integer'] not in allowed_values): - raise ValueError( - "Invalid value for `path_integer` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['path_integer'], allowed_values) + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_enum_parameters', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('enum_header_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_header_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_query_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_integer',): { + + "1": 1, + "-2": -2 + }, + ('enum_query_double',): { + + "1.1": 1.1, + "-1.2": -1.2 + }, + ('enum_form_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_form_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + }, + 'openapi_types': { + 'enum_header_string_array': 'list[str]', + 'enum_header_string': 'str', + 'enum_query_string_array': 'list[str]', + 'enum_query_string': 'str', + 'enum_query_integer': 'int', + 'enum_query_double': 'float', + 'enum_form_string_array': 'list[str]', + 'enum_form_string': 'str', + }, + 'attribute_map': { + 'enum_header_string_array': 'enum_header_string_array', + 'enum_header_string': 'enum_header_string', + 'enum_query_string_array': 'enum_query_string_array', + 'enum_query_string': 'enum_query_string', + 'enum_query_integer': 'enum_query_integer', + 'enum_query_double': 'enum_query_double', + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + }, + 'location_map': { + 'enum_header_string_array': 'header', + 'enum_header_string': 'header', + 'enum_query_string_array': 'query', + 'enum_query_string': 'query', + 'enum_query_integer': 'query', + 'enum_query_double': 'query', + 'enum_form_string_array': 'form', + 'enum_form_string': 'form', + }, + 'collection_format_map': { + 'enum_header_string_array': 'csv', + 'enum_query_string_array': 'csv', + 'enum_form_string_array': 'csv', + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_enum_parameters + ) + + def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) - allowed_values = [1.234] # noqa: E501 - if ('header_number' in local_var_params and - local_var_params['header_number'] not in allowed_values): - raise ValueError( - "Invalid value for `header_number` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['header_number'], allowed_values) + kwargs['required_string_group'] = required_string_group + kwargs['required_boolean_group'] = required_boolean_group + kwargs['required_int64_group'] = required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_group_parameters', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + 'string_group', + 'boolean_group', + 'int64_group', + ], + 'required': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'required_string_group': 'int', + 'required_boolean_group': 'bool', + 'required_int64_group': 'int', + 'string_group': 'int', + 'boolean_group': 'bool', + 'int64_group': 'int', + }, + 'attribute_map': { + 'required_string_group': 'required_string_group', + 'required_boolean_group': 'required_boolean_group', + 'required_int64_group': 'required_int64_group', + 'string_group': 'string_group', + 'boolean_group': 'boolean_group', + 'int64_group': 'int64_group', + }, + 'location_map': { + 'required_string_group': 'query', + 'required_boolean_group': 'header', + 'required_int64_group': 'query', + 'string_group': 'query', + 'boolean_group': 'header', + 'int64_group': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_group_parameters + ) + + def __test_inline_additional_properties(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param dict(str, str) param: request body (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) - - collection_formats = {} - - path_params = {} - if 'path_string' in local_var_params: - path_params['path_string'] = local_var_params['path_string'] # noqa: E501 - if 'path_integer' in local_var_params: - path_params['path_integer'] = local_var_params['path_integer'] # noqa: E501 - - query_params = [] - if 'query_integer' in local_var_params: - query_params.append(('query_integer', local_var_params['query_integer'])) # noqa: E501 - if 'query_string' in local_var_params: - query_params.append(('query_string', local_var_params['query_string'])) # noqa: E501 - - header_params = {} - if 'header_number' in local_var_params: - header_params['header_number'] = local_var_params['header_number'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/enums-of-length-one/{path_string}/{path_integer}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None double (float): None pattern_without_delimiter (str): None byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + kwargs['param'] = param + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/inline-additionalProperties', + 'operation_id': 'test_inline_additional_properties', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'param', + ], + 'required': [ + 'param', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': 'dict(str, str)', + }, + 'attribute_map': { + }, + 'location_map': { + 'param': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_inline_additional_properties + ) + + def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str param: field1 (required) + :param str param2: field2 (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 - else: - (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 - return data - - def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['param'] = param + kwargs['param2'] = param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/jsonFormData', + 'operation_id': 'test_json_form_data', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'param', + 'param2', + ], + 'required': [ + 'param', + 'param2', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': 'str', + 'param2': 'str', + }, + 'attribute_map': { + 'param': 'param', + 'param2': 'param2', + }, + 'location_map': { + 'param': 'form', + 'param2': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_json_form_data + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint Args: - number (float): None double (float): None pattern_without_delimiter (str): None byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called """ - - local_var_params = locals() - - all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_endpoint_parameters" % key + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'number' is set - if ('number' not in local_var_params or - local_var_params['number'] is None): - raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'double' is set - if ('double' not in local_var_params or - local_var_params['double'] is None): - raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in local_var_params or - local_var_params['pattern_without_delimiter'] is None): - raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 - # verify the required parameter 'byte' is set - if ('byte' not in local_var_params or - local_var_params['byte'] is None): - raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 - raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 - raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 - raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 - raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 - raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 - raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if ('password' in local_var_params and - len(local_var_params['password']) > 64): - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if ('password' in local_var_params and - len(local_var_params['password']) < 10): - raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - if 'integer' in local_var_params: - form_params.append(('integer', local_var_params['integer'])) # noqa: E501 - if 'int32' in local_var_params: - form_params.append(('int32', local_var_params['int32'])) # noqa: E501 - if 'int64' in local_var_params: - form_params.append(('int64', local_var_params['int64'])) # noqa: E501 - if 'number' in local_var_params: - form_params.append(('number', local_var_params['number'])) # noqa: E501 - if 'float' in local_var_params: - form_params.append(('float', local_var_params['float'])) # noqa: E501 - if 'double' in local_var_params: - form_params.append(('double', local_var_params['double'])) # noqa: E501 - if 'string' in local_var_params: - form_params.append(('string', local_var_params['string'])) # noqa: E501 - if 'pattern_without_delimiter' in local_var_params: - form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501 - if 'byte' in local_var_params: - form_params.append(('byte', local_var_params['byte'])) # noqa: E501 - if 'binary' in local_var_params: - local_var_files['binary'] = local_var_params['binary'] # noqa: E501 - if 'date' in local_var_params: - form_params.append(('date', local_var_params['date'])) # noqa: E501 - if 'date_time' in local_var_params: - form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501 - if 'password' in local_var_params: - form_params.append(('password', local_var_params['password'])) # noqa: E501 - if 'param_callback' in local_var_params: - form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 - - # Authentication setting - auth_settings = ['http_basic_test'] # noqa: E501 - - return self.api_client.call_api( - '/fake', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_enum_parameters(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - enum_header_string_array (list[str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' - enum_query_string_array (list[str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array (list[str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of '$' - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 - return data - - def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_enum_parameters_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - enum_header_string_array (list[str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' - enum_query_string_array (list[str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array (list[str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of '$' - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - all_params = ['enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double', 'enum_form_string_array', 'enum_form_string'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_enum_parameters" % key + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] ) - local_var_params[key] = val - del local_var_params['kwargs'] - allowed_values = [">", "$"] # noqa: E501 - if ('enum_header_string_array' in local_var_params and - not set(local_var_params['enum_header_string_array']).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `enum_header_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(local_var_params['enum_header_string_array']) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 - if ('enum_header_string' in local_var_params and - local_var_params['enum_header_string'] not in allowed_values): - raise ValueError( - "Invalid value for `enum_header_string` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['enum_header_string'], allowed_values) - ) - allowed_values = [">", "$"] # noqa: E501 - if ('enum_query_string_array' in local_var_params and - not set(local_var_params['enum_query_string_array']).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `enum_query_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(local_var_params['enum_query_string_array']) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 - if ('enum_query_string' in local_var_params and - local_var_params['enum_query_string'] not in allowed_values): - raise ValueError( - "Invalid value for `enum_query_string` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['enum_query_string'], allowed_values) - ) - allowed_values = [1, -2] # noqa: E501 - if ('enum_query_integer' in local_var_params and - local_var_params['enum_query_integer'] not in allowed_values): - raise ValueError( - "Invalid value for `enum_query_integer` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['enum_query_integer'], allowed_values) - ) - allowed_values = [1.1, -1.2] # noqa: E501 - if ('enum_query_double' in local_var_params and - local_var_params['enum_query_double'] not in allowed_values): - raise ValueError( - "Invalid value for `enum_query_double` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['enum_query_double'], allowed_values) - ) - allowed_values = [">", "$"] # noqa: E501 - if ('enum_form_string_array' in local_var_params and - not set(local_var_params['enum_form_string_array']).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(local_var_params['enum_form_string_array']) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) - allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 - if ('enum_form_string' in local_var_params and - local_var_params['enum_form_string'] not in allowed_values): - raise ValueError( - "Invalid value for `enum_form_string` ({0}), must be one of {1}" # noqa: E501 - .format(local_var_params['enum_form_string'], allowed_values) - ) - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'enum_query_string_array' in local_var_params: - query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 - collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if 'enum_query_string' in local_var_params: - query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if 'enum_query_integer' in local_var_params: - query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if 'enum_query_double' in local_var_params: - query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - - header_params = {} - if 'enum_header_string_array' in local_var_params: - header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 - collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 - if 'enum_header_string' in local_var_params: - header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501 - - form_params = [] - local_var_files = {} - if 'enum_form_string_array' in local_var_params: - form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501 - collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 - if 'enum_form_string' in local_var_params: - form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - return self.api_client.call_api( - '/fake', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters required_boolean_group (bool): Required Boolean in group parameters required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 - else: - (data) = self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 - return data - - def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters required_boolean_group (bool): Required Boolean in group parameters required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class """ - - local_var_params = locals() - - all_params = ['required_string_group', 'required_boolean_group', 'required_int64_group', 'string_group', 'boolean_group', 'int64_group'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_group_parameters" % key + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'required_string_group' is set - if ('required_string_group' not in local_var_params or - local_var_params['required_string_group'] is None): - raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_boolean_group' is set - if ('required_boolean_group' not in local_var_params or - local_var_params['required_boolean_group'] is None): - raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 - # verify the required parameter 'required_int64_group' is set - if ('required_int64_group' not in local_var_params or - local_var_params['required_int64_group'] is None): - raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'required_string_group' in local_var_params: - query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if 'required_int64_group' in local_var_params: - query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if 'string_group' in local_var_params: - query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if 'int64_group' in local_var_params: - query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - - header_params = {} - if 'required_boolean_group' in local_var_params: - header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 - if 'boolean_group' in local_var_params: - header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param (dict(str, str)): request body - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 else: - (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 - return data - - def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) - >>> result = thread.get() - - Args: - param (dict(str, str)): request body - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - local_var_params = locals() - - all_params = ['param'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_inline_additional_properties" % key + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if ('param' not in local_var_params or - local_var_params['param'] is None): - raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'param' in local_var_params: - body_params = local_var_params['param'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/fake/inline-additionalProperties', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 param2 (str): field2 - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 - else: - (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 - return data - - def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 param2 (str): field2 - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['param', 'param2'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_json_form_data" % key + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'param' is set - if ('param' not in local_var_params or - local_var_params['param'] is None): - raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 - # verify the required parameter 'param2' is set - if ('param2' not in local_var_params or - local_var_params['param2'] is None): - raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 - - collection_formats = {} - path_params = {} - - query_params = [] + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - header_params = {} + self.__validate_inputs(kwargs) - form_params = [] - local_var_files = {} - if 'param' in local_var_params: - form_params.append(('param', local_var_params['param'])) # noqa: E501 - if 'param2' in local_var_params: - form_params.append(('param2', local_var_params['param2'])) # noqa: E501 + params = self.__gather_params(kwargs) - body_params = None - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - # Authentication setting - auth_settings = [] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '/fake/jsonFormData', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index f054a0a8ec77..6811a990bbcc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -18,10 +18,14 @@ import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 +from petstore_api.exceptions import ( ApiTypeError, ApiValueError ) +from petstore_api.model_utils import ( + check_allowed_values, + check_validations +) class FakeClassnameTags123Api(object): @@ -36,122 +40,271 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def test_classname(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + def __test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Client: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 - return data - - def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_classname_with_http_info(body, async_req=True) - >>> result = thread.get() + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.test_classname = Endpoint( + settings={ + 'response_type': 'Client', + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'Client', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_classname + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint Args: - body (Client): client model - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Client: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations + ) - local_var_params = locals() + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + else: + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method test_classname" % key + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - header_params = {} + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - form_params = [] - local_var_files = {} + self.__validate_inputs(kwargs) - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + params = self.__gather_params(kwargs) - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - # Authentication setting - auth_settings = ['api_key_query'] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '/fake_classname_test', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Client', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index bd1b58aa9ee5..29bbead6c35a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -18,10 +18,14 @@ import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 +from petstore_api.exceptions import ( ApiTypeError, ApiValueError ) +from petstore_api.model_utils import ( + check_allowed_values, + check_validations +) class PetApi(object): @@ -36,1078 +40,963 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def add_pet(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() + def __add_pet(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 - Args: - body (Pet): Pet object that needs to be added to the store + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param async_req bool: execute request asynchronously + :param Pet body: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 - return data - - def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.add_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'add_pet', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'Pet', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__add_pet + ) + + def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_pet(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'delete_pet', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'api_key', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': 'int', + 'api_key': 'str', + }, + 'attribute_map': { + 'pet_id': 'petId', + 'api_key': 'api_key', + }, + 'location_map': { + 'pet_id': 'path', + 'api_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_pet + ) + + def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] status: Status values that need to be considered for filter (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 - return data - - def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: list[Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['status'] = status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = Endpoint( + settings={ + 'response_type': 'list[Pet]', + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByStatus', + 'operation_id': 'find_pets_by_status', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'status', + ], + 'required': [ + 'status', + ], + 'nullable': [ + ], + 'enum': [ + 'status', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('status',): { + + "AVAILABLE": "available", + "PENDING": "pending", + "SOLD": "sold" + }, + }, + 'openapi_types': { + 'status': 'list[str]', + }, + 'attribute_map': { + 'status': 'status', + }, + 'location_map': { + 'status': 'query', + }, + 'collection_format_map': { + 'status': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_status + ) + + def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] tags: Tags to filter by (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['pet_id', 'api_key'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): - raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'api_key' in local_var_params: - header_params['api_key'] = local_var_params['api_key'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet/{petId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def find_pets_by_status(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status (list[str]): Status values that need to be considered for filter - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: list[Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['tags'] = tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = Endpoint( + settings={ + 'response_type': 'list[Pet]', + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByTags', + 'operation_id': 'find_pets_by_tags', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'tags', + ], + 'required': [ + 'tags', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tags': 'list[str]', + }, + 'attribute_map': { + 'tags': 'tags', + }, + 'location_map': { + 'tags': 'query', + }, + 'collection_format_map': { + 'tags': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_tags + ) + + def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to return (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - list[Pet]: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 - else: - (data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 - return data - - def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) - >>> result = thread.get() - - Args: - status (list[str]): Status values that need to be considered for filter - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = Endpoint( + settings={ + 'response_type': 'Pet', + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'get_pet_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': 'int', + }, + 'attribute_map': { + 'pet_id': 'petId', + }, + 'location_map': { + 'pet_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_pet_by_id + ) + + def __update_pet(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet body: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - list[Pet]: - """ - - local_var_params = locals() - - all_params = ['status'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_status" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'status' is set - if ('status' not in local_var_params or - local_var_params['status'] is None): - raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if ('status' in local_var_params and - not set(local_var_params['status']).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `status` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(local_var_params['status']) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'status' in local_var_params: - query_params.append(('status', local_var_params['status'])) # noqa: E501 - collection_formats['status'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet/findByStatus', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags (list[str]): Tags to filter by - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.update_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'update_pet', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'Pet', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__update_pet + ) + + def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - list[Pet]: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 - else: - (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 - return data - - def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) - >>> result = thread.get() - - Args: - tags (list[str]): Tags to filter by - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'update_pet_with_form', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'name', + 'status', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': 'int', + 'name': 'str', + 'status': 'str', + }, + 'attribute_map': { + 'pet_id': 'petId', + 'name': 'name', + 'status': 'status', + }, + 'location_map': { + 'pet_id': 'path', + 'name': 'form', + 'status': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__update_pet_with_form + ) + + def __upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - list[Pet]: - """ - - local_var_params = locals() - - all_params = ['tags'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_pets_by_tags" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'tags' is set - if ('tags' not in local_var_params or - local_var_params['tags'] is None): - raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'tags' in local_var_params: - query_params.append(('tags', local_var_params['tags'])) # noqa: E501 - collection_formats['tags'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet/findByTags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Pet]', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = Endpoint( + settings={ + 'response_type': 'ApiResponse', + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}/uploadImage', + 'operation_id': 'upload_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'additional_metadata', + 'file', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': 'int', + 'additional_metadata': 'str', + 'file': 'file', + }, + 'attribute_map': { + 'pet_id': 'petId', + 'additional_metadata': 'additionalMetadata', + 'file': 'file', + }, + 'location_map': { + 'pet_id': 'path', + 'additional_metadata': 'form', + 'file': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file + ) + + def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to update (required) + :param file required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Pet: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 - else: - (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 - return data - - def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) - >>> result = thread.get() + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['pet_id'] = pet_id + kwargs['required_file'] = required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = Endpoint( + settings={ + 'response_type': 'ApiResponse', + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', + 'operation_id': 'upload_file_with_required_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'required_file', + 'additional_metadata', + ], + 'required': [ + 'pet_id', + 'required_file', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': 'int', + 'required_file': 'file', + 'additional_metadata': 'str', + }, + 'attribute_map': { + 'pet_id': 'petId', + 'required_file': 'requiredFile', + 'additional_metadata': 'additionalMetadata', + }, + 'location_map': { + 'pet_id': 'path', + 'required_file': 'form', + 'additional_metadata': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file_with_required_file + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint Args: - pet_id (int): ID of pet to return - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Pet: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called """ - - local_var_params = locals() - - all_params = ['pet_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_pet_by_id" % key + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): - raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/pet/{petId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Pet', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_pet(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 - return data - - def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 - else: - (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 - return data - - def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class """ - - local_var_params = locals() - - all_params = ['pet_id', 'name', 'status'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet_with_form" % key + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): - raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - if 'name' in local_var_params: - form_params.append(('name', local_var_params['name'])) # noqa: E501 - if 'status' in local_var_params: - form_params.append(('status', local_var_params['status'])) # noqa: E501 - - body_params = None - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet/{petId}', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def upload_file(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file): file to upload. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - ApiResponse: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 else: - (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 - return data - - def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file): file to upload. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - ApiResponse: - """ + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - local_var_params = locals() - - all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file" % key + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'file' in local_var_params: - local_var_files['file'] = local_var_params['file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 - - return self.api_client.call_api( - '/pet/{petId}/uploadImage', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ApiResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update required_file (file): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - ApiResponse: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 - else: - (data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 - return data - - def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update required_file (file): file to upload - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - Returns: - ApiResponse: - """ + self.__validate_inputs(kwargs) - local_var_params = locals() + params = self.__gather_params(kwargs) - all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_file_with_required_file" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): - raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 - # verify the required parameter 'required_file' is set - if ('required_file' not in local_var_params or - local_var_params['required_file'] is None): - raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'pet_id' in local_var_params: - path_params['petId'] = local_var_params['pet_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - if 'additional_metadata' in local_var_params: - form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 - if 'required_file' in local_var_params: - local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 - - # Authentication setting - auth_settings = ['petstore_auth'] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '/fake/{petId}/uploadImageWithRequiredFile', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ApiResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index c80423baf480..db3f4d2561df 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -18,10 +18,14 @@ import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 +from petstore_api.exceptions import ( ApiTypeError, ApiValueError ) +from petstore_api.model_utils import ( + check_allowed_values, + check_validations +) class StoreApi(object): @@ -36,456 +40,503 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def delete_order(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + def __delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str order_id: ID of the order that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 - return data - - def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_order_with_http_info(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['order_id'] = order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'delete_order', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': 'str', + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_order + ) + + def __get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['order_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_order" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if ('order_id' not in local_var_params or - local_var_params['order_id'] is None): - raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/store/order/{order_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_inventory(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: dict(str, int) + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.get_inventory = Endpoint( + settings={ + 'response_type': 'dict(str, int)', + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/store/inventory', + 'operation_id': 'get_inventory', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_inventory + ) + + def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int order_id: ID of pet that needs to be fetched (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - dict(str, int): - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_inventory_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 - return data - - def get_inventory_with_http_info(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_inventory_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['order_id'] = order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = Endpoint( + settings={ + 'response_type': 'Order', + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'get_order_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'order_id', + ] + }, + root_map={ + 'validations': { + ('order_id',): { + + 'inclusive_maximum': 5, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': 'int', + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_order_by_id + ) + + def __place_order(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Order body: order placed for purchasing the pet (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - dict(str, int): - """ - - local_var_params = locals() - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_inventory" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_key'] # noqa: E501 - - return self.api_client.call_api( - '/store/inventory', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, int)', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_order_by_id(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Order: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 - else: - (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 - return data - - def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) - >>> result = thread.get() + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.place_order = Endpoint( + settings={ + 'response_type': 'Order', + 'auth': [], + 'endpoint_path': '/store/order', + 'operation_id': 'place_order', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'Order', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__place_order + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Order: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called """ - - local_var_params = locals() - - all_params = ['order_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_order_by_id" % key + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if ('order_id' not in local_var_params or - local_var_params['order_id'] is None): - raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 - - query_params = [] - - header_params = {} - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/store/order/{order_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def place_order(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) - Returns: - Order: + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.place_order_with_http_info(body, **kwargs) # noqa: E501 + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) else: - (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 - return data - - def place_order_with_http_info(self, body, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_order_with_http_info(body, async_req=True) - >>> result = thread.get() + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - Order: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_order" % key + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 - - collection_formats = {} - - path_params = {} - query_params = [] + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - header_params = {} + self.__validate_inputs(kwargs) - form_params = [] - local_var_files = {} + params = self.__gather_params(kwargs) - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - # Authentication setting - auth_settings = [] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '/store/order', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Order', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index c8de4c6c277c..7a3fb67c1268 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -18,10 +18,14 @@ import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( # noqa: F401 +from petstore_api.exceptions import ( ApiTypeError, ApiValueError ) +from petstore_api.model_utils import ( + check_allowed_values, + check_validations +) class UserApi(object): @@ -36,900 +40,808 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_user(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + def __create_user(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param User body: Created user object (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_user_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_user_with_http_info(self, body, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_users_with_array_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body (list[User]): List of user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.create_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user', + 'operation_id': 'create_user', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'User', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__create_user + ) + + def __create_users_with_array_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[User] body: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (list[User]): List of user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithArray', + 'operation_id': 'create_users_with_array_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'list[User]', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__create_users_with_array_input + ) + + def __create_users_with_list_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[User] body: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_array_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user/createWithArray', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_users_with_list_input(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body (list[User]): List of user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithList', + 'operation_id': 'create_users_with_list_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': 'list[User]', + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__create_users_with_list_input + ) + + def __delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The name that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) - >>> result = thread.get() - - Args: - body (list[User]): List of user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['username'] = username + return self.call_with_http_info(**kwargs) + + self.delete_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': 'str', + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_user + ) + + def __get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_users_with_list_input" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user/createWithList', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_user(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['username'] = username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = Endpoint( + settings={ + 'response_type': 'User', + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'get_user_by_name', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': 'str', + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_user_by_name + ) + + def __login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 - else: - (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 - return data - - def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_with_http_info(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['username'] = username + kwargs['password'] = password + return self.call_with_http_info(**kwargs) + + self.login_user = Endpoint( + settings={ + 'response_type': 'str', + 'auth': [], + 'endpoint_path': '/user/login', + 'operation_id': 'login_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'password', + ], + 'required': [ + 'username', + 'password', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': 'str', + 'password': 'str', + }, + 'attribute_map': { + 'username': 'username', + 'password': 'password', + }, + 'location_map': { + 'username': 'query', + 'password': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__login_user + ) + + def __logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['username'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): - raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user/{username}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_user_by_name(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + return self.call_with_http_info(**kwargs) + + self.logout_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/logout', + 'operation_id': 'logout_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__logout_user + ) + + def __update_user(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :param _return_http_data_only: response data without head status + code and headers + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - User: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 - else: - (data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 - return data - - def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) - >>> result = thread.get() + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['username'] = username + kwargs['body'] = body + return self.call_with_http_info(**kwargs) + + self.update_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'update_user', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'body', + ], + 'required': [ + 'username', + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': 'str', + 'body': 'User', + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__update_user + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - User: + settings (dict): see below key value pairs + 'response_type' (str): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called """ - - local_var_params = locals() - - all_params = ['username'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ]) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param], + self.validations ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): - raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user/{username}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='User', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def login_user(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login password (str): The password for login in clear text - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - str: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 - else: - (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 - return data - - def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_user_with_http_info(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login password (str): The password for login in clear text - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - str: - """ - - local_var_params = locals() - - all_params = ['username', 'password'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_user" % key + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): - raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 - # verify the required parameter 'password' is set - if ('password' not in local_var_params or - local_var_params['password'] is None): - raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - if 'username' in local_var_params: - query_params.append(('username', local_var_params['username'])) # noqa: E501 - if 'password' in local_var_params: - query_params.append(('password', local_var_params['password'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/xml', 'application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user/login', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def logout_user(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == 'file'): + param_location = 'file' + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.logout_user_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 - return data - - def logout_user_with_http_info(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.logout_user_with_http_info(async_req=True) - >>> result = thread.get() - - - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_user" % key + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + if kwargs.get('_host_index') and self.settings['servers']: + _host_index = kwargs.get('_host_index') + try: + _host = self.settings['servers'][_host_index] + except IndexError: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/user/logout', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_user(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted body (User): Updated user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 else: - (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 - return data - - def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 - """Updated user # noqa: E501 + try: + _host = self.settings['servers'][0] + except IndexError: + _host = None - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user_with_http_info(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted body (User): Updated user object - - Keyword Args: - async_req (bool): execute request asynchronously - param _preload_content (bool): if False, the urllib3.HTTPResponse - object will be returned without reading/decoding response data. - Default is True. - param _request_timeout (float/tuple): timeout setting for this - request. If one number provided, it will be total request - timeout. It can also be a pair (tuple) of (connection, read) - timeouts. - - Returns: - None: - """ - - local_var_params = locals() - - all_params = ['username', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user" % key + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + if key not in self.params_map['nullable'] and value is None: + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): - raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 - # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): - raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 - - collection_formats = {} - path_params = {} - if 'username' in local_var_params: - path_params['username'] = local_var_params['username'] # noqa: E501 + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) - query_params = [] + self.__validate_inputs(kwargs) - header_params = {} + params = self.__gather_params(kwargs) - form_params = [] - local_var_files = {} + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # Authentication setting - auth_settings = [] # noqa: E501 + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( - '/user/{username}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs.get('async_req'), + _return_http_data_only=kwargs.get('_return_http_data_only'), + _preload_content=kwargs.get('_preload_content', True), + _request_timeout=kwargs.get('_request_timeout'), + _host=_host, + collection_formats=params['collection_format']) 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 df3a9815aa04..7afd6306dcfc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import datetime +import inspect import json import mimetypes from multiprocessing.pool import ThreadPool @@ -22,9 +23,13 @@ import six from six.moves.urllib.parse import quote -from petstore_api.configuration import Configuration import petstore_api.models from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple +) from petstore_api.exceptions import ApiValueError @@ -216,7 +221,7 @@ def sanitize_for_serialization(self, obj): if isinstance(obj, dict): obj_dict = obj - else: + elif isinstance(obj, ModelNormal): # Convert model obj to dict except # attributes `openapi_types`, `attribute_map` # and attributes which value is not None. @@ -225,6 +230,8 @@ def sanitize_for_serialization(self, obj): obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) for attr, _ in six.iteritems(obj.openapi_types) if getattr(obj, attr) is not None} + elif isinstance(obj, ModelSimple): + return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) for key, val in six.iteritems(obj_dict)} @@ -563,6 +570,8 @@ def __deserialize_primitive(self, data, klass): return six.text_type(data) except TypeError: return data + except ValueError as exc: + raise ApiValueError(str(exc)) def __deserialize_object(self, value): """Return an original value. @@ -614,25 +623,39 @@ def __deserialize_model(self, data, klass): """Deserializes list or dict to model. :param data: dict, list. - :param klass: class literal. + :param klass: class literal, ModelSimple or ModelNormal :return: model object. """ - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): - return data + if issubclass(klass, ModelSimple): + value = self.__deserialize(data, klass.openapi_types['value']) + return klass(value) - kwargs = {} + # code to handle ModelNormal + used_data = data + if not isinstance(data, (list, dict)): + used_data = [data] + keyword_args = {} + positional_args = [] if klass.openapi_types is not None: 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))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - instance = klass(**kwargs) - + klass.attribute_map[attr] in used_data): + value = used_data[klass.attribute_map[attr]] + keyword_args[attr] = self.__deserialize(value, attr_type) + end_index = None + argspec = inspect.getargspec(getattr(klass, '__init__')) + if argspec.defaults: + end_index = -len(argspec.defaults) + required_positional_args = argspec.args[1:end_index] + for index, req_positional_arg in enumerate(required_positional_args): + if keyword_args and req_positional_arg in keyword_args: + positional_args.append(keyword_args[req_positional_arg]) + del keyword_args[req_positional_arg] + elif (not keyword_args and index < len(used_data) and + isinstance(used_data, list)): + positional_args.append(used_data[index]) + instance = klass(*positional_args, **keyword_args) if hasattr(instance, 'get_real_child_model'): klass_name = instance.get_real_child_model(data) if klass_name: diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index fa0c3f4d320c..459ff6a3ca25 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -67,6 +67,9 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ self.username = username """Username for HTTP basic authentication """ @@ -227,11 +230,15 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py new file mode 100644 index 000000000000..57ca211a0f7c --- /dev/null +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -0,0 +1,183 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import re + +from petstore_api.exceptions import ApiValueError + + +def check_allowed_values(allowed_values, input_variable_path, input_values, + validations): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + validations (dict): the validations dict + """ + min_collection_length = ( + validations.get(input_variable_path, {}).get('min_length') or + validations.get(input_variable_path, {}).get('min_items', 0)) + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and len(input_values) > min_collection_length + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and len(input_values) > min_collection_length + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def check_validations(validations, input_variable_path, input_values): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking + """ + current_validations = validations[input_variable_path] + if ('max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if ('min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if ('max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if ('min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + if ('exclusive_maximum' in current_validations and + input_values >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_maximum' in current_validations and + input_values > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if ('exclusive_minimum' in current_validations and + input_values <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_minimum' in current_validations and + input_values < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if ('regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + raise ApiValueError( + r"Invalid value for `%s`, must be a follow pattern or equal to " + r"`%s` with flags=`%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'], + flags + ) + ) + + +class ModelSimple(object): + # the parent class of models whose type != object in their swagger/openapi + # spec + pass + + +class ModelNormal(object): + # the parent class of models whose type == object in their swagger/openapi + # spec + pass diff --git a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py index 96fd17471f19..1f2bb89aa33d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -52,9 +52,11 @@ from petstore_api.models.order import Order from petstore_api.models.outer_composite import OuterComposite from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_number import OuterNumber from petstore_api.models.pet import Pet from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap from petstore_api.models.tag import Tag from petstore_api.models.type_holder_default import TypeHolderDefault from petstore_api.models.type_holder_example import TypeHolderExample diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py index ec5fa2a9a28e..25e165ed7b57 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesAnyType(object): + +class AdditionalPropertiesAnyType(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesAnyType. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py index e04ae6f4c04c..5de262b864d9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesArray(object): + +class AdditionalPropertiesArray(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesArray. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py index f5e7dc23d238..70675c7d3aee 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesBoolean(object): + +class AdditionalPropertiesBoolean(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesBoolean. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py index d5082c17ce48..efa4d6a09d19 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -10,38 +10,45 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesClass(object): + +class AdditionalPropertiesClass(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'map_string': 'dict(str, str)', - 'map_number': 'dict(str, float)', - 'map_integer': 'dict(str, int)', - 'map_boolean': 'dict(str, bool)', - 'map_array_integer': 'dict(str, list[int])', - 'map_array_anytype': 'dict(str, list[object])', - 'map_map_string': 'dict(str, dict(str, str))', - 'map_map_anytype': 'dict(str, dict(str, object))', - 'anytype_1': 'object', - 'anytype_2': 'object', - 'anytype_3': 'object', + + allowed_values = { } attribute_map = { @@ -55,27 +62,28 @@ class AdditionalPropertiesClass(object): 'map_map_anytype': 'map_map_anytype', # noqa: E501 'anytype_1': 'anytype_1', # noqa: E501 'anytype_2': 'anytype_2', # noqa: E501 - 'anytype_3': 'anytype_3', # noqa: E501 + 'anytype_3': 'anytype_3' # noqa: E501 + } + + openapi_types = { + 'map_string': 'dict(str, str)', + 'map_number': 'dict(str, float)', + 'map_integer': 'dict(str, int)', + 'map_boolean': 'dict(str, bool)', + 'map_array_integer': 'dict(str, list[int])', + 'map_array_anytype': 'dict(str, list[object])', + 'map_map_string': 'dict(str, dict(str, str))', + 'map_map_anytype': 'dict(str, dict(str, object))', + 'anytype_1': 'object', + 'anytype_2': 'object', + 'anytype_3': 'object' + } + + validations = { } def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - - - Keyword Args: - map_string (dict(str, str)): [optional] # noqa: E501 - map_number (dict(str, float)): [optional] # noqa: E501 - map_integer (dict(str, int)): [optional] # noqa: E501 - map_boolean (dict(str, bool)): [optional] # noqa: E501 - map_array_integer (dict(str, list[int])): [optional] # noqa: E501 - map_array_anytype (dict(str, list[object])): [optional] # noqa: E501 - map_map_string (dict(str, dict(str, str))): [optional] # noqa: E501 - map_map_anytype (dict(str, dict(str, object))): [optional] # noqa: E501 - anytype_1 (object): [optional] # noqa: E501 - anytype_2 (object): [optional] # noqa: E501 - anytype_3 (object): [optional] # noqa: E501 - """ + """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 self._map_string = None self._map_number = None @@ -91,27 +99,49 @@ def __init__(self, map_string=None, map_number=None, map_integer=None, map_boole self.discriminator = None if map_string is not None: - self.map_string = map_string # noqa: E501 + self.map_string = ( + map_string + ) if map_number is not None: - self.map_number = map_number # noqa: E501 + self.map_number = ( + map_number + ) if map_integer is not None: - self.map_integer = map_integer # noqa: E501 + self.map_integer = ( + map_integer + ) if map_boolean is not None: - self.map_boolean = map_boolean # noqa: E501 + self.map_boolean = ( + map_boolean + ) if map_array_integer is not None: - self.map_array_integer = map_array_integer # noqa: E501 + self.map_array_integer = ( + map_array_integer + ) if map_array_anytype is not None: - self.map_array_anytype = map_array_anytype # noqa: E501 + self.map_array_anytype = ( + map_array_anytype + ) if map_map_string is not None: - self.map_map_string = map_map_string # noqa: E501 + self.map_map_string = ( + map_map_string + ) if map_map_anytype is not None: - self.map_map_anytype = map_map_anytype # noqa: E501 + self.map_map_anytype = ( + map_map_anytype + ) if anytype_1 is not None: - self.anytype_1 = anytype_1 # noqa: E501 + self.anytype_1 = ( + anytype_1 + ) if anytype_2 is not None: - self.anytype_2 = anytype_2 # noqa: E501 + self.anytype_2 = ( + anytype_2 + ) if anytype_3 is not None: - self.anytype_3 = anytype_3 # noqa: E501 + self.anytype_3 = ( + anytype_3 + ) @property def map_string(self): @@ -124,9 +154,7 @@ def map_string(self): return self._map_string @map_string.setter - def map_string( - self, - map_string): + def map_string(self, map_string): # noqa: E501 """Sets the map_string of this AdditionalPropertiesClass. @@ -135,7 +163,8 @@ def map_string( """ self._map_string = ( - map_string) + map_string + ) @property def map_number(self): @@ -148,9 +177,7 @@ def map_number(self): return self._map_number @map_number.setter - def map_number( - self, - map_number): + def map_number(self, map_number): # noqa: E501 """Sets the map_number of this AdditionalPropertiesClass. @@ -159,7 +186,8 @@ def map_number( """ self._map_number = ( - map_number) + map_number + ) @property def map_integer(self): @@ -172,9 +200,7 @@ def map_integer(self): return self._map_integer @map_integer.setter - def map_integer( - self, - map_integer): + def map_integer(self, map_integer): # noqa: E501 """Sets the map_integer of this AdditionalPropertiesClass. @@ -183,7 +209,8 @@ def map_integer( """ self._map_integer = ( - map_integer) + map_integer + ) @property def map_boolean(self): @@ -196,9 +223,7 @@ def map_boolean(self): return self._map_boolean @map_boolean.setter - def map_boolean( - self, - map_boolean): + def map_boolean(self, map_boolean): # noqa: E501 """Sets the map_boolean of this AdditionalPropertiesClass. @@ -207,7 +232,8 @@ def map_boolean( """ self._map_boolean = ( - map_boolean) + map_boolean + ) @property def map_array_integer(self): @@ -220,9 +246,7 @@ def map_array_integer(self): return self._map_array_integer @map_array_integer.setter - def map_array_integer( - self, - map_array_integer): + def map_array_integer(self, map_array_integer): # noqa: E501 """Sets the map_array_integer of this AdditionalPropertiesClass. @@ -231,7 +255,8 @@ def map_array_integer( """ self._map_array_integer = ( - map_array_integer) + map_array_integer + ) @property def map_array_anytype(self): @@ -244,9 +269,7 @@ def map_array_anytype(self): return self._map_array_anytype @map_array_anytype.setter - def map_array_anytype( - self, - map_array_anytype): + def map_array_anytype(self, map_array_anytype): # noqa: E501 """Sets the map_array_anytype of this AdditionalPropertiesClass. @@ -255,7 +278,8 @@ def map_array_anytype( """ self._map_array_anytype = ( - map_array_anytype) + map_array_anytype + ) @property def map_map_string(self): @@ -268,9 +292,7 @@ def map_map_string(self): return self._map_map_string @map_map_string.setter - def map_map_string( - self, - map_map_string): + def map_map_string(self, map_map_string): # noqa: E501 """Sets the map_map_string of this AdditionalPropertiesClass. @@ -279,7 +301,8 @@ def map_map_string( """ self._map_map_string = ( - map_map_string) + map_map_string + ) @property def map_map_anytype(self): @@ -292,9 +315,7 @@ def map_map_anytype(self): return self._map_map_anytype @map_map_anytype.setter - def map_map_anytype( - self, - map_map_anytype): + def map_map_anytype(self, map_map_anytype): # noqa: E501 """Sets the map_map_anytype of this AdditionalPropertiesClass. @@ -303,7 +324,8 @@ def map_map_anytype( """ self._map_map_anytype = ( - map_map_anytype) + map_map_anytype + ) @property def anytype_1(self): @@ -316,9 +338,7 @@ def anytype_1(self): return self._anytype_1 @anytype_1.setter - def anytype_1( - self, - anytype_1): + def anytype_1(self, anytype_1): # noqa: E501 """Sets the anytype_1 of this AdditionalPropertiesClass. @@ -327,7 +347,8 @@ def anytype_1( """ self._anytype_1 = ( - anytype_1) + anytype_1 + ) @property def anytype_2(self): @@ -340,9 +361,7 @@ def anytype_2(self): return self._anytype_2 @anytype_2.setter - def anytype_2( - self, - anytype_2): + def anytype_2(self, anytype_2): # noqa: E501 """Sets the anytype_2 of this AdditionalPropertiesClass. @@ -351,7 +370,8 @@ def anytype_2( """ self._anytype_2 = ( - anytype_2) + anytype_2 + ) @property def anytype_3(self): @@ -364,9 +384,7 @@ def anytype_3(self): return self._anytype_3 @anytype_3.setter - def anytype_3( - self, - anytype_3): + def anytype_3(self, anytype_3): # noqa: E501 """Sets the anytype_3 of this AdditionalPropertiesClass. @@ -375,7 +393,8 @@ def anytype_3( """ self._anytype_3 = ( - anytype_3) + anytype_3 + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py index 9b3715f8f26c..55ba58e1e20a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesInteger(object): + +class AdditionalPropertiesInteger(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesInteger. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py index 1d4e26e87339..32a59a5bc522 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesNumber(object): + +class AdditionalPropertiesNumber(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesNumber. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py index 96b92ade0188..362023c8460e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesObject(object): + +class AdditionalPropertiesObject(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesObject. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py index a61c1fb70e85..e01ff7028f23 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class AdditionalPropertiesString(object): + +class AdditionalPropertiesString(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI - + openapi_types = { + 'name': 'str' + } + validations = { + } - Keyword Args: - name (str): [optional] # noqa: E501 - """ + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 self._name = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def name(self): @@ -64,9 +84,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this AdditionalPropertiesString. @@ -75,7 +93,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index d5c0162b088a..a2ce846a64d7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -10,34 +10,50 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Animal(object): + +class Animal(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'class_name': 'str', - 'color': 'str', + + allowed_values = { } attribute_map = { 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 + 'color': 'color' # noqa: E501 } discriminator_value_class_map = { @@ -45,15 +61,16 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name, color=None): # noqa: E501 - """Animal - a model defined in OpenAPI + openapi_types = { + 'class_name': 'str', + 'color': 'str' + } - Args: - class_name (str): + validations = { + } - Keyword Args: # noqa: E501 - color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 - """ + def __init__(self, class_name=None, color='red'): # noqa: E501 + """Animal - a model defined in OpenAPI""" # noqa: E501 self._class_name = None self._color = None @@ -61,7 +78,9 @@ def __init__(self, class_name, color=None): # noqa: E501 self.class_name = class_name if color is not None: - self.color = color # noqa: E501 + self.color = ( + color + ) @property def class_name(self): @@ -74,9 +93,7 @@ def class_name(self): return self._class_name @class_name.setter - def class_name( - self, - class_name): + def class_name(self, class_name): # noqa: E501 """Sets the class_name of this Animal. @@ -84,10 +101,11 @@ def class_name( :type: str """ if class_name is None: - raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 self._class_name = ( - class_name) + class_name + ) @property def color(self): @@ -100,9 +118,7 @@ def color(self): return self._color @color.setter - def color( - self, - color): + def color(self, color): # noqa: E501 """Sets the color of this Animal. @@ -111,7 +127,8 @@ def color( """ self._color = ( - color) + color + ) def get_real_child_model(self, data): """Returns the real base class specified by the discriminator""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/client/petstore/python-experimental/petstore_api/models/api_response.py index 431819627147..4f9f3a12bd47 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -10,48 +10,64 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ApiResponse(object): + +class ApiResponse(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'code': 'int', - 'type': 'str', - 'message': 'str', + + allowed_values = { } attribute_map = { 'code': 'code', # noqa: E501 'type': 'type', # noqa: E501 - 'message': 'message', # noqa: E501 + 'message': 'message' # noqa: E501 } - def __init__(self, code=None, type=None, message=None): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - + openapi_types = { + 'code': 'int', + 'type': 'str', + 'message': 'str' + } + validations = { + } - Keyword Args: - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ + def __init__(self, code=None, type=None, message=None): # noqa: E501 + """ApiResponse - a model defined in OpenAPI""" # noqa: E501 self._code = None self._type = None @@ -59,11 +75,17 @@ def __init__(self, code=None, type=None, message=None): # noqa: E501 self.discriminator = None if code is not None: - self.code = code # noqa: E501 + self.code = ( + code + ) if type is not None: - self.type = type # noqa: E501 + self.type = ( + type + ) if message is not None: - self.message = message # noqa: E501 + self.message = ( + message + ) @property def code(self): @@ -76,9 +98,7 @@ def code(self): return self._code @code.setter - def code( - self, - code): + def code(self, code): # noqa: E501 """Sets the code of this ApiResponse. @@ -87,7 +107,8 @@ def code( """ self._code = ( - code) + code + ) @property def type(self): @@ -100,9 +121,7 @@ def type(self): return self._type @type.setter - def type( - self, - type): + def type(self, type): # noqa: E501 """Sets the type of this ApiResponse. @@ -111,7 +130,8 @@ def type( """ self._type = ( - type) + type + ) @property def message(self): @@ -124,9 +144,7 @@ def message(self): return self._message @message.setter - def message( - self, - message): + def message(self, message): # noqa: E501 """Sets the message of this ApiResponse. @@ -135,7 +153,8 @@ def message( """ self._message = ( - message) + message + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py index d49c620abc1e..2beb87728306 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ArrayOfArrayOfNumberOnly(object): + +class ArrayOfArrayOfNumberOnly(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'array_array_number': 'list[list[float]]', + + allowed_values = { } attribute_map = { - 'array_array_number': 'ArrayArrayNumber', # noqa: E501 + 'array_array_number': 'ArrayArrayNumber' # noqa: E501 } - def __init__(self, array_array_number=None): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - + openapi_types = { + 'array_array_number': 'list[list[float]]' + } + validations = { + } - Keyword Args: - array_array_number (list[list[float]]): [optional] # noqa: E501 - """ + def __init__(self, array_array_number=None): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 self._array_array_number = None self.discriminator = None if array_array_number is not None: - self.array_array_number = array_array_number # noqa: E501 + self.array_array_number = ( + array_array_number + ) @property def array_array_number(self): @@ -64,9 +84,7 @@ def array_array_number(self): return self._array_array_number @array_array_number.setter - def array_array_number( - self, - array_array_number): + def array_array_number(self, array_array_number): # noqa: E501 """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. @@ -75,7 +93,8 @@ def array_array_number( """ self._array_array_number = ( - array_array_number) + array_array_number + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py index f87d00b168ab..7c67bcf59d77 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ArrayOfNumberOnly(object): + +class ArrayOfNumberOnly(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'array_number': 'list[float]', + + allowed_values = { } attribute_map = { - 'array_number': 'ArrayNumber', # noqa: E501 + 'array_number': 'ArrayNumber' # noqa: E501 } - def __init__(self, array_number=None): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - + openapi_types = { + 'array_number': 'list[float]' + } + validations = { + } - Keyword Args: - array_number (list[float]): [optional] # noqa: E501 - """ + def __init__(self, array_number=None): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 self._array_number = None self.discriminator = None if array_number is not None: - self.array_number = array_number # noqa: E501 + self.array_number = ( + array_number + ) @property def array_number(self): @@ -64,9 +84,7 @@ def array_number(self): return self._array_number @array_number.setter - def array_number( - self, - array_number): + def array_number(self, array_number): # noqa: E501 """Sets the array_number of this ArrayOfNumberOnly. @@ -75,7 +93,8 @@ def array_number( """ self._array_number = ( - array_number) + array_number + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index 5098375a2f06..adcb8690dea0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -10,48 +10,64 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ArrayTest(object): + +class ArrayTest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'array_of_string': 'list[str]', - 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]', + + allowed_values = { } attribute_map = { 'array_of_string': 'array_of_string', # noqa: E501 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 - 'array_array_of_model': 'array_array_of_model', # noqa: E501 + 'array_array_of_model': 'array_array_of_model' # noqa: E501 } - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - + openapi_types = { + 'array_of_string': 'list[str]', + 'array_array_of_integer': 'list[list[int]]', + 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + } + validations = { + } - Keyword Args: - array_of_string (list[str]): [optional] # noqa: E501 - array_array_of_integer (list[list[int]]): [optional] # noqa: E501 - array_array_of_model (list[list[ReadOnlyFirst]]): [optional] # noqa: E501 - """ + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 + """ArrayTest - a model defined in OpenAPI""" # noqa: E501 self._array_of_string = None self._array_array_of_integer = None @@ -59,11 +75,17 @@ def __init__(self, array_of_string=None, array_array_of_integer=None, array_arra self.discriminator = None if array_of_string is not None: - self.array_of_string = array_of_string # noqa: E501 + self.array_of_string = ( + array_of_string + ) if array_array_of_integer is not None: - self.array_array_of_integer = array_array_of_integer # noqa: E501 + self.array_array_of_integer = ( + array_array_of_integer + ) if array_array_of_model is not None: - self.array_array_of_model = array_array_of_model # noqa: E501 + self.array_array_of_model = ( + array_array_of_model + ) @property def array_of_string(self): @@ -76,9 +98,7 @@ def array_of_string(self): return self._array_of_string @array_of_string.setter - def array_of_string( - self, - array_of_string): + def array_of_string(self, array_of_string): # noqa: E501 """Sets the array_of_string of this ArrayTest. @@ -87,7 +107,8 @@ def array_of_string( """ self._array_of_string = ( - array_of_string) + array_of_string + ) @property def array_array_of_integer(self): @@ -100,9 +121,7 @@ def array_array_of_integer(self): return self._array_array_of_integer @array_array_of_integer.setter - def array_array_of_integer( - self, - array_array_of_integer): + def array_array_of_integer(self, array_array_of_integer): # noqa: E501 """Sets the array_array_of_integer of this ArrayTest. @@ -111,7 +130,8 @@ def array_array_of_integer( """ self._array_array_of_integer = ( - array_array_of_integer) + array_array_of_integer + ) @property def array_array_of_model(self): @@ -124,9 +144,7 @@ def array_array_of_model(self): return self._array_array_of_model @array_array_of_model.setter - def array_array_of_model( - self, - array_array_of_model): + def array_array_of_model(self, array_array_of_model): # noqa: E501 """Sets the array_array_of_model of this ArrayTest. @@ -135,7 +153,8 @@ def array_array_of_model( """ self._array_array_of_model = ( - array_array_of_model) + array_array_of_model + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py index e94eca3e4021..5eeafb5ac7bc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -10,33 +10,45 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Capitalization(object): + +class Capitalization(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'small_camel': 'str', - 'capital_camel': 'str', - 'small_snake': 'str', - 'capital_snake': 'str', - 'sca_eth_flow_points': 'str', - 'att_name': 'str', + + allowed_values = { } attribute_map = { @@ -45,22 +57,23 @@ class Capitalization(object): 'small_snake': 'small_Snake', # noqa: E501 'capital_snake': 'Capital_Snake', # noqa: E501 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 - 'att_name': 'ATT_NAME', # noqa: E501 + 'att_name': 'ATT_NAME' # noqa: E501 } - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 - """Capitalization - a model defined in OpenAPI - + openapi_types = { + 'small_camel': 'str', + 'capital_camel': 'str', + 'small_snake': 'str', + 'capital_snake': 'str', + 'sca_eth_flow_points': 'str', + 'att_name': 'str' + } + validations = { + } - Keyword Args: - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 + """Capitalization - a model defined in OpenAPI""" # noqa: E501 self._small_camel = None self._capital_camel = None @@ -71,17 +84,29 @@ def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capit self.discriminator = None if small_camel is not None: - self.small_camel = small_camel # noqa: E501 + self.small_camel = ( + small_camel + ) if capital_camel is not None: - self.capital_camel = capital_camel # noqa: E501 + self.capital_camel = ( + capital_camel + ) if small_snake is not None: - self.small_snake = small_snake # noqa: E501 + self.small_snake = ( + small_snake + ) if capital_snake is not None: - self.capital_snake = capital_snake # noqa: E501 + self.capital_snake = ( + capital_snake + ) if sca_eth_flow_points is not None: - self.sca_eth_flow_points = sca_eth_flow_points # noqa: E501 + self.sca_eth_flow_points = ( + sca_eth_flow_points + ) if att_name is not None: - self.att_name = att_name # noqa: E501 + self.att_name = ( + att_name + ) @property def small_camel(self): @@ -94,9 +119,7 @@ def small_camel(self): return self._small_camel @small_camel.setter - def small_camel( - self, - small_camel): + def small_camel(self, small_camel): # noqa: E501 """Sets the small_camel of this Capitalization. @@ -105,7 +128,8 @@ def small_camel( """ self._small_camel = ( - small_camel) + small_camel + ) @property def capital_camel(self): @@ -118,9 +142,7 @@ def capital_camel(self): return self._capital_camel @capital_camel.setter - def capital_camel( - self, - capital_camel): + def capital_camel(self, capital_camel): # noqa: E501 """Sets the capital_camel of this Capitalization. @@ -129,7 +151,8 @@ def capital_camel( """ self._capital_camel = ( - capital_camel) + capital_camel + ) @property def small_snake(self): @@ -142,9 +165,7 @@ def small_snake(self): return self._small_snake @small_snake.setter - def small_snake( - self, - small_snake): + def small_snake(self, small_snake): # noqa: E501 """Sets the small_snake of this Capitalization. @@ -153,7 +174,8 @@ def small_snake( """ self._small_snake = ( - small_snake) + small_snake + ) @property def capital_snake(self): @@ -166,9 +188,7 @@ def capital_snake(self): return self._capital_snake @capital_snake.setter - def capital_snake( - self, - capital_snake): + def capital_snake(self, capital_snake): # noqa: E501 """Sets the capital_snake of this Capitalization. @@ -177,7 +197,8 @@ def capital_snake( """ self._capital_snake = ( - capital_snake) + capital_snake + ) @property def sca_eth_flow_points(self): @@ -190,9 +211,7 @@ def sca_eth_flow_points(self): return self._sca_eth_flow_points @sca_eth_flow_points.setter - def sca_eth_flow_points( - self, - sca_eth_flow_points): + def sca_eth_flow_points(self, sca_eth_flow_points): # noqa: E501 """Sets the sca_eth_flow_points of this Capitalization. @@ -201,7 +220,8 @@ def sca_eth_flow_points( """ self._sca_eth_flow_points = ( - sca_eth_flow_points) + sca_eth_flow_points + ) @property def att_name(self): @@ -215,9 +235,7 @@ def att_name(self): return self._att_name @att_name.setter - def att_name( - self, - att_name): + def att_name(self, att_name): # noqa: E501 """Sets the att_name of this Capitalization. Name of the pet # noqa: E501 @@ -227,7 +245,8 @@ def att_name( """ self._att_name = ( - att_name) + att_name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 2a19eddd5ed1..b496a13fe98e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -10,54 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Cat(object): + +class Cat(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'class_name': 'str', - 'declawed': 'bool', - 'color': 'str', + + allowed_values = { } attribute_map = { - 'class_name': 'className', # noqa: E501 - 'declawed': 'declawed', # noqa: E501 - 'color': 'color', # noqa: E501 + 'declawed': 'declawed' # noqa: E501 } - def __init__(self, class_name, declawed=None, color=None): # noqa: E501 - """Cat - a model defined in OpenAPI + openapi_types = { + 'declawed': 'bool' + } - Args: - class_name (str): + validations = { + } - Keyword Args: # noqa: E501 - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 - """ + def __init__(self, declawed=None): # noqa: E501 + """Cat - a model defined in OpenAPI""" # noqa: E501 self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed # noqa: E501 + self.declawed = ( + declawed + ) @property def declawed(self): @@ -70,9 +84,7 @@ def declawed(self): return self._declawed @declawed.setter - def declawed( - self, - declawed): + def declawed(self, declawed): # noqa: E501 """Sets the declawed of this Cat. @@ -81,7 +93,8 @@ def declawed( """ self._declawed = ( - declawed) + declawed + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py index 88260a5e3d91..0a8267293dd3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class CatAllOf(object): + +class CatAllOf(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'declawed': 'bool', + + allowed_values = { } attribute_map = { - 'declawed': 'declawed', # noqa: E501 + 'declawed': 'declawed' # noqa: E501 } - def __init__(self, declawed=None): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - + openapi_types = { + 'declawed': 'bool' + } + validations = { + } - Keyword Args: - declawed (bool): [optional] # noqa: E501 - """ + def __init__(self, declawed=None): # noqa: E501 + """CatAllOf - a model defined in OpenAPI""" # noqa: E501 self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed # noqa: E501 + self.declawed = ( + declawed + ) @property def declawed(self): @@ -64,9 +84,7 @@ def declawed(self): return self._declawed @declawed.setter - def declawed( - self, - declawed): + def declawed(self, declawed): # noqa: E501 """Sets the declawed of this CatAllOf. @@ -75,7 +93,8 @@ def declawed( """ self._declawed = ( - declawed) + declawed + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/category.py b/samples/client/petstore/python-experimental/petstore_api/models/category.py index 347ed14927e4..bf117a1317df 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/category.py @@ -10,52 +10,71 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Category(object): + +class Category(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', - 'id': 'int', + + allowed_values = { } attribute_map = { - 'name': 'name', # noqa: E501 'id': 'id', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, name='default-name', id=None): # noqa: E501 - """Category - a model defined in OpenAPI + openapi_types = { + 'id': 'int', + 'name': 'str' + } - Args: + validations = { + } - Keyword Args: - name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 - id (int): [optional] # noqa: E501 - """ + def __init__(self, id=None, name='default-name'): # noqa: E501 + """Category - a model defined in OpenAPI""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id # noqa: E501 + self.id = ( + id + ) self.name = name @property @@ -69,9 +88,7 @@ def id(self): return self._id @id.setter - def id( - self, - id): + def id(self, id): # noqa: E501 """Sets the id of this Category. @@ -80,7 +97,8 @@ def id( """ self._id = ( - id) + id + ) @property def name(self): @@ -93,9 +111,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this Category. @@ -103,10 +119,11 @@ def name( :type: str """ if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/client/petstore/python-experimental/petstore_api/models/class_model.py index bac11b0e1383..907e0f6ce2db 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ClassModel(object): + +class ClassModel(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - '_class': 'str', + + allowed_values = { } attribute_map = { - '_class': '_class', # noqa: E501 + '_class': '_class' # noqa: E501 } - def __init__(self, _class=None): # noqa: E501 - """ClassModel - a model defined in OpenAPI - + openapi_types = { + '_class': 'str' + } + validations = { + } - Keyword Args: - _class (str): [optional] # noqa: E501 - """ + def __init__(self, _class=None): # noqa: E501 + """ClassModel - a model defined in OpenAPI""" # noqa: E501 self.__class = None self.discriminator = None if _class is not None: - self._class = _class # noqa: E501 + self._class = ( + _class + ) @property def _class(self): @@ -64,9 +84,7 @@ def _class(self): return self.__class @_class.setter - def _class( - self, - _class): + def _class(self, _class): # noqa: E501 """Sets the _class of this ClassModel. @@ -75,7 +93,8 @@ def _class( """ self.__class = ( - _class) + _class + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/client.py b/samples/client/petstore/python-experimental/petstore_api/models/client.py index 4cde17963c5f..7b133a387147 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/client.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Client(object): + +class Client(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'client': 'str', + + allowed_values = { } attribute_map = { - 'client': 'client', # noqa: E501 + 'client': 'client' # noqa: E501 } - def __init__(self, client=None): # noqa: E501 - """Client - a model defined in OpenAPI - + openapi_types = { + 'client': 'str' + } + validations = { + } - Keyword Args: - client (str): [optional] # noqa: E501 - """ + def __init__(self, client=None): # noqa: E501 + """Client - a model defined in OpenAPI""" # noqa: E501 self._client = None self.discriminator = None if client is not None: - self.client = client # noqa: E501 + self.client = ( + client + ) @property def client(self): @@ -64,9 +84,7 @@ def client(self): return self._client @client.setter - def client( - self, - client): + def client(self, client): # noqa: E501 """Sets the client of this Client. @@ -75,7 +93,8 @@ def client( """ self._client = ( - client) + client + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index 14c4eedcc59a..61ef9958fc40 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -10,54 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Dog(object): + +class Dog(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'class_name': 'str', - 'breed': 'str', - 'color': 'str', + + allowed_values = { } attribute_map = { - 'class_name': 'className', # noqa: E501 - 'breed': 'breed', # noqa: E501 - 'color': 'color', # noqa: E501 + 'breed': 'breed' # noqa: E501 } - def __init__(self, class_name, breed=None, color=None): # noqa: E501 - """Dog - a model defined in OpenAPI + openapi_types = { + 'breed': 'str' + } - Args: - class_name (str): + validations = { + } - Keyword Args: # noqa: E501 - breed (str): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 - """ + def __init__(self, breed=None): # noqa: E501 + """Dog - a model defined in OpenAPI""" # noqa: E501 self._breed = None self.discriminator = None if breed is not None: - self.breed = breed # noqa: E501 + self.breed = ( + breed + ) @property def breed(self): @@ -70,9 +84,7 @@ def breed(self): return self._breed @breed.setter - def breed( - self, - breed): + def breed(self, breed): # noqa: E501 """Sets the breed of this Dog. @@ -81,7 +93,8 @@ def breed( """ self._breed = ( - breed) + breed + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py index 7940637ce5ec..cc082b5b3576 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class DogAllOf(object): + +class DogAllOf(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'breed': 'str', + + allowed_values = { } attribute_map = { - 'breed': 'breed', # noqa: E501 + 'breed': 'breed' # noqa: E501 } - def __init__(self, breed=None): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - + openapi_types = { + 'breed': 'str' + } + validations = { + } - Keyword Args: - breed (str): [optional] # noqa: E501 - """ + def __init__(self, breed=None): # noqa: E501 + """DogAllOf - a model defined in OpenAPI""" # noqa: E501 self._breed = None self.discriminator = None if breed is not None: - self.breed = breed # noqa: E501 + self.breed = ( + breed + ) @property def breed(self): @@ -64,9 +84,7 @@ def breed(self): return self._breed @breed.setter - def breed( - self, - breed): + def breed(self, breed): # noqa: E501 """Sets the breed of this DogAllOf. @@ -75,7 +93,8 @@ def breed( """ self._breed = ( - breed) + breed + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py index ad0e8c3d9b6d..fe8355e7defa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -10,54 +10,83 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class EnumArrays(object): + +class EnumArrays(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'just_symbol': 'str', - 'array_enum': 'list[str]', + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$" + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab" + }, } attribute_map = { 'just_symbol': 'just_symbol', # noqa: E501 - 'array_enum': 'array_enum', # noqa: E501 + 'array_enum': 'array_enum' # noqa: E501 } - def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - + openapi_types = { + 'just_symbol': 'str', + 'array_enum': 'list[str]' + } + validations = { + } - Keyword Args: - just_symbol (str): [optional] # noqa: E501 - array_enum (list[str]): [optional] # noqa: E501 - """ + def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + """EnumArrays - a model defined in OpenAPI""" # noqa: E501 self._just_symbol = None self._array_enum = None self.discriminator = None if just_symbol is not None: - self.just_symbol = just_symbol # noqa: E501 + self.just_symbol = ( + just_symbol + ) if array_enum is not None: - self.array_enum = array_enum # noqa: E501 + self.array_enum = ( + array_enum + ) @property def just_symbol(self): @@ -70,24 +99,23 @@ def just_symbol(self): return self._just_symbol @just_symbol.setter - def just_symbol( - self, - just_symbol): + def just_symbol(self, just_symbol): # noqa: E501 """Sets the just_symbol of this EnumArrays. :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 :type: str """ - allowed_values = [">=", "$"] # noqa: E501 - if just_symbol not in allowed_values: - raise ValueError( - "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 - .format(just_symbol, allowed_values) - ) + check_allowed_values( + self.allowed_values, + ('just_symbol',), + just_symbol, + self.validations + ) self._just_symbol = ( - just_symbol) + just_symbol + ) @property def array_enum(self): @@ -100,25 +128,23 @@ def array_enum(self): return self._array_enum @array_enum.setter - def array_enum( - self, - array_enum): + def array_enum(self, array_enum): # noqa: E501 """Sets the array_enum of this EnumArrays. :param array_enum: The array_enum of this EnumArrays. # noqa: E501 :type: list[str] """ - allowed_values = ["fish", "crab"] # noqa: E501 - if not set(array_enum).issubset(set(allowed_values)): - raise ValueError( - "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) + check_allowed_values( + self.allowed_values, + ('array_enum',), + array_enum, + self.validations + ) self._array_enum = ( - array_enum) + array_enum + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py index a2f3a3e4a781..60d4f64e9c17 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -10,75 +10,97 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class EnumClass(object): + +class EnumClass(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - - """ - allowed enum values - """ - _ABC = "_abc" - _EFG = "-efg" - _XYZ_ = "(xyz)" - """ Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)" + }, + } + openapi_types = { + 'value': 'str' } - attribute_map = { + validations = { } - def __init__(self): # noqa: E501 - """EnumClass - a model defined in OpenAPI + def __init__(self, value='-efg'): # noqa: E501 + """EnumClass - a model defined in OpenAPI""" # noqa: E501 + + self._value = None + self.discriminator = None + + self.value = value + @property + def value(self): + """Gets the value of this EnumClass. # noqa: E501 - Keyword Args: + :return: The value of this EnumClass. # noqa: E501 + :rtype: str """ - self.discriminator = None + return self._value + + @value.setter + def value(self, value): # noqa: E501 + """Sets the value of this EnumClass. - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result + + :param value: The value of this EnumClass. # noqa: E501 + :type: str + """ + if value is None: + raise ApiValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + check_allowed_values( + self.allowed_values, + ('value',), + value, + self.validations + ) + + self._value = ( + value + ) def to_str(self): """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) + return str(self._value) def __repr__(self): """For `print` and `pprint`""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 4ea9e777f686..0ec5096c0abd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -10,54 +10,86 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class EnumTest(object): + +class EnumTest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'enum_string_required': 'str', - 'enum_string': 'str', - 'enum_integer': 'int', - 'enum_number': 'float', - 'outer_enum': 'OuterEnum', + + allowed_values = { + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "" + }, + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "" + }, + ('enum_integer',): { + '1': 1, + '-1': -1 + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2 + }, } attribute_map = { - 'enum_string_required': 'enum_string_required', # noqa: E501 'enum_string': 'enum_string', # noqa: E501 + 'enum_string_required': 'enum_string_required', # noqa: E501 'enum_integer': 'enum_integer', # noqa: E501 'enum_number': 'enum_number', # noqa: E501 - 'outer_enum': 'outerEnum', # noqa: E501 + 'outer_enum': 'outerEnum' # noqa: E501 } - def __init__(self, enum_string_required, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 - """EnumTest - a model defined in OpenAPI + openapi_types = { + 'enum_string': 'str', + 'enum_string_required': 'str', + 'enum_integer': 'int', + 'enum_number': 'float', + 'outer_enum': 'OuterEnum' + } - Args: - enum_string_required (str): + validations = { + } - Keyword Args: # noqa: E501 - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - outer_enum (OuterEnum): [optional] # noqa: E501 - """ + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + """EnumTest - a model defined in OpenAPI""" # noqa: E501 self._enum_string = None self._enum_string_required = None @@ -67,14 +99,22 @@ def __init__(self, enum_string_required, enum_string=None, enum_integer=None, en self.discriminator = None if enum_string is not None: - self.enum_string = enum_string # noqa: E501 + self.enum_string = ( + enum_string + ) self.enum_string_required = enum_string_required if enum_integer is not None: - self.enum_integer = enum_integer # noqa: E501 + self.enum_integer = ( + enum_integer + ) if enum_number is not None: - self.enum_number = enum_number # noqa: E501 + self.enum_number = ( + enum_number + ) if outer_enum is not None: - self.outer_enum = outer_enum # noqa: E501 + self.outer_enum = ( + outer_enum + ) @property def enum_string(self): @@ -87,24 +127,23 @@ def enum_string(self): return self._enum_string @enum_string.setter - def enum_string( - self, - enum_string): + def enum_string(self, enum_string): # noqa: E501 """Sets the enum_string of this EnumTest. :param enum_string: The enum_string of this EnumTest. # noqa: E501 :type: str """ - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string not in allowed_values: - raise ValueError( - "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string, allowed_values) - ) + check_allowed_values( + self.allowed_values, + ('enum_string',), + enum_string, + self.validations + ) self._enum_string = ( - enum_string) + enum_string + ) @property def enum_string_required(self): @@ -117,9 +156,7 @@ def enum_string_required(self): return self._enum_string_required @enum_string_required.setter - def enum_string_required( - self, - enum_string_required): + def enum_string_required(self, enum_string_required): # noqa: E501 """Sets the enum_string_required of this EnumTest. @@ -127,16 +164,17 @@ def enum_string_required( :type: str """ if enum_string_required is None: - raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 - allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string_required not in allowed_values: - raise ValueError( - "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 - .format(enum_string_required, allowed_values) - ) + raise ApiValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 + check_allowed_values( + self.allowed_values, + ('enum_string_required',), + enum_string_required, + self.validations + ) self._enum_string_required = ( - enum_string_required) + enum_string_required + ) @property def enum_integer(self): @@ -149,24 +187,23 @@ def enum_integer(self): return self._enum_integer @enum_integer.setter - def enum_integer( - self, - enum_integer): + def enum_integer(self, enum_integer): # noqa: E501 """Sets the enum_integer of this EnumTest. :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 :type: int """ - allowed_values = [1, -1] # noqa: E501 - if enum_integer not in allowed_values: - raise ValueError( - "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 - .format(enum_integer, allowed_values) - ) + check_allowed_values( + self.allowed_values, + ('enum_integer',), + enum_integer, + self.validations + ) self._enum_integer = ( - enum_integer) + enum_integer + ) @property def enum_number(self): @@ -179,24 +216,23 @@ def enum_number(self): return self._enum_number @enum_number.setter - def enum_number( - self, - enum_number): + def enum_number(self, enum_number): # noqa: E501 """Sets the enum_number of this EnumTest. :param enum_number: The enum_number of this EnumTest. # noqa: E501 :type: float """ - allowed_values = [1.1, -1.2] # noqa: E501 - if enum_number not in allowed_values: - raise ValueError( - "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 - .format(enum_number, allowed_values) - ) + check_allowed_values( + self.allowed_values, + ('enum_number',), + enum_number, + self.validations + ) self._enum_number = ( - enum_number) + enum_number + ) @property def outer_enum(self): @@ -209,9 +245,7 @@ def outer_enum(self): return self._outer_enum @outer_enum.setter - def outer_enum( - self, - outer_enum): + def outer_enum(self, outer_enum): # noqa: E501 """Sets the outer_enum of this EnumTest. @@ -220,7 +254,8 @@ def outer_enum( """ self._outer_enum = ( - outer_enum) + outer_enum + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file.py b/samples/client/petstore/python-experimental/petstore_api/models/file.py index 70e1611a2370..6411e70e07b9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class File(object): + +class File(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'source_uri': 'str', + + allowed_values = { } attribute_map = { - 'source_uri': 'sourceURI', # noqa: E501 + 'source_uri': 'sourceURI' # noqa: E501 } - def __init__(self, source_uri=None): # noqa: E501 - """File - a model defined in OpenAPI - + openapi_types = { + 'source_uri': 'str' + } + validations = { + } - Keyword Args: - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ + def __init__(self, source_uri=None): # noqa: E501 + """File - a model defined in OpenAPI""" # noqa: E501 self._source_uri = None self.discriminator = None if source_uri is not None: - self.source_uri = source_uri # noqa: E501 + self.source_uri = ( + source_uri + ) @property def source_uri(self): @@ -65,9 +85,7 @@ def source_uri(self): return self._source_uri @source_uri.setter - def source_uri( - self, - source_uri): + def source_uri(self, source_uri): # noqa: E501 """Sets the source_uri of this File. Test capitalization # noqa: E501 @@ -77,7 +95,8 @@ def source_uri( """ self._source_uri = ( - source_uri) + source_uri + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 86e926ca153b..e773e2cb194c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -10,54 +10,75 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class FileSchemaTestClass(object): + +class FileSchemaTestClass(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'file': 'File', - 'files': 'list[File]', + + allowed_values = { } attribute_map = { 'file': 'file', # noqa: E501 - 'files': 'files', # noqa: E501 + 'files': 'files' # noqa: E501 } - def __init__(self, file=None, files=None): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - + openapi_types = { + 'file': 'File', + 'files': 'list[File]' + } + validations = { + } - Keyword Args: - file (File): [optional] # noqa: E501 - files (list[File]): [optional] # noqa: E501 - """ + def __init__(self, file=None, files=None): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 self._file = None self._files = None self.discriminator = None if file is not None: - self.file = file # noqa: E501 + self.file = ( + file + ) if files is not None: - self.files = files # noqa: E501 + self.files = ( + files + ) @property def file(self): @@ -70,9 +91,7 @@ def file(self): return self._file @file.setter - def file( - self, - file): + def file(self, file): # noqa: E501 """Sets the file of this FileSchemaTestClass. @@ -81,7 +100,8 @@ def file( """ self._file = ( - file) + file + ) @property def files(self): @@ -94,9 +114,7 @@ def files(self): return self._files @files.setter - def files( - self, - files): + def files(self, files): # noqa: E501 """Sets the files of this FileSchemaTestClass. @@ -105,7 +123,8 @@ def files( """ self._files = ( - files) + files + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/client/petstore/python-experimental/petstore_api/models/format_test.py index a7936dc37ec6..8b1a5143e013 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -10,78 +10,126 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class FormatTest(object): + +class FormatTest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'number': 'float', - 'byte': 'str', - 'date': 'date', - 'password': 'str', - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'float': 'float', - 'double': 'float', - 'string': 'str', - 'binary': 'file', - 'date_time': 'datetime', - 'uuid': 'str', + + allowed_values = { } attribute_map = { - 'number': 'number', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'date': 'date', # noqa: E501 - 'password': 'password', # noqa: E501 'integer': 'integer', # noqa: E501 'int32': 'int32', # noqa: E501 'int64': 'int64', # noqa: E501 + 'number': 'number', # noqa: E501 'float': 'float', # noqa: E501 'double': 'double', # noqa: E501 'string': 'string', # noqa: E501 + 'byte': 'byte', # noqa: E501 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 'date_time': 'dateTime', # noqa: E501 'uuid': 'uuid', # noqa: E501 + 'password': 'password' # noqa: E501 } - def __init__(self, number, byte, date, password, integer=None, int32=None, int64=None, float=None, double=None, string=None, binary=None, date_time=None, uuid=None): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - """ + openapi_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + 'float': 'float', + 'double': 'float', + 'string': 'str', + 'byte': 'str', + 'binary': 'file', + 'date': 'date', + 'date_time': 'datetime', + 'uuid': 'str', + 'password': 'str' + } + + validations = { + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + + 'regex': { + 'pattern': r'^[a-z]+$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('byte',): { + + 'regex': { + 'pattern': r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', # noqa: E501 + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501 + """FormatTest - a model defined in OpenAPI""" # noqa: E501 self._integer = None self._int32 = None @@ -99,26 +147,44 @@ def __init__(self, number, byte, date, password, integer=None, int32=None, int64 self.discriminator = None if integer is not None: - self.integer = integer # noqa: E501 + self.integer = ( + integer + ) if int32 is not None: - self.int32 = int32 # noqa: E501 + self.int32 = ( + int32 + ) if int64 is not None: - self.int64 = int64 # noqa: E501 + self.int64 = ( + int64 + ) self.number = number if float is not None: - self.float = float # noqa: E501 + self.float = ( + float + ) if double is not None: - self.double = double # noqa: E501 + self.double = ( + double + ) if string is not None: - self.string = string # noqa: E501 + self.string = ( + string + ) self.byte = byte if binary is not None: - self.binary = binary # noqa: E501 + self.binary = ( + binary + ) self.date = date if date_time is not None: - self.date_time = date_time # noqa: E501 + self.date_time = ( + date_time + ) if uuid is not None: - self.uuid = uuid # noqa: E501 + self.uuid = ( + uuid + ) self.password = password @property @@ -132,22 +198,22 @@ def integer(self): return self._integer @integer.setter - def integer( - self, - integer): + def integer(self, integer): # noqa: E501 """Sets the integer of this FormatTest. :param integer: The integer of this FormatTest. # noqa: E501 :type: int """ - if integer is not None and integer > 100: # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if integer is not None and integer < 10: # noqa: E501 - raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 + check_validations( + self.validations, + ('integer',), + integer + ) self._integer = ( - integer) + integer + ) @property def int32(self): @@ -160,22 +226,22 @@ def int32(self): return self._int32 @int32.setter - def int32( - self, - int32): + def int32(self, int32): # noqa: E501 """Sets the int32 of this FormatTest. :param int32: The int32 of this FormatTest. # noqa: E501 :type: int """ - if int32 is not None and int32 > 200: # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if int32 is not None and int32 < 20: # noqa: E501 - raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 + check_validations( + self.validations, + ('int32',), + int32 + ) self._int32 = ( - int32) + int32 + ) @property def int64(self): @@ -188,9 +254,7 @@ def int64(self): return self._int64 @int64.setter - def int64( - self, - int64): + def int64(self, int64): # noqa: E501 """Sets the int64 of this FormatTest. @@ -199,7 +263,8 @@ def int64( """ self._int64 = ( - int64) + int64 + ) @property def number(self): @@ -212,9 +277,7 @@ def number(self): return self._number @number.setter - def number( - self, - number): + def number(self, number): # noqa: E501 """Sets the number of this FormatTest. @@ -222,14 +285,16 @@ def number( :type: float """ if number is None: - raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if number is not None and number > 543.2: # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if number is not None and number < 32.1: # noqa: E501 - raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 + raise ApiValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + check_validations( + self.validations, + ('number',), + number + ) self._number = ( - number) + number + ) @property def float(self): @@ -242,22 +307,22 @@ def float(self): return self._float @float.setter - def float( - self, - float): + def float(self, float): # noqa: E501 """Sets the float of this FormatTest. :param float: The float of this FormatTest. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if float is not None and float < 54.3: # noqa: E501 - raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 + check_validations( + self.validations, + ('float',), + float + ) self._float = ( - float) + float + ) @property def double(self): @@ -270,22 +335,22 @@ def double(self): return self._double @double.setter - def double( - self, - double): + def double(self, double): # noqa: E501 """Sets the double of this FormatTest. :param double: The double of this FormatTest. # noqa: E501 :type: float """ - if double is not None and double > 123.4: # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if double is not None and double < 67.8: # noqa: E501 - raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 + check_validations( + self.validations, + ('double',), + double + ) self._double = ( - double) + double + ) @property def string(self): @@ -298,20 +363,22 @@ def string(self): return self._string @string.setter - def string( - self, - string): + def string(self, string): # noqa: E501 """Sets the string of this FormatTest. :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 - raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 + check_validations( + self.validations, + ('string',), + string + ) self._string = ( - string) + string + ) @property def byte(self): @@ -324,9 +391,7 @@ def byte(self): return self._byte @byte.setter - def byte( - self, - byte): + def byte(self, byte): # noqa: E501 """Sets the byte of this FormatTest. @@ -334,12 +399,16 @@ def byte( :type: str """ if byte is None: - raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 - raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + raise ApiValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 + check_validations( + self.validations, + ('byte',), + byte + ) self._byte = ( - byte) + byte + ) @property def binary(self): @@ -352,9 +421,7 @@ def binary(self): return self._binary @binary.setter - def binary( - self, - binary): + def binary(self, binary): # noqa: E501 """Sets the binary of this FormatTest. @@ -363,7 +430,8 @@ def binary( """ self._binary = ( - binary) + binary + ) @property def date(self): @@ -376,9 +444,7 @@ def date(self): return self._date @date.setter - def date( - self, - date): + def date(self, date): # noqa: E501 """Sets the date of this FormatTest. @@ -386,10 +452,11 @@ def date( :type: date """ if date is None: - raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `date`, must not be `None`") # noqa: E501 self._date = ( - date) + date + ) @property def date_time(self): @@ -402,9 +469,7 @@ def date_time(self): return self._date_time @date_time.setter - def date_time( - self, - date_time): + def date_time(self, date_time): # noqa: E501 """Sets the date_time of this FormatTest. @@ -413,7 +478,8 @@ def date_time( """ self._date_time = ( - date_time) + date_time + ) @property def uuid(self): @@ -426,9 +492,7 @@ def uuid(self): return self._uuid @uuid.setter - def uuid( - self, - uuid): + def uuid(self, uuid): # noqa: E501 """Sets the uuid of this FormatTest. @@ -437,7 +501,8 @@ def uuid( """ self._uuid = ( - uuid) + uuid + ) @property def password(self): @@ -450,9 +515,7 @@ def password(self): return self._password @password.setter - def password( - self, - password): + def password(self, password): # noqa: E501 """Sets the password of this FormatTest. @@ -460,14 +523,16 @@ def password( :type: str """ if password is None: - raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if password is not None and len(password) > 64: - raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if password is not None and len(password) < 10: - raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 + raise ApiValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + check_validations( + self.validations, + ('password',), + password + ) self._password = ( - password) + password + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py index 8744de383447..2ef64381ea32 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -10,54 +10,75 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class HasOnlyReadOnly(object): + +class HasOnlyReadOnly(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'bar': 'str', - 'foo': 'str', + + allowed_values = { } attribute_map = { 'bar': 'bar', # noqa: E501 - 'foo': 'foo', # noqa: E501 + 'foo': 'foo' # noqa: E501 } - def __init__(self, bar=None, foo=None): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - + openapi_types = { + 'bar': 'str', + 'foo': 'str' + } + validations = { + } - Keyword Args: - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ + def __init__(self, bar=None, foo=None): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 self._bar = None self._foo = None self.discriminator = None if bar is not None: - self.bar = bar # noqa: E501 + self.bar = ( + bar + ) if foo is not None: - self.foo = foo # noqa: E501 + self.foo = ( + foo + ) @property def bar(self): @@ -70,9 +91,7 @@ def bar(self): return self._bar @bar.setter - def bar( - self, - bar): + def bar(self, bar): # noqa: E501 """Sets the bar of this HasOnlyReadOnly. @@ -81,7 +100,8 @@ def bar( """ self._bar = ( - bar) + bar + ) @property def foo(self): @@ -94,9 +114,7 @@ def foo(self): return self._foo @foo.setter - def foo( - self, - foo): + def foo(self, foo): # noqa: E501 """Sets the foo of this HasOnlyReadOnly. @@ -105,7 +123,8 @@ def foo( """ self._foo = ( - foo) + foo + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/list.py b/samples/client/petstore/python-experimental/petstore_api/models/list.py index 14b9a6561759..388989603a92 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/list.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class List(object): + +class List(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - '_123_list': 'str', + + allowed_values = { } attribute_map = { - '_123_list': '123-list', # noqa: E501 + '_123_list': '123-list' # noqa: E501 } - def __init__(self, _123_list=None): # noqa: E501 - """List - a model defined in OpenAPI - + openapi_types = { + '_123_list': 'str' + } + validations = { + } - Keyword Args: - _123_list (str): [optional] # noqa: E501 - """ + def __init__(self, _123_list=None): # noqa: E501 + """List - a model defined in OpenAPI""" # noqa: E501 self.__123_list = None self.discriminator = None if _123_list is not None: - self._123_list = _123_list # noqa: E501 + self._123_list = ( + _123_list + ) @property def _123_list(self): @@ -64,9 +84,7 @@ def _123_list(self): return self.__123_list @_123_list.setter - def _123_list( - self, - _123_list): + def _123_list(self, _123_list): # noqa: E501 """Sets the _123_list of this List. @@ -75,7 +93,8 @@ def _123_list( """ self.__123_list = ( - _123_list) + _123_list + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index d6d975f16e6b..171791435046 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -10,51 +10,70 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class MapTest(object): + +class MapTest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'map_map_of_string': 'dict(str, dict(str, str))', - 'map_of_enum_string': 'dict(str, str)', - 'direct_map': 'dict(str, bool)', - 'indirect_map': 'dict(str, bool)', + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower" + }, } attribute_map = { 'map_map_of_string': 'map_map_of_string', # noqa: E501 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 'direct_map': 'direct_map', # noqa: E501 - 'indirect_map': 'indirect_map', # noqa: E501 + 'indirect_map': 'indirect_map' # noqa: E501 } - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501 - """MapTest - a model defined in OpenAPI - + openapi_types = { + 'map_map_of_string': 'dict(str, dict(str, str))', + 'map_of_enum_string': 'dict(str, str)', + 'direct_map': 'dict(str, bool)', + 'indirect_map': 'StringBooleanMap' + } + validations = { + } - Keyword Args: - map_map_of_string (dict(str, dict(str, str))): [optional] # noqa: E501 - map_of_enum_string (dict(str, str)): [optional] # noqa: E501 - direct_map (dict(str, bool)): [optional] # noqa: E501 - indirect_map (dict(str, bool)): [optional] # noqa: E501 - """ + def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501 + """MapTest - a model defined in OpenAPI""" # noqa: E501 self._map_map_of_string = None self._map_of_enum_string = None @@ -63,13 +82,21 @@ def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=N self.discriminator = None if map_map_of_string is not None: - self.map_map_of_string = map_map_of_string # noqa: E501 + self.map_map_of_string = ( + map_map_of_string + ) if map_of_enum_string is not None: - self.map_of_enum_string = map_of_enum_string # noqa: E501 + self.map_of_enum_string = ( + map_of_enum_string + ) if direct_map is not None: - self.direct_map = direct_map # noqa: E501 + self.direct_map = ( + direct_map + ) if indirect_map is not None: - self.indirect_map = indirect_map # noqa: E501 + self.indirect_map = ( + indirect_map + ) @property def map_map_of_string(self): @@ -82,9 +109,7 @@ def map_map_of_string(self): return self._map_map_of_string @map_map_of_string.setter - def map_map_of_string( - self, - map_map_of_string): + def map_map_of_string(self, map_map_of_string): # noqa: E501 """Sets the map_map_of_string of this MapTest. @@ -93,7 +118,8 @@ def map_map_of_string( """ self._map_map_of_string = ( - map_map_of_string) + map_map_of_string + ) @property def map_of_enum_string(self): @@ -106,25 +132,23 @@ def map_of_enum_string(self): return self._map_of_enum_string @map_of_enum_string.setter - def map_of_enum_string( - self, - map_of_enum_string): + def map_of_enum_string(self, map_of_enum_string): # noqa: E501 """Sets the map_of_enum_string of this MapTest. :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 :type: dict(str, str) """ - allowed_values = ["UPPER", "lower"] # noqa: E501 - if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): - raise ValueError( - "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) + check_allowed_values( + self.allowed_values, + ('map_of_enum_string',), + map_of_enum_string, + self.validations + ) self._map_of_enum_string = ( - map_of_enum_string) + map_of_enum_string + ) @property def direct_map(self): @@ -137,9 +161,7 @@ def direct_map(self): return self._direct_map @direct_map.setter - def direct_map( - self, - direct_map): + def direct_map(self, direct_map): # noqa: E501 """Sets the direct_map of this MapTest. @@ -148,7 +170,8 @@ def direct_map( """ self._direct_map = ( - direct_map) + direct_map + ) @property def indirect_map(self): @@ -156,23 +179,22 @@ def indirect_map(self): :return: The indirect_map of this MapTest. # noqa: E501 - :rtype: dict(str, bool) + :rtype: StringBooleanMap """ return self._indirect_map @indirect_map.setter - def indirect_map( - self, - indirect_map): + def indirect_map(self, indirect_map): # noqa: E501 """Sets the indirect_map of this MapTest. :param indirect_map: The indirect_map of this MapTest. # noqa: E501 - :type: dict(str, bool) + :type: StringBooleanMap """ self._indirect_map = ( - indirect_map) + indirect_map + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index ac8d5626fbf7..670e5d9905ed 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -10,48 +10,64 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class MixedPropertiesAndAdditionalPropertiesClass(object): + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'uuid': 'str', - 'date_time': 'datetime', - 'map': 'dict(str, Animal)', + + allowed_values = { } attribute_map = { 'uuid': 'uuid', # noqa: E501 'date_time': 'dateTime', # noqa: E501 - 'map': 'map', # noqa: E501 + 'map': 'map' # noqa: E501 } - def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - + openapi_types = { + 'uuid': 'str', + 'date_time': 'datetime', + 'map': 'dict(str, Animal)' + } + validations = { + } - Keyword Args: - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map (dict(str, Animal)): [optional] # noqa: E501 - """ + def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 self._uuid = None self._date_time = None @@ -59,11 +75,17 @@ def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 self.discriminator = None if uuid is not None: - self.uuid = uuid # noqa: E501 + self.uuid = ( + uuid + ) if date_time is not None: - self.date_time = date_time # noqa: E501 + self.date_time = ( + date_time + ) if map is not None: - self.map = map # noqa: E501 + self.map = ( + map + ) @property def uuid(self): @@ -76,9 +98,7 @@ def uuid(self): return self._uuid @uuid.setter - def uuid( - self, - uuid): + def uuid(self, uuid): # noqa: E501 """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. @@ -87,7 +107,8 @@ def uuid( """ self._uuid = ( - uuid) + uuid + ) @property def date_time(self): @@ -100,9 +121,7 @@ def date_time(self): return self._date_time @date_time.setter - def date_time( - self, - date_time): + def date_time(self, date_time): # noqa: E501 """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. @@ -111,7 +130,8 @@ def date_time( """ self._date_time = ( - date_time) + date_time + ) @property def map(self): @@ -124,9 +144,7 @@ def map(self): return self._map @map.setter - def map( - self, - map): + def map(self, map): # noqa: E501 """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. @@ -135,7 +153,8 @@ def map( """ self._map = ( - map) + map + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py index cec843833ad1..f110d0208258 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -10,54 +10,75 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Model200Response(object): + +class Model200Response(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'int', - '_class': 'str', + + allowed_values = { } attribute_map = { 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 + '_class': 'class' # noqa: E501 } - def __init__(self, name=None, _class=None): # noqa: E501 - """Model200Response - a model defined in OpenAPI - + openapi_types = { + 'name': 'int', + '_class': 'str' + } + validations = { + } - Keyword Args: - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ + def __init__(self, name=None, _class=None): # noqa: E501 + """Model200Response - a model defined in OpenAPI""" # noqa: E501 self._name = None self.__class = None self.discriminator = None if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) if _class is not None: - self._class = _class # noqa: E501 + self._class = ( + _class + ) @property def name(self): @@ -70,9 +91,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this Model200Response. @@ -81,7 +100,8 @@ def name( """ self._name = ( - name) + name + ) @property def _class(self): @@ -94,9 +114,7 @@ def _class(self): return self.__class @_class.setter - def _class( - self, - _class): + def _class(self, _class): # noqa: E501 """Sets the _class of this Model200Response. @@ -105,7 +123,8 @@ def _class( """ self.__class = ( - _class) + _class + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/client/petstore/python-experimental/petstore_api/models/model_return.py index 3c8096b7c458..0ba8ad99b99b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ModelReturn(object): + +class ModelReturn(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - '_return': 'int', + + allowed_values = { } attribute_map = { - '_return': 'return', # noqa: E501 + '_return': 'return' # noqa: E501 } - def __init__(self, _return=None): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - + openapi_types = { + '_return': 'int' + } + validations = { + } - Keyword Args: - _return (int): [optional] # noqa: E501 - """ + def __init__(self, _return=None): # noqa: E501 + """ModelReturn - a model defined in OpenAPI""" # noqa: E501 self.__return = None self.discriminator = None if _return is not None: - self._return = _return # noqa: E501 + self._return = ( + _return + ) @property def _return(self): @@ -64,9 +84,7 @@ def _return(self): return self.__return @_return.setter - def _return( - self, - _return): + def _return(self, _return): # noqa: E501 """Sets the _return of this ModelReturn. @@ -75,7 +93,8 @@ def _return( """ self.__return = ( - _return) + _return + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/name.py b/samples/client/petstore/python-experimental/petstore_api/models/name.py index 9d1814c670f6..59c5429366d3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/name.py @@ -10,51 +10,66 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Name(object): + +class Name(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'int', - 'snake_case': 'int', - '_property': 'str', - '_123_number': 'int', + + allowed_values = { } attribute_map = { 'name': 'name', # noqa: E501 'snake_case': 'snake_case', # noqa: E501 '_property': 'property', # noqa: E501 - '_123_number': '123Number', # noqa: E501 + '_123_number': '123Number' # noqa: E501 } - def __init__(self, name, snake_case=None, _property=None, _123_number=None): # noqa: E501 - """Name - a model defined in OpenAPI + openapi_types = { + 'name': 'int', + 'snake_case': 'int', + '_property': 'str', + '_123_number': 'int' + } - Args: - name (int): + validations = { + } - Keyword Args: # noqa: E501 - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in OpenAPI""" # noqa: E501 self._name = None self._snake_case = None @@ -64,11 +79,17 @@ def __init__(self, name, snake_case=None, _property=None, _123_number=None): # self.name = name if snake_case is not None: - self.snake_case = snake_case # noqa: E501 + self.snake_case = ( + snake_case + ) if _property is not None: - self._property = _property # noqa: E501 + self._property = ( + _property + ) if _123_number is not None: - self._123_number = _123_number # noqa: E501 + self._123_number = ( + _123_number + ) @property def name(self): @@ -81,9 +102,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this Name. @@ -91,10 +110,11 @@ def name( :type: int """ if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = ( - name) + name + ) @property def snake_case(self): @@ -107,9 +127,7 @@ def snake_case(self): return self._snake_case @snake_case.setter - def snake_case( - self, - snake_case): + def snake_case(self, snake_case): # noqa: E501 """Sets the snake_case of this Name. @@ -118,7 +136,8 @@ def snake_case( """ self._snake_case = ( - snake_case) + snake_case + ) @property def _property(self): @@ -131,9 +150,7 @@ def _property(self): return self.__property @_property.setter - def _property( - self, - _property): + def _property(self, _property): # noqa: E501 """Sets the _property of this Name. @@ -142,7 +159,8 @@ def _property( """ self.__property = ( - _property) + _property + ) @property def _123_number(self): @@ -155,9 +173,7 @@ def _123_number(self): return self.__123_number @_123_number.setter - def _123_number( - self, - _123_number): + def _123_number(self, _123_number): # noqa: E501 """Sets the _123_number of this Name. @@ -166,7 +182,8 @@ def _123_number( """ self.__123_number = ( - _123_number) + _123_number + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/number_only.py index 70741767c495..cb7825618738 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class NumberOnly(object): + +class NumberOnly(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'just_number': 'float', + + allowed_values = { } attribute_map = { - 'just_number': 'JustNumber', # noqa: E501 + 'just_number': 'JustNumber' # noqa: E501 } - def __init__(self, just_number=None): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - + openapi_types = { + 'just_number': 'float' + } + validations = { + } - Keyword Args: - just_number (float): [optional] # noqa: E501 - """ + def __init__(self, just_number=None): # noqa: E501 + """NumberOnly - a model defined in OpenAPI""" # noqa: E501 self._just_number = None self.discriminator = None if just_number is not None: - self.just_number = just_number # noqa: E501 + self.just_number = ( + just_number + ) @property def just_number(self): @@ -64,9 +84,7 @@ def just_number(self): return self._just_number @just_number.setter - def just_number( - self, - just_number): + def just_number(self, just_number): # noqa: E501 """Sets the just_number of this NumberOnly. @@ -75,7 +93,8 @@ def just_number( """ self._just_number = ( - just_number) + just_number + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/order.py b/samples/client/petstore/python-experimental/petstore_api/models/order.py index f1c8220033c2..7b866df4c894 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/order.py @@ -10,33 +10,50 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Order(object): + +class Order(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'id': 'int', - 'pet_id': 'int', - 'quantity': 'int', - 'ship_date': 'datetime', - 'status': 'str', - 'complete': 'bool', + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered" + }, } attribute_map = { @@ -45,22 +62,23 @@ class Order(object): 'quantity': 'quantity', # noqa: E501 'ship_date': 'shipDate', # noqa: E501 'status': 'status', # noqa: E501 - 'complete': 'complete', # noqa: E501 + 'complete': 'complete' # noqa: E501 } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=None): # noqa: E501 - """Order - a model defined in OpenAPI - + openapi_types = { + 'id': 'int', + 'pet_id': 'int', + 'quantity': 'int', + 'ship_date': 'datetime', + 'status': 'str', + 'complete': 'bool' + } + validations = { + } - Keyword Args: - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 + """Order - a model defined in OpenAPI""" # noqa: E501 self._id = None self._pet_id = None @@ -71,17 +89,29 @@ def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=N self.discriminator = None if id is not None: - self.id = id # noqa: E501 + self.id = ( + id + ) if pet_id is not None: - self.pet_id = pet_id # noqa: E501 + self.pet_id = ( + pet_id + ) if quantity is not None: - self.quantity = quantity # noqa: E501 + self.quantity = ( + quantity + ) if ship_date is not None: - self.ship_date = ship_date # noqa: E501 + self.ship_date = ( + ship_date + ) if status is not None: - self.status = status # noqa: E501 + self.status = ( + status + ) if complete is not None: - self.complete = complete # noqa: E501 + self.complete = ( + complete + ) @property def id(self): @@ -94,9 +124,7 @@ def id(self): return self._id @id.setter - def id( - self, - id): + def id(self, id): # noqa: E501 """Sets the id of this Order. @@ -105,7 +133,8 @@ def id( """ self._id = ( - id) + id + ) @property def pet_id(self): @@ -118,9 +147,7 @@ def pet_id(self): return self._pet_id @pet_id.setter - def pet_id( - self, - pet_id): + def pet_id(self, pet_id): # noqa: E501 """Sets the pet_id of this Order. @@ -129,7 +156,8 @@ def pet_id( """ self._pet_id = ( - pet_id) + pet_id + ) @property def quantity(self): @@ -142,9 +170,7 @@ def quantity(self): return self._quantity @quantity.setter - def quantity( - self, - quantity): + def quantity(self, quantity): # noqa: E501 """Sets the quantity of this Order. @@ -153,7 +179,8 @@ def quantity( """ self._quantity = ( - quantity) + quantity + ) @property def ship_date(self): @@ -166,9 +193,7 @@ def ship_date(self): return self._ship_date @ship_date.setter - def ship_date( - self, - ship_date): + def ship_date(self, ship_date): # noqa: E501 """Sets the ship_date of this Order. @@ -177,7 +202,8 @@ def ship_date( """ self._ship_date = ( - ship_date) + ship_date + ) @property def status(self): @@ -191,9 +217,7 @@ def status(self): return self._status @status.setter - def status( - self, - status): + def status(self, status): # noqa: E501 """Sets the status of this Order. Order Status # noqa: E501 @@ -201,15 +225,16 @@ def status( :param status: The status of this Order. # noqa: E501 :type: str """ - allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) + check_allowed_values( + self.allowed_values, + ('status',), + status, + self.validations + ) self._status = ( - status) + status + ) @property def complete(self): @@ -222,9 +247,7 @@ def complete(self): return self._complete @complete.setter - def complete( - self, - complete): + def complete(self, complete): # noqa: E501 """Sets the complete of this Order. @@ -233,7 +256,8 @@ def complete( """ self._complete = ( - complete) + complete + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index f3887c8a3267..70c9e7915fb0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -10,48 +10,64 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class OuterComposite(object): + +class OuterComposite(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'my_number': 'float', - 'my_string': 'str', - 'my_boolean': 'bool', + + allowed_values = { } attribute_map = { 'my_number': 'my_number', # noqa: E501 'my_string': 'my_string', # noqa: E501 - 'my_boolean': 'my_boolean', # noqa: E501 + 'my_boolean': 'my_boolean' # noqa: E501 } - def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 - """OuterComposite - a model defined in OpenAPI - + openapi_types = { + 'my_number': 'OuterNumber', + 'my_string': 'str', + 'my_boolean': 'bool' + } + validations = { + } - Keyword Args: - my_number (float): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ + def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + """OuterComposite - a model defined in OpenAPI""" # noqa: E501 self._my_number = None self._my_string = None @@ -59,11 +75,17 @@ def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E5 self.discriminator = None if my_number is not None: - self.my_number = my_number # noqa: E501 + self.my_number = ( + my_number + ) if my_string is not None: - self.my_string = my_string # noqa: E501 + self.my_string = ( + my_string + ) if my_boolean is not None: - self.my_boolean = my_boolean # noqa: E501 + self.my_boolean = ( + my_boolean + ) @property def my_number(self): @@ -71,23 +93,22 @@ def my_number(self): :return: The my_number of this OuterComposite. # noqa: E501 - :rtype: float + :rtype: OuterNumber """ return self._my_number @my_number.setter - def my_number( - self, - my_number): + def my_number(self, my_number): # noqa: E501 """Sets the my_number of this OuterComposite. :param my_number: The my_number of this OuterComposite. # noqa: E501 - :type: float + :type: OuterNumber """ self._my_number = ( - my_number) + my_number + ) @property def my_string(self): @@ -100,9 +121,7 @@ def my_string(self): return self._my_string @my_string.setter - def my_string( - self, - my_string): + def my_string(self, my_string): # noqa: E501 """Sets the my_string of this OuterComposite. @@ -111,7 +130,8 @@ def my_string( """ self._my_string = ( - my_string) + my_string + ) @property def my_boolean(self): @@ -124,9 +144,7 @@ def my_boolean(self): return self._my_boolean @my_boolean.setter - def my_boolean( - self, - my_boolean): + def my_boolean(self, my_boolean): # noqa: E501 """Sets the my_boolean of this OuterComposite. @@ -135,7 +153,8 @@ def my_boolean( """ self._my_boolean = ( - my_boolean) + my_boolean + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py index d042dbe3ceba..d9cdd3d0c602 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -10,75 +10,97 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class OuterEnum(object): + +class OuterEnum(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - - """ - allowed enum values - """ - PLACED = "placed" - APPROVED = "approved" - DELIVERED = "delivered" - """ Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered" + }, + } + openapi_types = { + 'value': 'str' } - attribute_map = { + validations = { } - def __init__(self): # noqa: E501 - """OuterEnum - a model defined in OpenAPI + def __init__(self, value=None): # noqa: E501 + """OuterEnum - a model defined in OpenAPI""" # noqa: E501 + + self._value = None + self.discriminator = None + + self.value = value + @property + def value(self): + """Gets the value of this OuterEnum. # noqa: E501 - Keyword Args: + :return: The value of this OuterEnum. # noqa: E501 + :rtype: str """ - self.discriminator = None + return self._value + + @value.setter + def value(self, value): # noqa: E501 + """Sets the value of this OuterEnum. - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result + + :param value: The value of this OuterEnum. # noqa: E501 + :type: str + """ + if value is None: + raise ApiValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + check_allowed_values( + self.allowed_values, + ('value',), + value, + self.validations + ) + + self._value = ( + value + ) def to_str(self): """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) + return str(self._value) def __repr__(self): """For `print` and `pprint`""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py new file mode 100644 index 000000000000..36c2bd3da192 --- /dev/null +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) + + +class OuterNumber(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + """ + + allowed_values = { + } + + openapi_types = { + 'value': 'float' + } + + validations = { + ('value',): { + + 'inclusive_maximum': 2E+1, + 'inclusive_minimum': 1E+1, + }, + } + + def __init__(self, value=None): # noqa: E501 + """OuterNumber - a model defined in OpenAPI""" # noqa: E501 + + self._value = None + self.discriminator = None + + self.value = value + + @property + def value(self): + """Gets the value of this OuterNumber. # noqa: E501 + + + :return: The value of this OuterNumber. # noqa: E501 + :rtype: float + """ + return self._value + + @value.setter + def value(self, value): # noqa: E501 + """Sets the value of this OuterNumber. + + + :param value: The value of this OuterNumber. # noqa: E501 + :type: float + """ + if value is None: + raise ApiValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + check_validations( + self.validations, + ('value',), + value + ) + + self._value = ( + value + ) + + def to_str(self): + """Returns the string representation of the model""" + return str(self._value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index a3b12d20c6ca..07db65229314 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -10,57 +10,75 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Pet(object): + +class Pet(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'name': 'str', - 'photo_urls': 'list[str]', - 'id': 'int', - 'category': 'Category', - 'tags': 'list[Tag]', - 'status': 'str', + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold" + }, } attribute_map = { - 'name': 'name', # noqa: E501 - 'photo_urls': 'photoUrls', # noqa: E501 'id': 'id', # noqa: E501 'category': 'category', # noqa: E501 + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 'tags': 'tags', # noqa: E501 - 'status': 'status', # noqa: E501 + 'status': 'status' # noqa: E501 } - def __init__(self, name, photo_urls, id=None, category=None, tags=None, status=None): # noqa: E501 - """Pet - a model defined in OpenAPI + openapi_types = { + 'id': 'int', + 'category': 'Category', + 'name': 'str', + 'photo_urls': 'list[str]', + 'tags': 'list[Tag]', + 'status': 'str' + } - Args: - name (str): - photo_urls (list[str]): + validations = { + } - Keyword Args: # noqa: E501 # noqa: E501 - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags (list[Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 + """Pet - a model defined in OpenAPI""" # noqa: E501 self._id = None self._category = None @@ -71,15 +89,23 @@ def __init__(self, name, photo_urls, id=None, category=None, tags=None, status=N self.discriminator = None if id is not None: - self.id = id # noqa: E501 + self.id = ( + id + ) if category is not None: - self.category = category # noqa: E501 + self.category = ( + category + ) self.name = name self.photo_urls = photo_urls if tags is not None: - self.tags = tags # noqa: E501 + self.tags = ( + tags + ) if status is not None: - self.status = status # noqa: E501 + self.status = ( + status + ) @property def id(self): @@ -92,9 +118,7 @@ def id(self): return self._id @id.setter - def id( - self, - id): + def id(self, id): # noqa: E501 """Sets the id of this Pet. @@ -103,7 +127,8 @@ def id( """ self._id = ( - id) + id + ) @property def category(self): @@ -116,9 +141,7 @@ def category(self): return self._category @category.setter - def category( - self, - category): + def category(self, category): # noqa: E501 """Sets the category of this Pet. @@ -127,7 +150,8 @@ def category( """ self._category = ( - category) + category + ) @property def name(self): @@ -140,9 +164,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this Pet. @@ -150,10 +172,11 @@ def name( :type: str """ if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = ( - name) + name + ) @property def photo_urls(self): @@ -166,9 +189,7 @@ def photo_urls(self): return self._photo_urls @photo_urls.setter - def photo_urls( - self, - photo_urls): + def photo_urls(self, photo_urls): # noqa: E501 """Sets the photo_urls of this Pet. @@ -176,10 +197,11 @@ def photo_urls( :type: list[str] """ if photo_urls is None: - raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 self._photo_urls = ( - photo_urls) + photo_urls + ) @property def tags(self): @@ -192,9 +214,7 @@ def tags(self): return self._tags @tags.setter - def tags( - self, - tags): + def tags(self, tags): # noqa: E501 """Sets the tags of this Pet. @@ -203,7 +223,8 @@ def tags( """ self._tags = ( - tags) + tags + ) @property def status(self): @@ -217,9 +238,7 @@ def status(self): return self._status @status.setter - def status( - self, - status): + def status(self, status): # noqa: E501 """Sets the status of this Pet. pet status in the store # noqa: E501 @@ -227,15 +246,16 @@ def status( :param status: The status of this Pet. # noqa: E501 :type: str """ - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) + check_allowed_values( + self.allowed_values, + ('status',), + status, + self.validations + ) self._status = ( - status) + status + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py index 93f2be298612..96d93afbd2b6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -10,54 +10,75 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class ReadOnlyFirst(object): + +class ReadOnlyFirst(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'bar': 'str', - 'baz': 'str', + + allowed_values = { } attribute_map = { 'bar': 'bar', # noqa: E501 - 'baz': 'baz', # noqa: E501 + 'baz': 'baz' # noqa: E501 } - def __init__(self, bar=None, baz=None): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - + openapi_types = { + 'bar': 'str', + 'baz': 'str' + } + validations = { + } - Keyword Args: - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ + def __init__(self, bar=None, baz=None): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 self._bar = None self._baz = None self.discriminator = None if bar is not None: - self.bar = bar # noqa: E501 + self.bar = ( + bar + ) if baz is not None: - self.baz = baz # noqa: E501 + self.baz = ( + baz + ) @property def bar(self): @@ -70,9 +91,7 @@ def bar(self): return self._bar @bar.setter - def bar( - self, - bar): + def bar(self, bar): # noqa: E501 """Sets the bar of this ReadOnlyFirst. @@ -81,7 +100,8 @@ def bar( """ self._bar = ( - bar) + bar + ) @property def baz(self): @@ -94,9 +114,7 @@ def baz(self): return self._baz @baz.setter - def baz( - self, - baz): + def baz(self, baz): # noqa: E501 """Sets the baz of this ReadOnlyFirst. @@ -105,7 +123,8 @@ def baz( """ self._baz = ( - baz) + baz + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py index 9eb9757a1d22..83ab1e65054a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -10,48 +10,68 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class SpecialModelName(object): + +class SpecialModelName(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'special_property_name': 'int', + + allowed_values = { } attribute_map = { - 'special_property_name': '$special[property.name]', # noqa: E501 + 'special_property_name': '$special[property.name]' # noqa: E501 } - def __init__(self, special_property_name=None): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - + openapi_types = { + 'special_property_name': 'int' + } + validations = { + } - Keyword Args: - special_property_name (int): [optional] # noqa: E501 - """ + def __init__(self, special_property_name=None): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 self._special_property_name = None self.discriminator = None if special_property_name is not None: - self.special_property_name = special_property_name # noqa: E501 + self.special_property_name = ( + special_property_name + ) @property def special_property_name(self): @@ -64,9 +84,7 @@ def special_property_name(self): return self._special_property_name @special_property_name.setter - def special_property_name( - self, - special_property_name): + def special_property_name(self, special_property_name): # noqa: E501 """Sets the special_property_name of this SpecialModelName. @@ -75,7 +93,8 @@ def special_property_name( """ self._special_property_name = ( - special_property_name) + special_property_name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py new file mode 100644 index 000000000000..01427c702be3 --- /dev/null +++ b/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + """ + + allowed_values = { + } + + attribute_map = { + } + + openapi_types = { + } + + validations = { + } + + def __init__(self): # noqa: E501 + """StringBooleanMap - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StringBooleanMap): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/client/petstore/python-experimental/petstore_api/models/tag.py index 2fbb5adb76bf..f5e08704a007 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/tag.py @@ -10,54 +10,75 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class Tag(object): + +class Tag(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'id': 'int', - 'name': 'str', + + allowed_values = { } attribute_map = { 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 + 'name': 'name' # noqa: E501 } - def __init__(self, id=None, name=None): # noqa: E501 - """Tag - a model defined in OpenAPI - + openapi_types = { + 'id': 'int', + 'name': 'str' + } + validations = { + } - Keyword Args: - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ + def __init__(self, id=None, name=None): # noqa: E501 + """Tag - a model defined in OpenAPI""" # noqa: E501 self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id # noqa: E501 + self.id = ( + id + ) if name is not None: - self.name = name # noqa: E501 + self.name = ( + name + ) @property def id(self): @@ -70,9 +91,7 @@ def id(self): return self._id @id.setter - def id( - self, - id): + def id(self, id): # noqa: E501 """Sets the id of this Tag. @@ -81,7 +100,8 @@ def id( """ self._id = ( - id) + id + ) @property def name(self): @@ -94,9 +114,7 @@ def name(self): return self._name @name.setter - def name( - self, - name): + def name(self, name): # noqa: E501 """Sets the name of this Tag. @@ -105,7 +123,8 @@ def name( """ self._name = ( - name) + name + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py index 08d1ac6432b1..a27e05e14d21 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py @@ -10,34 +10,45 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class TypeHolderDefault(object): + +class TypeHolderDefault(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]', - 'date_item': 'date', - 'datetime_item': 'datetime', + + allowed_values = { } attribute_map = { @@ -45,25 +56,26 @@ class TypeHolderDefault(object): 'number_item': 'number_item', # noqa: E501 'integer_item': 'integer_item', # noqa: E501 'bool_item': 'bool_item', # noqa: E501 - 'array_item': 'array_item', # noqa: E501 'date_item': 'date_item', # noqa: E501 'datetime_item': 'datetime_item', # noqa: E501 + 'array_item': 'array_item' # noqa: E501 } - def __init__(self, array_item, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, date_item=None, datetime_item=None): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI + openapi_types = { + 'string_item': 'str', + 'number_item': 'float', + 'integer_item': 'int', + 'bool_item': 'bool', + 'date_item': 'date', + 'datetime_item': 'datetime', + 'array_item': 'list[int]' + } - Args: - array_item (list[int]): + validations = { + } - Keyword Args: - string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501 - number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501 - integer_item (int): defaults to -2, must be one of [-2] # noqa: E501 - bool_item (bool): defaults to True, must be one of [True] # noqa: E501 # noqa: E501 - date_item (date): [optional] # noqa: E501 - datetime_item (datetime): [optional] # noqa: E501 - """ + def __init__(self, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, date_item=None, datetime_item=None, array_item=None): # noqa: E501 + """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 self._string_item = None self._number_item = None @@ -79,9 +91,13 @@ def __init__(self, array_item, string_item='what', number_item=1.234, integer_it self.integer_item = integer_item self.bool_item = bool_item if date_item is not None: - self.date_item = date_item # noqa: E501 + self.date_item = ( + date_item + ) if datetime_item is not None: - self.datetime_item = datetime_item # noqa: E501 + self.datetime_item = ( + datetime_item + ) self.array_item = array_item @property @@ -95,9 +111,7 @@ def string_item(self): return self._string_item @string_item.setter - def string_item( - self, - string_item): + def string_item(self, string_item): # noqa: E501 """Sets the string_item of this TypeHolderDefault. @@ -105,10 +119,11 @@ def string_item( :type: str """ if string_item is None: - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 self._string_item = ( - string_item) + string_item + ) @property def number_item(self): @@ -121,9 +136,7 @@ def number_item(self): return self._number_item @number_item.setter - def number_item( - self, - number_item): + def number_item(self, number_item): # noqa: E501 """Sets the number_item of this TypeHolderDefault. @@ -131,10 +144,11 @@ def number_item( :type: float """ if number_item is None: - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 self._number_item = ( - number_item) + number_item + ) @property def integer_item(self): @@ -147,9 +161,7 @@ def integer_item(self): return self._integer_item @integer_item.setter - def integer_item( - self, - integer_item): + def integer_item(self, integer_item): # noqa: E501 """Sets the integer_item of this TypeHolderDefault. @@ -157,10 +169,11 @@ def integer_item( :type: int """ if integer_item is None: - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 self._integer_item = ( - integer_item) + integer_item + ) @property def bool_item(self): @@ -173,9 +186,7 @@ def bool_item(self): return self._bool_item @bool_item.setter - def bool_item( - self, - bool_item): + def bool_item(self, bool_item): # noqa: E501 """Sets the bool_item of this TypeHolderDefault. @@ -183,10 +194,11 @@ def bool_item( :type: bool """ if bool_item is None: - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 self._bool_item = ( - bool_item) + bool_item + ) @property def date_item(self): @@ -199,9 +211,7 @@ def date_item(self): return self._date_item @date_item.setter - def date_item( - self, - date_item): + def date_item(self, date_item): # noqa: E501 """Sets the date_item of this TypeHolderDefault. @@ -210,7 +220,8 @@ def date_item( """ self._date_item = ( - date_item) + date_item + ) @property def datetime_item(self): @@ -223,9 +234,7 @@ def datetime_item(self): return self._datetime_item @datetime_item.setter - def datetime_item( - self, - datetime_item): + def datetime_item(self, datetime_item): # noqa: E501 """Sets the datetime_item of this TypeHolderDefault. @@ -234,7 +243,8 @@ def datetime_item( """ self._datetime_item = ( - datetime_item) + datetime_item + ) @property def array_item(self): @@ -247,9 +257,7 @@ def array_item(self): return self._array_item @array_item.setter - def array_item( - self, - array_item): + def array_item(self, array_item): # noqa: E501 """Sets the array_item of this TypeHolderDefault. @@ -257,10 +265,11 @@ def array_item( :type: list[int] """ if array_item is None: - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 self._array_item = ( - array_item) + array_item + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py index 96620b8b5491..661bb21a3805 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py @@ -10,32 +10,54 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class TypeHolderExample(object): + +class TypeHolderExample(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'string_item': 'str', - 'number_item': 'float', - 'integer_item': 'int', - 'bool_item': 'bool', - 'array_item': 'list[int]', + + allowed_values = { + ('string_item',): { + 'WHAT': "what" + }, + ('number_item',): { + '1.234': 1.234 + }, + ('integer_item',): { + '-2': -2 + }, } attribute_map = { @@ -43,21 +65,22 @@ class TypeHolderExample(object): 'number_item': 'number_item', # noqa: E501 'integer_item': 'integer_item', # noqa: E501 'bool_item': 'bool_item', # noqa: E501 - 'array_item': 'array_item', # noqa: E501 + 'array_item': 'array_item' # noqa: E501 } - def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, integer_item=-2): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI + openapi_types = { + 'string_item': 'str', + 'number_item': 'float', + 'integer_item': 'int', + 'bool_item': 'bool', + 'array_item': 'list[int]' + } - Args: - bool_item (bool): - array_item (list[int]): + validations = { + } - Keyword Args: - string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501 - number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501 - integer_item (int): defaults to -2, must be one of [-2] # noqa: E501 # noqa: E501 # noqa: E501 - """ + def __init__(self, string_item='what', number_item=1.234, integer_item=-2, bool_item=None, array_item=None): # noqa: E501 + """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 self._string_item = None self._number_item = None @@ -83,9 +106,7 @@ def string_item(self): return self._string_item @string_item.setter - def string_item( - self, - string_item): + def string_item(self, string_item): # noqa: E501 """Sets the string_item of this TypeHolderExample. @@ -93,16 +114,17 @@ def string_item( :type: str """ if string_item is None: - raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - allowed_values = ["what"] # noqa: E501 - if string_item not in allowed_values: - raise ValueError( - "Invalid value for `string_item` ({0}), must be one of {1}" # noqa: E501 - .format(string_item, allowed_values) - ) + raise ApiValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 + check_allowed_values( + self.allowed_values, + ('string_item',), + string_item, + self.validations + ) self._string_item = ( - string_item) + string_item + ) @property def number_item(self): @@ -115,9 +137,7 @@ def number_item(self): return self._number_item @number_item.setter - def number_item( - self, - number_item): + def number_item(self, number_item): # noqa: E501 """Sets the number_item of this TypeHolderExample. @@ -125,16 +145,17 @@ def number_item( :type: float """ if number_item is None: - raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - allowed_values = [1.234] # noqa: E501 - if number_item not in allowed_values: - raise ValueError( - "Invalid value for `number_item` ({0}), must be one of {1}" # noqa: E501 - .format(number_item, allowed_values) - ) + raise ApiValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 + check_allowed_values( + self.allowed_values, + ('number_item',), + number_item, + self.validations + ) self._number_item = ( - number_item) + number_item + ) @property def integer_item(self): @@ -147,9 +168,7 @@ def integer_item(self): return self._integer_item @integer_item.setter - def integer_item( - self, - integer_item): + def integer_item(self, integer_item): # noqa: E501 """Sets the integer_item of this TypeHolderExample. @@ -157,16 +176,17 @@ def integer_item( :type: int """ if integer_item is None: - raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - allowed_values = [-2] # noqa: E501 - if integer_item not in allowed_values: - raise ValueError( - "Invalid value for `integer_item` ({0}), must be one of {1}" # noqa: E501 - .format(integer_item, allowed_values) - ) + raise ApiValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 + check_allowed_values( + self.allowed_values, + ('integer_item',), + integer_item, + self.validations + ) self._integer_item = ( - integer_item) + integer_item + ) @property def bool_item(self): @@ -179,9 +199,7 @@ def bool_item(self): return self._bool_item @bool_item.setter - def bool_item( - self, - bool_item): + def bool_item(self, bool_item): # noqa: E501 """Sets the bool_item of this TypeHolderExample. @@ -189,10 +207,11 @@ def bool_item( :type: bool """ if bool_item is None: - raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 self._bool_item = ( - bool_item) + bool_item + ) @property def array_item(self): @@ -205,9 +224,7 @@ def array_item(self): return self._array_item @array_item.setter - def array_item( - self, - array_item): + def array_item(self, array_item): # noqa: E501 """Sets the array_item of this TypeHolderExample. @@ -215,10 +232,11 @@ def array_item( :type: list[int] """ if array_item is None: - raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 + raise ApiValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 self._array_item = ( - array_item) + array_item + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/user.py b/samples/client/petstore/python-experimental/petstore_api/models/user.py index 382f0cc5fc50..1dcf8d755325 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/user.py @@ -10,35 +10,45 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class User(object): + +class User(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'id': 'int', - 'username': 'str', - 'first_name': 'str', - 'last_name': 'str', - 'email': 'str', - 'password': 'str', - 'phone': 'str', - 'user_status': 'int', + + allowed_values = { } attribute_map = { @@ -49,24 +59,25 @@ class User(object): 'email': 'email', # noqa: E501 'password': 'password', # noqa: E501 'phone': 'phone', # noqa: E501 - 'user_status': 'userStatus', # noqa: E501 + 'user_status': 'userStatus' # noqa: E501 } - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 - """User - a model defined in OpenAPI - + openapi_types = { + 'id': 'int', + 'username': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'email': 'str', + 'password': 'str', + 'phone': 'str', + 'user_status': 'int' + } + validations = { + } - Keyword Args: - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - """ + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 + """User - a model defined in OpenAPI""" # noqa: E501 self._id = None self._username = None @@ -79,21 +90,37 @@ def __init__(self, id=None, username=None, first_name=None, last_name=None, emai self.discriminator = None if id is not None: - self.id = id # noqa: E501 + self.id = ( + id + ) if username is not None: - self.username = username # noqa: E501 + self.username = ( + username + ) if first_name is not None: - self.first_name = first_name # noqa: E501 + self.first_name = ( + first_name + ) if last_name is not None: - self.last_name = last_name # noqa: E501 + self.last_name = ( + last_name + ) if email is not None: - self.email = email # noqa: E501 + self.email = ( + email + ) if password is not None: - self.password = password # noqa: E501 + self.password = ( + password + ) if phone is not None: - self.phone = phone # noqa: E501 + self.phone = ( + phone + ) if user_status is not None: - self.user_status = user_status # noqa: E501 + self.user_status = ( + user_status + ) @property def id(self): @@ -106,9 +133,7 @@ def id(self): return self._id @id.setter - def id( - self, - id): + def id(self, id): # noqa: E501 """Sets the id of this User. @@ -117,7 +142,8 @@ def id( """ self._id = ( - id) + id + ) @property def username(self): @@ -130,9 +156,7 @@ def username(self): return self._username @username.setter - def username( - self, - username): + def username(self, username): # noqa: E501 """Sets the username of this User. @@ -141,7 +165,8 @@ def username( """ self._username = ( - username) + username + ) @property def first_name(self): @@ -154,9 +179,7 @@ def first_name(self): return self._first_name @first_name.setter - def first_name( - self, - first_name): + def first_name(self, first_name): # noqa: E501 """Sets the first_name of this User. @@ -165,7 +188,8 @@ def first_name( """ self._first_name = ( - first_name) + first_name + ) @property def last_name(self): @@ -178,9 +202,7 @@ def last_name(self): return self._last_name @last_name.setter - def last_name( - self, - last_name): + def last_name(self, last_name): # noqa: E501 """Sets the last_name of this User. @@ -189,7 +211,8 @@ def last_name( """ self._last_name = ( - last_name) + last_name + ) @property def email(self): @@ -202,9 +225,7 @@ def email(self): return self._email @email.setter - def email( - self, - email): + def email(self, email): # noqa: E501 """Sets the email of this User. @@ -213,7 +234,8 @@ def email( """ self._email = ( - email) + email + ) @property def password(self): @@ -226,9 +248,7 @@ def password(self): return self._password @password.setter - def password( - self, - password): + def password(self, password): # noqa: E501 """Sets the password of this User. @@ -237,7 +257,8 @@ def password( """ self._password = ( - password) + password + ) @property def phone(self): @@ -250,9 +271,7 @@ def phone(self): return self._phone @phone.setter - def phone( - self, - phone): + def phone(self, phone): # noqa: E501 """Sets the phone of this User. @@ -261,7 +280,8 @@ def phone( """ self._phone = ( - phone) + phone + ) @property def user_status(self): @@ -275,9 +295,7 @@ def user_status(self): return self._user_status @user_status.setter - def user_status( - self, - user_status): + def user_status(self, user_status): # noqa: E501 """Sets the user_status of this User. User Status # noqa: E501 @@ -287,7 +305,8 @@ def user_status( """ self._user_status = ( - user_status) + user_status + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py index 4d9c57350be0..3657b04b1e6b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py @@ -10,56 +10,45 @@ """ -import pprint +import pprint # noqa: F401 import re # noqa: F401 -import six +import six # noqa: F401 +from petstore_api.exceptions import ApiValueError # noqa: F401 +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations +) -class XmlItem(object): + +class XmlItem(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - """ - """ Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name - and the value is json key in definition. + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. """ - openapi_types = { - 'attribute_string': 'str', - 'attribute_number': 'float', - 'attribute_integer': 'int', - 'attribute_boolean': 'bool', - 'wrapped_array': 'list[int]', - 'name_string': 'str', - 'name_number': 'float', - 'name_integer': 'int', - 'name_boolean': 'bool', - 'name_array': 'list[int]', - 'name_wrapped_array': 'list[int]', - 'prefix_string': 'str', - 'prefix_number': 'float', - 'prefix_integer': 'int', - 'prefix_boolean': 'bool', - 'prefix_array': 'list[int]', - 'prefix_wrapped_array': 'list[int]', - 'namespace_string': 'str', - 'namespace_number': 'float', - 'namespace_integer': 'int', - 'namespace_boolean': 'bool', - 'namespace_array': 'list[int]', - 'namespace_wrapped_array': 'list[int]', - 'prefix_ns_string': 'str', - 'prefix_ns_number': 'float', - 'prefix_ns_integer': 'int', - 'prefix_ns_boolean': 'bool', - 'prefix_ns_array': 'list[int]', - 'prefix_ns_wrapped_array': 'list[int]', + + allowed_values = { } attribute_map = { @@ -91,45 +80,46 @@ class XmlItem(object): 'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501 'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501 'prefix_ns_array': 'prefix_ns_array', # noqa: E501 - 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array', # noqa: E501 + 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' # noqa: E501 + } + + openapi_types = { + 'attribute_string': 'str', + 'attribute_number': 'float', + 'attribute_integer': 'int', + 'attribute_boolean': 'bool', + 'wrapped_array': 'list[int]', + 'name_string': 'str', + 'name_number': 'float', + 'name_integer': 'int', + 'name_boolean': 'bool', + 'name_array': 'list[int]', + 'name_wrapped_array': 'list[int]', + 'prefix_string': 'str', + 'prefix_number': 'float', + 'prefix_integer': 'int', + 'prefix_boolean': 'bool', + 'prefix_array': 'list[int]', + 'prefix_wrapped_array': 'list[int]', + 'namespace_string': 'str', + 'namespace_number': 'float', + 'namespace_integer': 'int', + 'namespace_boolean': 'bool', + 'namespace_array': 'list[int]', + 'namespace_wrapped_array': 'list[int]', + 'prefix_ns_string': 'str', + 'prefix_ns_number': 'float', + 'prefix_ns_integer': 'int', + 'prefix_ns_boolean': 'bool', + 'prefix_ns_array': 'list[int]', + 'prefix_ns_wrapped_array': 'list[int]' + } + + validations = { } def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None): # noqa: E501 - """XmlItem - a model defined in OpenAPI - - - - Keyword Args: - attribute_string (str): [optional] # noqa: E501 - attribute_number (float): [optional] # noqa: E501 - attribute_integer (int): [optional] # noqa: E501 - attribute_boolean (bool): [optional] # noqa: E501 - wrapped_array (list[int]): [optional] # noqa: E501 - name_string (str): [optional] # noqa: E501 - name_number (float): [optional] # noqa: E501 - name_integer (int): [optional] # noqa: E501 - name_boolean (bool): [optional] # noqa: E501 - name_array (list[int]): [optional] # noqa: E501 - name_wrapped_array (list[int]): [optional] # noqa: E501 - prefix_string (str): [optional] # noqa: E501 - prefix_number (float): [optional] # noqa: E501 - prefix_integer (int): [optional] # noqa: E501 - prefix_boolean (bool): [optional] # noqa: E501 - prefix_array (list[int]): [optional] # noqa: E501 - prefix_wrapped_array (list[int]): [optional] # noqa: E501 - namespace_string (str): [optional] # noqa: E501 - namespace_number (float): [optional] # noqa: E501 - namespace_integer (int): [optional] # noqa: E501 - namespace_boolean (bool): [optional] # noqa: E501 - namespace_array (list[int]): [optional] # noqa: E501 - namespace_wrapped_array (list[int]): [optional] # noqa: E501 - prefix_ns_string (str): [optional] # noqa: E501 - prefix_ns_number (float): [optional] # noqa: E501 - prefix_ns_integer (int): [optional] # noqa: E501 - prefix_ns_boolean (bool): [optional] # noqa: E501 - prefix_ns_array (list[int]): [optional] # noqa: E501 - prefix_ns_wrapped_array (list[int]): [optional] # noqa: E501 - """ + """XmlItem - a model defined in OpenAPI""" # noqa: E501 self._attribute_string = None self._attribute_number = None @@ -163,63 +153,121 @@ def __init__(self, attribute_string=None, attribute_number=None, attribute_integ self.discriminator = None if attribute_string is not None: - self.attribute_string = attribute_string # noqa: E501 + self.attribute_string = ( + attribute_string + ) if attribute_number is not None: - self.attribute_number = attribute_number # noqa: E501 + self.attribute_number = ( + attribute_number + ) if attribute_integer is not None: - self.attribute_integer = attribute_integer # noqa: E501 + self.attribute_integer = ( + attribute_integer + ) if attribute_boolean is not None: - self.attribute_boolean = attribute_boolean # noqa: E501 + self.attribute_boolean = ( + attribute_boolean + ) if wrapped_array is not None: - self.wrapped_array = wrapped_array # noqa: E501 + self.wrapped_array = ( + wrapped_array + ) if name_string is not None: - self.name_string = name_string # noqa: E501 + self.name_string = ( + name_string + ) if name_number is not None: - self.name_number = name_number # noqa: E501 + self.name_number = ( + name_number + ) if name_integer is not None: - self.name_integer = name_integer # noqa: E501 + self.name_integer = ( + name_integer + ) if name_boolean is not None: - self.name_boolean = name_boolean # noqa: E501 + self.name_boolean = ( + name_boolean + ) if name_array is not None: - self.name_array = name_array # noqa: E501 + self.name_array = ( + name_array + ) if name_wrapped_array is not None: - self.name_wrapped_array = name_wrapped_array # noqa: E501 + self.name_wrapped_array = ( + name_wrapped_array + ) if prefix_string is not None: - self.prefix_string = prefix_string # noqa: E501 + self.prefix_string = ( + prefix_string + ) if prefix_number is not None: - self.prefix_number = prefix_number # noqa: E501 + self.prefix_number = ( + prefix_number + ) if prefix_integer is not None: - self.prefix_integer = prefix_integer # noqa: E501 + self.prefix_integer = ( + prefix_integer + ) if prefix_boolean is not None: - self.prefix_boolean = prefix_boolean # noqa: E501 + self.prefix_boolean = ( + prefix_boolean + ) if prefix_array is not None: - self.prefix_array = prefix_array # noqa: E501 + self.prefix_array = ( + prefix_array + ) if prefix_wrapped_array is not None: - self.prefix_wrapped_array = prefix_wrapped_array # noqa: E501 + self.prefix_wrapped_array = ( + prefix_wrapped_array + ) if namespace_string is not None: - self.namespace_string = namespace_string # noqa: E501 + self.namespace_string = ( + namespace_string + ) if namespace_number is not None: - self.namespace_number = namespace_number # noqa: E501 + self.namespace_number = ( + namespace_number + ) if namespace_integer is not None: - self.namespace_integer = namespace_integer # noqa: E501 + self.namespace_integer = ( + namespace_integer + ) if namespace_boolean is not None: - self.namespace_boolean = namespace_boolean # noqa: E501 + self.namespace_boolean = ( + namespace_boolean + ) if namespace_array is not None: - self.namespace_array = namespace_array # noqa: E501 + self.namespace_array = ( + namespace_array + ) if namespace_wrapped_array is not None: - self.namespace_wrapped_array = namespace_wrapped_array # noqa: E501 + self.namespace_wrapped_array = ( + namespace_wrapped_array + ) if prefix_ns_string is not None: - self.prefix_ns_string = prefix_ns_string # noqa: E501 + self.prefix_ns_string = ( + prefix_ns_string + ) if prefix_ns_number is not None: - self.prefix_ns_number = prefix_ns_number # noqa: E501 + self.prefix_ns_number = ( + prefix_ns_number + ) if prefix_ns_integer is not None: - self.prefix_ns_integer = prefix_ns_integer # noqa: E501 + self.prefix_ns_integer = ( + prefix_ns_integer + ) if prefix_ns_boolean is not None: - self.prefix_ns_boolean = prefix_ns_boolean # noqa: E501 + self.prefix_ns_boolean = ( + prefix_ns_boolean + ) if prefix_ns_array is not None: - self.prefix_ns_array = prefix_ns_array # noqa: E501 + self.prefix_ns_array = ( + prefix_ns_array + ) if prefix_ns_wrapped_array is not None: - self.prefix_ns_wrapped_array = prefix_ns_wrapped_array # noqa: E501 + self.prefix_ns_wrapped_array = ( + prefix_ns_wrapped_array + ) @property def attribute_string(self): @@ -232,9 +280,7 @@ def attribute_string(self): return self._attribute_string @attribute_string.setter - def attribute_string( - self, - attribute_string): + def attribute_string(self, attribute_string): # noqa: E501 """Sets the attribute_string of this XmlItem. @@ -243,7 +289,8 @@ def attribute_string( """ self._attribute_string = ( - attribute_string) + attribute_string + ) @property def attribute_number(self): @@ -256,9 +303,7 @@ def attribute_number(self): return self._attribute_number @attribute_number.setter - def attribute_number( - self, - attribute_number): + def attribute_number(self, attribute_number): # noqa: E501 """Sets the attribute_number of this XmlItem. @@ -267,7 +312,8 @@ def attribute_number( """ self._attribute_number = ( - attribute_number) + attribute_number + ) @property def attribute_integer(self): @@ -280,9 +326,7 @@ def attribute_integer(self): return self._attribute_integer @attribute_integer.setter - def attribute_integer( - self, - attribute_integer): + def attribute_integer(self, attribute_integer): # noqa: E501 """Sets the attribute_integer of this XmlItem. @@ -291,7 +335,8 @@ def attribute_integer( """ self._attribute_integer = ( - attribute_integer) + attribute_integer + ) @property def attribute_boolean(self): @@ -304,9 +349,7 @@ def attribute_boolean(self): return self._attribute_boolean @attribute_boolean.setter - def attribute_boolean( - self, - attribute_boolean): + def attribute_boolean(self, attribute_boolean): # noqa: E501 """Sets the attribute_boolean of this XmlItem. @@ -315,7 +358,8 @@ def attribute_boolean( """ self._attribute_boolean = ( - attribute_boolean) + attribute_boolean + ) @property def wrapped_array(self): @@ -328,9 +372,7 @@ def wrapped_array(self): return self._wrapped_array @wrapped_array.setter - def wrapped_array( - self, - wrapped_array): + def wrapped_array(self, wrapped_array): # noqa: E501 """Sets the wrapped_array of this XmlItem. @@ -339,7 +381,8 @@ def wrapped_array( """ self._wrapped_array = ( - wrapped_array) + wrapped_array + ) @property def name_string(self): @@ -352,9 +395,7 @@ def name_string(self): return self._name_string @name_string.setter - def name_string( - self, - name_string): + def name_string(self, name_string): # noqa: E501 """Sets the name_string of this XmlItem. @@ -363,7 +404,8 @@ def name_string( """ self._name_string = ( - name_string) + name_string + ) @property def name_number(self): @@ -376,9 +418,7 @@ def name_number(self): return self._name_number @name_number.setter - def name_number( - self, - name_number): + def name_number(self, name_number): # noqa: E501 """Sets the name_number of this XmlItem. @@ -387,7 +427,8 @@ def name_number( """ self._name_number = ( - name_number) + name_number + ) @property def name_integer(self): @@ -400,9 +441,7 @@ def name_integer(self): return self._name_integer @name_integer.setter - def name_integer( - self, - name_integer): + def name_integer(self, name_integer): # noqa: E501 """Sets the name_integer of this XmlItem. @@ -411,7 +450,8 @@ def name_integer( """ self._name_integer = ( - name_integer) + name_integer + ) @property def name_boolean(self): @@ -424,9 +464,7 @@ def name_boolean(self): return self._name_boolean @name_boolean.setter - def name_boolean( - self, - name_boolean): + def name_boolean(self, name_boolean): # noqa: E501 """Sets the name_boolean of this XmlItem. @@ -435,7 +473,8 @@ def name_boolean( """ self._name_boolean = ( - name_boolean) + name_boolean + ) @property def name_array(self): @@ -448,9 +487,7 @@ def name_array(self): return self._name_array @name_array.setter - def name_array( - self, - name_array): + def name_array(self, name_array): # noqa: E501 """Sets the name_array of this XmlItem. @@ -459,7 +496,8 @@ def name_array( """ self._name_array = ( - name_array) + name_array + ) @property def name_wrapped_array(self): @@ -472,9 +510,7 @@ def name_wrapped_array(self): return self._name_wrapped_array @name_wrapped_array.setter - def name_wrapped_array( - self, - name_wrapped_array): + def name_wrapped_array(self, name_wrapped_array): # noqa: E501 """Sets the name_wrapped_array of this XmlItem. @@ -483,7 +519,8 @@ def name_wrapped_array( """ self._name_wrapped_array = ( - name_wrapped_array) + name_wrapped_array + ) @property def prefix_string(self): @@ -496,9 +533,7 @@ def prefix_string(self): return self._prefix_string @prefix_string.setter - def prefix_string( - self, - prefix_string): + def prefix_string(self, prefix_string): # noqa: E501 """Sets the prefix_string of this XmlItem. @@ -507,7 +542,8 @@ def prefix_string( """ self._prefix_string = ( - prefix_string) + prefix_string + ) @property def prefix_number(self): @@ -520,9 +556,7 @@ def prefix_number(self): return self._prefix_number @prefix_number.setter - def prefix_number( - self, - prefix_number): + def prefix_number(self, prefix_number): # noqa: E501 """Sets the prefix_number of this XmlItem. @@ -531,7 +565,8 @@ def prefix_number( """ self._prefix_number = ( - prefix_number) + prefix_number + ) @property def prefix_integer(self): @@ -544,9 +579,7 @@ def prefix_integer(self): return self._prefix_integer @prefix_integer.setter - def prefix_integer( - self, - prefix_integer): + def prefix_integer(self, prefix_integer): # noqa: E501 """Sets the prefix_integer of this XmlItem. @@ -555,7 +588,8 @@ def prefix_integer( """ self._prefix_integer = ( - prefix_integer) + prefix_integer + ) @property def prefix_boolean(self): @@ -568,9 +602,7 @@ def prefix_boolean(self): return self._prefix_boolean @prefix_boolean.setter - def prefix_boolean( - self, - prefix_boolean): + def prefix_boolean(self, prefix_boolean): # noqa: E501 """Sets the prefix_boolean of this XmlItem. @@ -579,7 +611,8 @@ def prefix_boolean( """ self._prefix_boolean = ( - prefix_boolean) + prefix_boolean + ) @property def prefix_array(self): @@ -592,9 +625,7 @@ def prefix_array(self): return self._prefix_array @prefix_array.setter - def prefix_array( - self, - prefix_array): + def prefix_array(self, prefix_array): # noqa: E501 """Sets the prefix_array of this XmlItem. @@ -603,7 +634,8 @@ def prefix_array( """ self._prefix_array = ( - prefix_array) + prefix_array + ) @property def prefix_wrapped_array(self): @@ -616,9 +648,7 @@ def prefix_wrapped_array(self): return self._prefix_wrapped_array @prefix_wrapped_array.setter - def prefix_wrapped_array( - self, - prefix_wrapped_array): + def prefix_wrapped_array(self, prefix_wrapped_array): # noqa: E501 """Sets the prefix_wrapped_array of this XmlItem. @@ -627,7 +657,8 @@ def prefix_wrapped_array( """ self._prefix_wrapped_array = ( - prefix_wrapped_array) + prefix_wrapped_array + ) @property def namespace_string(self): @@ -640,9 +671,7 @@ def namespace_string(self): return self._namespace_string @namespace_string.setter - def namespace_string( - self, - namespace_string): + def namespace_string(self, namespace_string): # noqa: E501 """Sets the namespace_string of this XmlItem. @@ -651,7 +680,8 @@ def namespace_string( """ self._namespace_string = ( - namespace_string) + namespace_string + ) @property def namespace_number(self): @@ -664,9 +694,7 @@ def namespace_number(self): return self._namespace_number @namespace_number.setter - def namespace_number( - self, - namespace_number): + def namespace_number(self, namespace_number): # noqa: E501 """Sets the namespace_number of this XmlItem. @@ -675,7 +703,8 @@ def namespace_number( """ self._namespace_number = ( - namespace_number) + namespace_number + ) @property def namespace_integer(self): @@ -688,9 +717,7 @@ def namespace_integer(self): return self._namespace_integer @namespace_integer.setter - def namespace_integer( - self, - namespace_integer): + def namespace_integer(self, namespace_integer): # noqa: E501 """Sets the namespace_integer of this XmlItem. @@ -699,7 +726,8 @@ def namespace_integer( """ self._namespace_integer = ( - namespace_integer) + namespace_integer + ) @property def namespace_boolean(self): @@ -712,9 +740,7 @@ def namespace_boolean(self): return self._namespace_boolean @namespace_boolean.setter - def namespace_boolean( - self, - namespace_boolean): + def namespace_boolean(self, namespace_boolean): # noqa: E501 """Sets the namespace_boolean of this XmlItem. @@ -723,7 +749,8 @@ def namespace_boolean( """ self._namespace_boolean = ( - namespace_boolean) + namespace_boolean + ) @property def namespace_array(self): @@ -736,9 +763,7 @@ def namespace_array(self): return self._namespace_array @namespace_array.setter - def namespace_array( - self, - namespace_array): + def namespace_array(self, namespace_array): # noqa: E501 """Sets the namespace_array of this XmlItem. @@ -747,7 +772,8 @@ def namespace_array( """ self._namespace_array = ( - namespace_array) + namespace_array + ) @property def namespace_wrapped_array(self): @@ -760,9 +786,7 @@ def namespace_wrapped_array(self): return self._namespace_wrapped_array @namespace_wrapped_array.setter - def namespace_wrapped_array( - self, - namespace_wrapped_array): + def namespace_wrapped_array(self, namespace_wrapped_array): # noqa: E501 """Sets the namespace_wrapped_array of this XmlItem. @@ -771,7 +795,8 @@ def namespace_wrapped_array( """ self._namespace_wrapped_array = ( - namespace_wrapped_array) + namespace_wrapped_array + ) @property def prefix_ns_string(self): @@ -784,9 +809,7 @@ def prefix_ns_string(self): return self._prefix_ns_string @prefix_ns_string.setter - def prefix_ns_string( - self, - prefix_ns_string): + def prefix_ns_string(self, prefix_ns_string): # noqa: E501 """Sets the prefix_ns_string of this XmlItem. @@ -795,7 +818,8 @@ def prefix_ns_string( """ self._prefix_ns_string = ( - prefix_ns_string) + prefix_ns_string + ) @property def prefix_ns_number(self): @@ -808,9 +832,7 @@ def prefix_ns_number(self): return self._prefix_ns_number @prefix_ns_number.setter - def prefix_ns_number( - self, - prefix_ns_number): + def prefix_ns_number(self, prefix_ns_number): # noqa: E501 """Sets the prefix_ns_number of this XmlItem. @@ -819,7 +841,8 @@ def prefix_ns_number( """ self._prefix_ns_number = ( - prefix_ns_number) + prefix_ns_number + ) @property def prefix_ns_integer(self): @@ -832,9 +855,7 @@ def prefix_ns_integer(self): return self._prefix_ns_integer @prefix_ns_integer.setter - def prefix_ns_integer( - self, - prefix_ns_integer): + def prefix_ns_integer(self, prefix_ns_integer): # noqa: E501 """Sets the prefix_ns_integer of this XmlItem. @@ -843,7 +864,8 @@ def prefix_ns_integer( """ self._prefix_ns_integer = ( - prefix_ns_integer) + prefix_ns_integer + ) @property def prefix_ns_boolean(self): @@ -856,9 +878,7 @@ def prefix_ns_boolean(self): return self._prefix_ns_boolean @prefix_ns_boolean.setter - def prefix_ns_boolean( - self, - prefix_ns_boolean): + def prefix_ns_boolean(self, prefix_ns_boolean): # noqa: E501 """Sets the prefix_ns_boolean of this XmlItem. @@ -867,7 +887,8 @@ def prefix_ns_boolean( """ self._prefix_ns_boolean = ( - prefix_ns_boolean) + prefix_ns_boolean + ) @property def prefix_ns_array(self): @@ -880,9 +901,7 @@ def prefix_ns_array(self): return self._prefix_ns_array @prefix_ns_array.setter - def prefix_ns_array( - self, - prefix_ns_array): + def prefix_ns_array(self, prefix_ns_array): # noqa: E501 """Sets the prefix_ns_array of this XmlItem. @@ -891,7 +910,8 @@ def prefix_ns_array( """ self._prefix_ns_array = ( - prefix_ns_array) + prefix_ns_array + ) @property def prefix_ns_wrapped_array(self): @@ -904,9 +924,7 @@ def prefix_ns_wrapped_array(self): return self._prefix_ns_wrapped_array @prefix_ns_wrapped_array.setter - def prefix_ns_wrapped_array( - self, - prefix_ns_wrapped_array): + def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): # noqa: E501 """Sets the prefix_ns_wrapped_array of this XmlItem. @@ -915,7 +933,8 @@ def prefix_ns_wrapped_array( """ self._prefix_ns_wrapped_array = ( - prefix_ns_wrapped_array) + prefix_ns_wrapped_array + ) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index 86988b6d42e0..1d5e7c2915ef 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -31,7 +31,7 @@ url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index fc2cbef35f1c..e8877b915ec1 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -40,11 +40,23 @@ def test_fake_outer_composite_serialize(self): """ pass + def test_fake_outer_enum_serialize(self): + """Test case for fake_outer_enum_serialize + + """ + # verify that the input and output are type OuterEnum + endpoint = self.api.fake_outer_enum_serialize + assert endpoint.openapi_types['body'] == 'OuterEnum' + assert endpoint.settings['response_type'] == 'OuterEnum' + def test_fake_outer_number_serialize(self): """Test case for fake_outer_number_serialize """ - pass + # verify that the input and output are the correct type + endpoint = self.api.fake_outer_number_serialize + assert endpoint.openapi_types['body'] == 'OuterNumber' + assert endpoint.settings['response_type'] == 'OuterNumber' def test_fake_outer_string_serialize(self): """Test case for fake_outer_string_serialize @@ -70,14 +82,38 @@ def test_test_endpoint_parameters(self): Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 """ - pass + # check that we can access the endpoint's validations + endpoint = self.api.test_endpoint_parameters + assert endpoint.validations[('number',)] == { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + } + # make sure that an exception is thrown on an invalid value + keyword_args = dict( + number=544, # invalid + double=100, + pattern_without_delimiter="abc", + byte='sample string' + ) + with self.assertRaises(petstore_api.ApiValueError): + self.api.test_endpoint_parameters(**keyword_args) def test_test_enum_parameters(self): """Test case for test_enum_parameters To test enum parameters # noqa: E501 """ - pass + # check that we can access the endpoint's allowed_values + endpoint = self.api.test_enum_parameters + assert endpoint.allowed_values[('enum_query_string',)] == { + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + } + # make sure that an exception is thrown on an invalid value + keyword_args = dict(enum_query_string="bad value") + with self.assertRaises(petstore_api.ApiValueError): + self.api.test_enum_parameters(**keyword_args) def test_test_inline_additional_properties(self): """Test case for test_inline_additional_properties diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index 46707c77b708..ba20d7f811b8 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -2,9 +2,7 @@ """ OpenAPI Petstore - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -16,24 +14,139 @@ import petstore_api from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api import ApiValueError class TestFormatTest(unittest.TestCase): """FormatTest unit test stubs""" def setUp(self): - pass + self.required_named_args = dict( + number=40.1, + byte='what', + date='2019-03-23', + password='rainbowtable' + ) + + def test_integer(self): + var_name = 'integer' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_int32(self): + var_name = 'int32' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_number(self): + var_name = 'number' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_float(self): + var_name = 'float' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_double(self): + var_name = 'double' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(ApiValueError): + keyword_args[var_name] = validations[key] + adder + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + validations[key]) + + def test_password(self): + var_name = 'password' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + key_adder_pairs = [('max_length', 1), ('min_length', -1)] + for key, adder in key_adder_pairs: + # value outside the bounds throws an error + with self.assertRaises(ApiValueError): + keyword_args[var_name] = 'a'*(validations[key] + adder) + FormatTest(**keyword_args) + + # value inside the bounds works + keyword_args[var_name] = 'a'*validations[key] + assert (getattr(FormatTest(**keyword_args), var_name) == + 'a'*validations[key]) - def tearDown(self): - pass + def test_string(self): + var_name = 'string' + validations = FormatTest.validations[(var_name,)] + keyword_args = {} + keyword_args.update(self.required_named_args) + values_invalid = ['abc3', '1', '.', ' ', 'مرحبا', ''] + for value_invalid in values_invalid: + # invalid values throw exceptions + with self.assertRaises(ApiValueError): + keyword_args[var_name] = value_invalid + FormatTest(**keyword_args) - def testFormatTest(self): - """Test FormatTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - pass + # valid value works + value_valid = 'abcdz' + keyword_args[var_name] = value_valid + assert getattr(FormatTest(**keyword_args), var_name) == value_valid if __name__ == '__main__': - unittest.main() + unittest.main() \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/test/test_outer_enum.py b/samples/client/petstore/python-experimental/test/test_outer_enum.py index 472e36e16821..50bfff0869b7 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_enum.py +++ b/samples/client/petstore/python-experimental/test/test_outer_enum.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -30,10 +30,18 @@ def tearDown(self): def testOuterEnum(self): """Test OuterEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 - pass - + # make sure that we can access its allowed_values + assert OuterEnum.allowed_values[('value',)] == { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered" + } + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + OuterEnum('bad_value') + # make sure valid value works + valid_value = OuterEnum.allowed_values[('value',)]['PLACED'] + assert valid_value == OuterEnum(valid_value).value if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_outer_number.py b/samples/client/petstore/python-experimental/test/test_outer_number.py new file mode 100644 index 000000000000..31c9c41755dc --- /dev/null +++ b/samples/client/petstore/python-experimental/test/test_outer_number.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_number import OuterNumber # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterNumber(unittest.TestCase): + """OuterNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterNumber(self): + """Test OuterNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_number.OuterNumber() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py new file mode 100644 index 000000000000..31c1ebeec5db --- /dev/null +++ b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.string_boolean_map import StringBooleanMap # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.string_boolean_map.StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index 4cb90d0ed92b..08a201b854d0 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -32,10 +32,8 @@ def testTypeHolderDefault(self): """Test TypeHolderDefault""" # required_vars are set to None now until swagger-parser/swagger-core fixes # https://github.com/swagger-api/swagger-parser/issues/971 - with self.assertRaises(TypeError): - model = TypeHolderDefault() array_item = [1, 2, 3] - model = TypeHolderDefault(array_item) + model = TypeHolderDefault(array_item=array_item) self.assertEqual(model.string_item, 'what') self.assertEqual(model.bool_item, True) diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index 75bf81a8de07..a05c3e902c58 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -58,15 +58,13 @@ def test_500_error(self): with self.checkRaiseRegex(ApiException, "Internal Server Error"): self.pet_api.upload_file( pet_id=self.pet.id, - additional_metadata="special", - file=None + additional_metadata="special" ) try: self.pet_api.upload_file( pet_id=self.pet.id, - additional_metadata="special", - file=None + additional_metadata="special" ) except ApiException as e: self.assertEqual(e.status, 500) diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index 6c4e083d1cd7..10c5ecef4239 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -42,13 +42,19 @@ def test_enum_test(self): deserialized = self.deserialize(response, 'dict(str, EnumTest)') self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest)) - self.assertEqual(deserialized['enum_test'], - petstore_api.EnumTest(enum_string="UPPER", - enum_string_required="lower", - enum_integer=1, - enum_number=1.1, - outer_enum=petstore_api.OuterEnum.PLACED)) + self.assertTrue( + isinstance(deserialized['enum_test'], petstore_api.EnumTest)) + outer_enum_value = ( + petstore_api.OuterEnum.allowed_values[('value',)]["PLACED"]) + outer_enum = petstore_api.OuterEnum(outer_enum_value) + sample_instance = petstore_api.EnumTest( + enum_string="UPPER", + enum_string_required="lower", + enum_integer=1, + enum_number=1.1, + outer_enum=outer_enum + ) + self.assertEqual(deserialized['enum_test'], sample_instance) def test_deserialize_dict_str_pet(self): """ deserialize dict(str, Pet) """ @@ -239,3 +245,44 @@ def test_deserialize_none(self): deserialized = self.deserialize(response, "datetime") self.assertIsNone(deserialized) + + def test_deserialize_OuterEnum(self): + """ deserialize OuterEnum """ + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + self.deserialize( + MockResponse(data=json.dumps("test str")), + "OuterEnum" + ) + + # valid value works + placed_str = ( + petstore_api.OuterEnum.allowed_values[('value',)]["PLACED"] + ) + response = MockResponse(data=json.dumps(placed_str)) + outer_enum = self.deserialize(response, "OuterEnum") + self.assertTrue(isinstance(outer_enum, petstore_api.OuterEnum)) + self.assertTrue(outer_enum.value == placed_str) + + def test_deserialize_OuterNumber(self): + """ deserialize OuterNumber """ + # make sure that an exception is thrown on an invalid type value + with self.assertRaises(petstore_api.ApiValueError): + deserialized = self.deserialize( + MockResponse(data=json.dumps("test str")), + "OuterNumber" + ) + + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + deserialized = self.deserialize( + MockResponse(data=json.dumps(21)), + "OuterNumber" + ) + + # valid value works + number_val = 11 + response = MockResponse(data=json.dumps(number_val)) + outer_number = self.deserialize(response, "OuterNumber") + self.assertTrue(isinstance(outer_number, petstore_api.OuterNumber)) + self.assertTrue(outer_number.value == number_val) \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 4f38fbd6e176..f536f5ca288e 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -163,7 +163,8 @@ def test_async_with_result(self): def test_async_with_http_info(self): self.pet_api.add_pet(self.pet) - thread = self.pet_api.get_pet_by_id_with_http_info(self.pet.id, async_req=True) + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True, + _return_http_data_only=False) data, status, headers = thread.get() self.assertIsInstance(data, petstore_api.Pet) @@ -195,7 +196,10 @@ def test_add_pet_and_get_pet_by_id(self): def test_add_pet_and_get_pet_by_id_with_http_info(self): self.pet_api.add_pet(self.pet) - fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + fetched = self.pet_api.get_pet_by_id( + pet_id=self.pet.id, + _return_http_data_only=False + ) self.assertIsNotNone(fetched) self.assertEqual(self.pet.id, fetched[0].id) self.assertIsNotNone(fetched[0].category) diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.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/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index 27a0490dc04e..8534592c1506 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -14,7 +14,7 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index 3aa6aadb2b78..6ad90d76d774 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -764,3 +765,63 @@ No authorization required [[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) +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/python-tornado/docs/TypeHolderExample.md b/samples/client/petstore/python-tornado/docs/TypeHolderExample.md index d59718cdcb16..2a410ded8e35 100644 --- a/samples/client/petstore/python-tornado/docs/TypeHolderExample.md +++ b/samples/client/petstore/python-tornado/docs/TypeHolderExample.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **str** | | **number_item** | **float** | | +**float_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | **array_item** | **list[int]** | | diff --git a/samples/client/petstore/python-tornado/git_push.sh b/samples/client/petstore/python-tornado/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/python-tornado/git_push.sh +++ b/samples/client/petstore/python-tornado/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 1847804c552b..00333bfd2c47 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -1580,3 +1580,144 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'csv' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index fa0c3f4d320c..459ff6a3ca25 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -67,6 +67,9 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ self.username = username """Username for HTTP basic authentication """ @@ -227,11 +230,15 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py index 8f2b5d6b7d3b..745fe95da2c0 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_example.py @@ -33,6 +33,7 @@ class TypeHolderExample(object): openapi_types = { 'string_item': 'str', 'number_item': 'float', + 'float_item': 'float', 'integer_item': 'int', 'bool_item': 'bool', 'array_item': 'list[int]' @@ -41,16 +42,18 @@ class TypeHolderExample(object): attribute_map = { 'string_item': 'string_item', 'number_item': 'number_item', + 'float_item': 'float_item', 'integer_item': 'integer_item', 'bool_item': 'bool_item', 'array_item': 'array_item' } - def __init__(self, string_item=None, number_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 + def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 self._string_item = None self._number_item = None + self._float_item = None self._integer_item = None self._bool_item = None self._array_item = None @@ -58,6 +61,7 @@ def __init__(self, string_item=None, number_item=None, integer_item=None, bool_i self.string_item = string_item self.number_item = number_item + self.float_item = float_item self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item @@ -108,6 +112,29 @@ def number_item(self, number_item): self._number_item = number_item + @property + def float_item(self): + """Gets the float_item of this TypeHolderExample. # noqa: E501 + + + :return: The float_item of this TypeHolderExample. # noqa: E501 + :rtype: float + """ + return self._float_item + + @float_item.setter + def float_item(self, float_item): + """Sets the float_item of this TypeHolderExample. + + + :param float_item: The float_item of this TypeHolderExample. # noqa: E501 + :type: float + """ + if float_item is None: + raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 + + self._float_item = float_item + @property def integer_item(self): """Gets the integer_item of this TypeHolderExample. # noqa: E501 diff --git a/samples/client/petstore/python-tornado/setup.py b/samples/client/petstore/python-tornado/setup.py index 9b0a404aa02c..6ed0ebf50092 100644 --- a/samples/client/petstore/python-tornado/setup.py +++ b/samples/client/petstore/python-tornado/setup.py @@ -32,7 +32,7 @@ url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.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/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 27a0490dc04e..8534592c1506 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -14,7 +14,7 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 3aa6aadb2b78..6ad90d76d774 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -764,3 +765,63 @@ No authorization required [[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) +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/python/docs/TypeHolderExample.md b/samples/client/petstore/python/docs/TypeHolderExample.md index d59718cdcb16..2a410ded8e35 100644 --- a/samples/client/petstore/python/docs/TypeHolderExample.md +++ b/samples/client/petstore/python/docs/TypeHolderExample.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **str** | | **number_item** | **float** | | +**float_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | **array_item** | **list[int]** | | diff --git a/samples/client/petstore/python/git_push.sh b/samples/client/petstore/python/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/python/git_push.sh +++ b/samples/client/petstore/python/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 1847804c552b..00333bfd2c47 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1580,3 +1580,144 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'csv' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index fa0c3f4d320c..459ff6a3ca25 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -67,6 +67,9 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ self.username = username """Username for HTTP basic authentication """ @@ -227,11 +230,15 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_example.py b/samples/client/petstore/python/petstore_api/models/type_holder_example.py index 8f2b5d6b7d3b..745fe95da2c0 100644 --- a/samples/client/petstore/python/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python/petstore_api/models/type_holder_example.py @@ -33,6 +33,7 @@ class TypeHolderExample(object): openapi_types = { 'string_item': 'str', 'number_item': 'float', + 'float_item': 'float', 'integer_item': 'int', 'bool_item': 'bool', 'array_item': 'list[int]' @@ -41,16 +42,18 @@ class TypeHolderExample(object): attribute_map = { 'string_item': 'string_item', 'number_item': 'number_item', + 'float_item': 'float_item', 'integer_item': 'integer_item', 'bool_item': 'bool_item', 'array_item': 'array_item' } - def __init__(self, string_item=None, number_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 + def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 self._string_item = None self._number_item = None + self._float_item = None self._integer_item = None self._bool_item = None self._array_item = None @@ -58,6 +61,7 @@ def __init__(self, string_item=None, number_item=None, integer_item=None, bool_i self.string_item = string_item self.number_item = number_item + self.float_item = float_item self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item @@ -108,6 +112,29 @@ def number_item(self, number_item): self._number_item = number_item + @property + def float_item(self): + """Gets the float_item of this TypeHolderExample. # noqa: E501 + + + :return: The float_item of this TypeHolderExample. # noqa: E501 + :rtype: float + """ + return self._float_item + + @float_item.setter + def float_item(self, float_item): + """Sets the float_item of this TypeHolderExample. + + + :param float_item: The float_item of this TypeHolderExample. # noqa: E501 + :type: float + """ + if float_item is None: + raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 + + self._float_item = float_item + @property def integer_item(self): """Gets the integer_item of this TypeHolderExample. # noqa: E501 diff --git a/samples/client/petstore/python/setup.py b/samples/client/petstore/python/setup.py index 86988b6d42e0..1d5e7c2915ef 100644 --- a/samples/client/petstore/python/setup.py +++ b/samples/client/petstore/python/setup.py @@ -31,7 +31,7 @@ url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 83a328a9227e..2f81801b7943 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index e7b6b2ae4023..c3cbbb05666f 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 227bb2bf7888..57ea6d6d106e 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 52e3ec872474..8069935b8163 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 36e3ce59b859..bd412b537593 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 72d18ee7ae0f..b6a04048e7ef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end @@ -985,5 +985,92 @@ def test_json_form_data_with_http_info(param, param2, opts = {}) end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + if @api_client.config.client_side_validation && context.nil? + fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" + end + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end 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 689a1beaebd1..8b025d270a45 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 65039a8af5dc..dfe49165feef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 654e9d9fffdc..730420b65476 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 e0a28bbcdae3..8ed6369f5cac 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 bbb51dccb81c..7fa2f67e2f44 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,15 +6,15 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end require 'date' -require 'faraday' require 'json' require 'logger' require 'tempfile' +require 'faraday' module Petstore class ApiClient @@ -46,37 +46,46 @@ def self.default # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) - connection = Faraday.new(:url => config.base_url) do |conn| + ssl_options = { + :ca_file => @config.ssl_ca_file, + :verify => @config.ssl_verify, + :verify_mode => @config.ssl_verify_mode, + :client_cert => @config.ssl_client_cert, + :client_key => @config.ssl_client_key + } + + connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| conn.basic_auth(config.username, config.password) if opts[:header_params]["Content-Type"] == "multipart/form-data" - conn.request :multipart - conn.request :url_encoded + conn.request :multipart + conn.request :url_encoded end conn.adapter(Faraday.default_adapter) end + begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end - unless response.success? - if response.status == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => response.body), - response.reason_phrase - end + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase end + end rescue Faraday::TimeoutError - fail ApiError.new('Connection timed out') + fail ApiError.new('Connection timed out') end if opts[:return_type] @@ -106,25 +115,15 @@ def build_request(http_method, path, request, opts = {}) update_params_for_auth! header_params, query_params, opts[:auth_names] - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - req_opts = { :method => http_method, :headers => header_params, :params => query_params, :params_encoding => @config.params_encoding, :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, :verbose => @config.debugging } - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) req_opts.update :body => req_body @@ -134,12 +133,44 @@ def build_request(http_method, path, request, opts = {}) end request.headers = header_params request.body = req_body - request.url path + request.url url request.params = query_params download_file(request) if opts[:return_type] == 'File' request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -277,36 +308,6 @@ def build_request_url(path) @config.base_url + path end - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - data[key] = Faraday::UploadIO.new(value.path, '') - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - # Update hearder and query params based on authentication settings. # # @param [Hash] header_params Header parameters 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 9eab46a89b75..06edcc78dc7e 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 9fdb8b0e37fa..ae43bd936d20 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end @@ -86,33 +86,28 @@ class Configuration # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # # @return [true, false] - attr_accessor :verify_ssl + attr_accessor :ssl_verify ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) # # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # - # @return [true, false] - attr_accessor :verify_ssl_host + attr_accessor :ssl_verify_mode ### TLS/SSL setting # Set this to customize the certificate file to verify the peer. # # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert + attr_accessor :ssl_ca_file ### TLS/SSL setting # Client certificate file (for client certificate) - attr_accessor :cert_file + attr_accessor :ssl_client_cert ### TLS/SSL setting # Client private key file (for client certificate) - attr_accessor :key_file + attr_accessor :ssl_client_key # Set this to customize parameters encoding of array parameter with multi collectionFormat. # Default to nil. @@ -133,11 +128,11 @@ def initialize @api_key_prefix = {} @timeout = 0 @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil @debugging = false @inject_format = false @force_ending_format = false 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 d2af1ba5b32e..ceed16a9a1c0 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 621e290e1577..59a3fc670ca2 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 787951bf683a..f4922760aeaa 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 27f9768fb8da..4655656e140a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 5ed4bd9381ec..aa371aac26ad 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 3499c090be6d..72bf988f7f91 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 fd957eb08f7d..d7db986a2148 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 ca5e53859526..948fe37e8e79 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 396199ca4114..4bb43b9b3f2b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 998250d20ae6..b97381b8f3c7 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 99aa9482fa3d..6524faab1bb1 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 e7da1699d459..2cb6117756c3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 121bff2f0229..6e8b6c9c4155 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 02567bdfd45b..9e0b353acb07 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 51ab33355e3a..0e371fdab380 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 a971e6f55668..220f108d8cca 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 344ca690654d..8089f254d4f4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 01b2b965d608..8aa5d5272f21 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 830ab1d0f003..e70206c160d3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 07c31216bc38..19203ab642c8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 18cf61977204..e96ac0158024 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 1f12cb43b9c0..5b565597132f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 406b0dccc950..e105ff447a8a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 0a2b987f345e..e9ce2639769f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 459e4deba8f0..6bce09460dc4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 c01bb104a3e8..7bb95e34fd20 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 4638d9f36e14..001e61e5181d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 6d24ac174c59..e916d10b16ce 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 ab8318101b5b..db861f23f77d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 68509874a7d8..c8465b1823cf 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 f82bdde77211..7e5ed178810a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 d87939a4b8a7..552de582c698 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 32b75d1f0884..3aaa464c8e37 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 665fc3527641..302506441838 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 8b6da24af4b9..553ca99beb38 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 bcfc925dbf3f..c790d7027027 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 1cfbf6659a7e..dd05f8ade309 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 c7d622d97034..d24a7b353ffe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =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 20a476bbe9fb..59cbcadc5a6a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 012f382be799..beccaccac432 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 b2bc0dc84a62..f16178a214c2 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 6d79193b09a2..700c27baf17d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 362ceff7a85f..4bf05bbf54c5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 63390983f381..2e541c9761ce 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 5b97445cc166..be6a8e9350a4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end 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 9c26309da199..2894babc25cb 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 296454458383..37b31e0899a0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 6cbf88ba127b..348b1213f447 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end @@ -31,8 +31,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 83a328a9227e..0e97bd19efbf 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index e7b6b2ae4023..c3cbbb05666f 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 227bb2bf7888..57ea6d6d106e 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/client/petstore/ruby/docs/TypeHolderExample.md b/samples/client/petstore/ruby/docs/TypeHolderExample.md index 92dfed0300c1..2cab99f9bb7f 100644 --- a/samples/client/petstore/ruby/docs/TypeHolderExample.md +++ b/samples/client/petstore/ruby/docs/TypeHolderExample.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **String** | | **number_item** | **Float** | | +**float_item** | **Float** | | **integer_item** | **Integer** | | **bool_item** | **Boolean** | | **array_item** | **Array<Integer>** | | @@ -17,6 +18,7 @@ require 'Petstore' instance = Petstore::TypeHolderExample.new(string_item: what, number_item: 1.234, + float_item: 1.234, integer_item: -2, bool_item: true, array_item: [0, 1, 2, 3]) diff --git a/samples/client/petstore/ruby/git_push.sh b/samples/client/petstore/ruby/git_push.sh index b9fd6af8e051..ced3be2b0c7b 100644 --- a/samples/client/petstore/ruby/git_push.sh +++ b/samples/client/petstore/ruby/git_push.sh @@ -1,14 +1,17 @@ #!/bin/sh -# -# Generated by: https://openapi-generator.tech -# # 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" +# 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" @@ -40,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -50,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 52e3ec872474..fc841ebd8a97 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 36e3ce59b859..b09ab00f6795 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 72d18ee7ae0f..8f7549c6fdbe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -985,5 +985,92 @@ def test_json_form_data_with_http_info(param, param2, opts = {}) end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + if @api_client.config.client_side_validation && context.nil? + fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" + end + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end 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 689a1beaebd1..a5fabf4888c3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 65039a8af5dc..466b005560bd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 654e9d9fffdc..da6b391cc211 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 e0a28bbcdae3..646664654678 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 4fabf29ba2c9..96c12cd174ff 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -127,6 +127,34 @@ def build_request(http_method, path, opts = {}) request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -264,34 +292,6 @@ def build_request_url(path) @config.base_url + path end - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - # Update hearder and query params based on authentication settings. # # @param [Hash] header_params Header parameters diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index 9eab46a89b75..c2e09163dbc2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 9fdb8b0e37fa..29a0f5031517 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d2af1ba5b32e..403b46ac8d47 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 621e290e1577..d9b35a23809b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 787951bf683a..3d8755837932 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 27f9768fb8da..30dbe200f1c3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 5ed4bd9381ec..c9d5f0e72463 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 3499c090be6d..d9d424e885a3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 fd957eb08f7d..1637a109ff8e 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 ca5e53859526..11521db572c9 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 396199ca4114..22534037326f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 998250d20ae6..4bf1337db684 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 99aa9482fa3d..b68b58e37186 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e7da1699d459..b93d130d6115 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 121bff2f0229..5bda94e622c3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 02567bdfd45b..c12b2df1c0d6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 51ab33355e3a..3283edc0eb74 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 a971e6f55668..c01bcaedd975 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 344ca690654d..3de255654fdd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 01b2b965d608..68d71b58cfe3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 830ab1d0f003..f1c127a08020 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 07c31216bc38..3b4e93d3fd9c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 18cf61977204..0bdb0add469b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 1f12cb43b9c0..1c1907d66828 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 406b0dccc950..9e5a749ea54f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 0a2b987f345e..a6a86e7cc045 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index 459e4deba8f0..6506ed2ccd5f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 c01bb104a3e8..73996f6e7a78 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 4638d9f36e14..5631120b3d14 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6d24ac174c59..aab0c27981ad 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index ab8318101b5b..4ff3f5da2c2f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 68509874a7d8..63d962f4deb4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 f82bdde77211..bc1499d8316c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 d87939a4b8a7..63e5d01953b5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 32b75d1f0884..0c0bc807ef62 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 665fc3527641..ced17285d4ec 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 8b6da24af4b9..3d202af689a5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index bcfc925dbf3f..a7e2c5f020ef 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 1cfbf6659a7e..45a492d7a8fe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 c7d622d97034..f768bab749fc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 20a476bbe9fb..9bb303c380b3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 012f382be799..a22c48abf415 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 b2bc0dc84a62..49d28691de5d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 6d79193b09a2..0865fc01b416 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 362ceff7a85f..7a7161927e30 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 63390983f381..c2b2c945d14c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -18,6 +18,8 @@ class TypeHolderExample attr_accessor :number_item + attr_accessor :float_item + attr_accessor :integer_item attr_accessor :bool_item @@ -29,6 +31,7 @@ def self.attribute_map { :'string_item' => :'string_item', :'number_item' => :'number_item', + :'float_item' => :'float_item', :'integer_item' => :'integer_item', :'bool_item' => :'bool_item', :'array_item' => :'array_item' @@ -40,6 +43,7 @@ def self.openapi_types { :'string_item' => :'String', :'number_item' => :'Float', + :'float_item' => :'Float', :'integer_item' => :'Integer', :'bool_item' => :'Boolean', :'array_item' => :'Array' @@ -69,6 +73,10 @@ def initialize(attributes = {}) self.number_item = attributes[:'number_item'] end + if attributes.key?(:'float_item') + self.float_item = attributes[:'float_item'] + end + if attributes.key?(:'integer_item') self.integer_item = attributes[:'integer_item'] end @@ -96,6 +104,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') end + if @float_item.nil? + invalid_properties.push('invalid value for "float_item", float_item cannot be nil.') + end + if @integer_item.nil? invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') end @@ -116,6 +128,7 @@ def list_invalid_properties def valid? return false if @string_item.nil? return false if @number_item.nil? + return false if @float_item.nil? return false if @integer_item.nil? return false if @bool_item.nil? return false if @array_item.nil? @@ -129,6 +142,7 @@ def ==(o) self.class == o.class && string_item == o.string_item && number_item == o.number_item && + float_item == o.float_item && integer_item == o.integer_item && bool_item == o.bool_item && array_item == o.array_item @@ -143,7 +157,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [string_item, number_item, integer_item, bool_item, array_item].hash + [string_item, number_item, float_item, integer_item, bool_item, array_item].hash end # Builds the object from hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 5b97445cc166..144f13bd6fdd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 9c26309da199..b1cb3d039c26 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index 296454458383..1413eb856a6c 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 167ff9a753ed..db2acf77d2df 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -31,12 +31,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' - s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' - s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") 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 6e202fb43d01..010f6a9d2982 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ac6be349ff98..7274fbf1639d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -206,4 +206,19 @@ end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + 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 7080b34d9f86..4ec82d7d8a01 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 efd0fc640e57..fa122fb777fa 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 7dd515a5f304..cc7ff08491dd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 eb3fc6362505..5000c2856076 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 274d78c14cc1..aea4c5f46c9d 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index 08263fa509b3..f26dd5d9ea20 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 846f3dec887f..08020d33f8a5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ef280e7316e6..dc6fd5efd138 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c56d64e4188d..0fc72b039e71 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 864bf2d883e8..9f02de5e8378 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 78868109a69d..7b41f50034cc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9a33ded47a60..a1ed8d033e29 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c9182ce6646c..047b92b9d8e0 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b2c5288ec484..31504659528f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/animal_spec.rb b/samples/client/petstore/ruby/spec/models/animal_spec.rb index 08155ef39497..6689296c03c8 100644 --- a/samples/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby/spec/models/animal_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 991bb81df729..7788def0381a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 372539c55cb6..e0af34704312 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 759a272f6860..8c3c137d6711 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c3819c9a9f67..046dfd0b6fef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby/spec/models/capitalization_spec.rb index 98059918537a..79bdc3700e0a 100644 --- a/samples/client/petstore/ruby/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby/spec/models/capitalization_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 49859a0524f3..55be1ba89dc7 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/cat_spec.rb b/samples/client/petstore/ruby/spec/models/cat_spec.rb index 0ee7d2a7f68b..3a549f61b0ae 100644 --- a/samples/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby/spec/models/cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/category_spec.rb b/samples/client/petstore/ruby/spec/models/category_spec.rb index 1f9f8897fded..92815daf8713 100644 --- a/samples/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby/spec/models/category_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 589f3d1f1211..1348f4108d9c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/client_spec.rb b/samples/client/petstore/ruby/spec/models/client_spec.rb index b246962e2ba3..d9f698219f01 100644 --- a/samples/client/petstore/ruby/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby/spec/models/client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6cba24ecd94c..797e3ac4190d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/dog_spec.rb b/samples/client/petstore/ruby/spec/models/dog_spec.rb index d13a68644972..b5974e6bc280 100644 --- a/samples/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby/spec/models/dog_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 993d8f3a3eea..d8b99761ca2a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 50c56e53df85..ac9f99d1d881 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b66e5d730f68..eab1cf34db8c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c59870f674f3..ce16c64d96fe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/file_spec.rb b/samples/client/petstore/ruby/spec/models/file_spec.rb index 38513a9593e1..9ea07d98919b 100644 --- a/samples/client/petstore/ruby/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby/spec/models/file_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 3ce512bc7880..46f91bfa83bb 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f1e7908be13e..f74766f78385 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/list_spec.rb b/samples/client/petstore/ruby/spec/models/list_spec.rb index 305f503079d7..85af1ebc1b83 100644 --- a/samples/client/petstore/ruby/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby/spec/models/list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6be8c3aff536..db8bcc93c75c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d9070acf516d..f85e4fc0ab35 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6502d960cb83..48514051cedf 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 e4fc442810c0..4686c6e58cb5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/name_spec.rb b/samples/client/petstore/ruby/spec/models/name_spec.rb index 362d499d1257..acb40b437610 100644 --- a/samples/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby/spec/models/name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 440a2d377d77..622474911e8c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/order_spec.rb b/samples/client/petstore/ruby/spec/models/order_spec.rb index 45788b835ab1..b9207c7f8265 100644 --- a/samples/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby/spec/models/order_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a7c25a114ccb..5e2770aa81b5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f6de5c89911e..76b297bb92f9 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/pet_spec.rb b/samples/client/petstore/ruby/spec/models/pet_spec.rb index b0c7076815bf..05d663984167 100644 --- a/samples/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/models/pet_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d8a42302760d..8c9dc8faa6e8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 43eb2ec61ec1..c37ebaff67c8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/models/tag_spec.rb b/samples/client/petstore/ruby/spec/models/tag_spec.rb index abb8380ff3a9..8cd9c57394ee 100644 --- a/samples/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby/spec/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 3cee11d7ba02..ff2125690229 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 0edc334dd65b..9cd3cbe37e87 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -44,6 +44,12 @@ end end + describe 'test attribute "float_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "integer_item"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/samples/client/petstore/ruby/spec/models/user_spec.rb b/samples/client/petstore/ruby/spec/models/user_spec.rb index d313a360bbb0..685280b7adc0 100644 --- a/samples/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby/spec/models/user_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c7d06a3580ef..34d7837b2fb3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index dc8611b437da..9d2f01c329f9 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/client/petstore/rust-reqwest/.openapi-generator/VERSION.orig b/samples/client/petstore/rust-reqwest/.openapi-generator/VERSION.orig deleted file mode 100644 index 479c313e87b9..000000000000 --- a/samples/client/petstore/rust-reqwest/.openapi-generator/VERSION.orig +++ /dev/null @@ -1 +0,0 @@ -4.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust-reqwest/src/apis/client.rs.orig b/samples/client/petstore/rust-reqwest/src/apis/client.rs.orig deleted file mode 100644 index f2319088324c..000000000000 --- a/samples/client/petstore/rust-reqwest/src/apis/client.rs.orig +++ /dev/null @@ -1,34 +0,0 @@ -use std::rc::Rc; - -use super::configuration::Configuration; - -pub struct APIClient { - pet_api: Box, - store_api: Box, - user_api: Box, -} - -impl APIClient { - pub fn new(configuration: Configuration) -> APIClient { - let rc = Rc::new(configuration); - - APIClient { - pet_api: Box::new(crate::apis::PetApiClient::new(rc.clone())), - store_api: Box::new(crate::apis::StoreApiClient::new(rc.clone())), - user_api: Box::new(crate::apis::UserApiClient::new(rc.clone())), - } - } - - pub fn pet_api(&self) -> &crate::apis::PetApi{ - self.pet_api.as_ref() - } - - pub fn store_api(&self) -> &crate::apis::StoreApi{ - self.store_api.as_ref() - } - - pub fn user_api(&self) -> &crate::apis::UserApi{ - self.user_api.as_ref() - } - -} diff --git a/samples/client/petstore/rust/.gitignore b/samples/client/petstore/rust/.gitignore index 6aa106405a4b..a9d37c560c6a 100644 --- a/samples/client/petstore/rust/.gitignore +++ b/samples/client/petstore/rust/.gitignore @@ -1,3 +1,2 @@ -/target/ -**/*.rs.bk +target Cargo.lock diff --git a/samples/client/petstore/rust/.openapi-generator/VERSION.orig b/samples/client/petstore/rust/.openapi-generator/VERSION.orig deleted file mode 100644 index 479c313e87b9..000000000000 --- a/samples/client/petstore/rust/.openapi-generator/VERSION.orig +++ /dev/null @@ -1 +0,0 @@ -4.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/Cargo.toml b/samples/client/petstore/rust/Cargo.toml index 2ccdd989058e..46b06cf9bbe3 100644 --- a/samples/client/petstore/rust/Cargo.toml +++ b/samples/client/petstore/rust/Cargo.toml @@ -1,17 +1,2 @@ -[package] -name = "petstore_client" -version = "1.0.0" -authors = ["OpenAPI Generator team and contributors"] - -[dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_json = "^1.0" -url = "1.5" -hyper = "~0.11" -serde_yaml = "0.7" -base64 = "~0.7.0" -futures = "0.1.23" - -[dev-dependencies] -tokio-core = "*" +[workspace] +members = ["hyper/*", "reqwest/*"] diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/Tag.md b/samples/client/petstore/rust/docs/InlineObject.md similarity index 57% rename from samples/client/petstore/dart2/openapi-browser-client/docs/Tag.md rename to samples/client/petstore/rust/docs/InlineObject.md index ded7b32ac3d7..bfe33a4efb36 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/Tag.md +++ b/samples/client/petstore/rust/docs/InlineObject.md @@ -1,15 +1,11 @@ -# openapi.model.Tag - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` +# InlineObject ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Tag.md b/samples/client/petstore/rust/docs/InlineObject1.md similarity index 57% rename from samples/client/petstore/dart2/flutter_petstore/openapi/docs/Tag.md rename to samples/client/petstore/rust/docs/InlineObject1.md index ded7b32ac3d7..930d10cdcbf3 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/Tag.md +++ b/samples/client/petstore/rust/docs/InlineObject1.md @@ -1,15 +1,11 @@ -# openapi.model.Tag - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` +# InlineObject1 ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**file** | [***std::path::PathBuf**](std::path::PathBuf.md) | file to upload | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust-reqwest/.gitignore b/samples/client/petstore/rust/hyper/fileResponseTest/.gitignore similarity index 100% rename from samples/client/petstore/rust-reqwest/.gitignore rename to samples/client/petstore/rust/hyper/fileResponseTest/.gitignore diff --git a/samples/client/petstore/rust-reqwest/.openapi-generator-ignore b/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/rust-reqwest/.openapi-generator-ignore rename to samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator-ignore diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION rename to samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION diff --git a/samples/client/petstore/rust-reqwest/.travis.yml b/samples/client/petstore/rust/hyper/fileResponseTest/.travis.yml similarity index 100% rename from samples/client/petstore/rust-reqwest/.travis.yml rename to samples/client/petstore/rust/hyper/fileResponseTest/.travis.yml diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/Cargo.toml b/samples/client/petstore/rust/hyper/fileResponseTest/Cargo.toml new file mode 100644 index 000000000000..f78404453cf9 --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "fileResponseTest-hyper" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "1.5" +hyper = "~0.11" +serde_yaml = "0.7" +base64 = "~0.7.0" +futures = "0.1.23" + +[dev-dependencies] +tokio-core = "*" diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/README.md b/samples/client/petstore/rust/hyper/fileResponseTest/README.md new file mode 100644 index 000000000000..1cb8e0b83f17 --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/README.md @@ -0,0 +1,43 @@ +# Rust API client for fileResponseTest-hyper + +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://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RustClientCodegen + +## Installation + +Put the package under your project folder and add the following to `Cargo.toml` under `[dependencies]`: + +``` + openapi = { path = "./generated" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**fileresponsetest**](docs/DefaultApi.md#fileresponsetest) | **Get** /tests/fileResponse | + + +## Documentation For Models + + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/docs/DefaultApi.md b/samples/client/petstore/rust/hyper/fileResponseTest/docs/DefaultApi.md new file mode 100644 index 000000000000..6e8157cf0e54 --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://localhost/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fileresponsetest**](DefaultApi.md#fileresponsetest) | **Get** /tests/fileResponse | + + + +## fileresponsetest + +> std::path::PathBuf fileresponsetest() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + +[[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) + diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/git_push.sh b/samples/client/petstore/rust/hyper/fileResponseTest/git_push.sh similarity index 100% rename from samples/client/petstore/dart2/flutter_petstore/openapi/git_push.sh rename to samples/client/petstore/rust/hyper/fileResponseTest/git_push.sh diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/client.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/client.rs new file mode 100644 index 000000000000..6105ed87f9db --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/client.rs @@ -0,0 +1,23 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { + default_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient { + let rc = Rc::new(configuration); + + APIClient { + default_api: Box::new(crate::apis::DefaultApiClient::new(rc.clone())), + } + } + + pub fn default_api(&self) -> &crate::apis::DefaultApi{ + self.default_api.as_ref() + } + +} diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/configuration.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/configuration.rs new file mode 100644 index 000000000000..6a3d69dddd61 --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/configuration.rs @@ -0,0 +1,41 @@ +/* + * File Response Test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use hyper; + +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "http://localhost/v2".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client: client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/default_api.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/default_api.rs new file mode 100644 index 000000000000..d5440cb4df04 --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/default_api.rs @@ -0,0 +1,44 @@ +/* + * File Response Test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; + +use hyper; +use serde_json; +use futures::Future; + +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct DefaultApiClient { + configuration: Rc>, +} + +impl DefaultApiClient { + pub fn new(configuration: Rc>) -> DefaultApiClient { + DefaultApiClient { + configuration: configuration, + } + } +} + +pub trait DefaultApi { + fn fileresponsetest(&self, ) -> Box>>; +} + + +implDefaultApi for DefaultApiClient { + fn fileresponsetest(&self, ) -> Box>> { + __internal_request::Request::new(hyper::Method::Get, "/tests/fileResponse".to_string()) + .execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/mod.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/mod.rs new file mode 100644 index 000000000000..cb13d23efc24 --- /dev/null +++ b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/mod.rs @@ -0,0 +1,58 @@ +use hyper; +use serde; +use serde_json; + +#[derive(Debug)] +pub enum Error { + UriError(hyper::error::UriError), + Hyper(hyper::Error), + Serde(serde_json::Error), + ApiError(ApiError), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub content: Option, +} + +impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error + where T: serde::Deserialize<'de> { + fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { + if e.1.len() == 0 { + return Error::ApiError(ApiError{ + code: e.0, + content: None, + }); + } + match serde_json::from_slice::(e.1) { + Ok(t) => Error::ApiError(ApiError{ + code: e.0, + content: Some(t), + }), + Err(e) => { + Error::from(e) + } + } + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + return Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + return Error::Serde(e) + } +} + +mod request; + +mod default_api; +pub use self::default_api::{ DefaultApi, DefaultApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/petstore/rust/src/apis/request.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/apis/request.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/request.rs rename to samples/client/petstore/rust/hyper/fileResponseTest/src/apis/request.rs diff --git a/samples/client/petstore/rust/src/lib.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/lib.rs similarity index 100% rename from samples/client/petstore/rust/src/lib.rs rename to samples/client/petstore/rust/hyper/fileResponseTest/src/lib.rs diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/src/models/mod.rs b/samples/client/petstore/rust/hyper/fileResponseTest/src/models/mod.rs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/client/petstore/rust/hyper/petstore/.gitignore b/samples/client/petstore/rust/hyper/petstore/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/.openapi-generator-ignore b/samples/client/petstore/rust/hyper/petstore/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/rust/.openapi-generator-ignore rename to samples/client/petstore/rust/hyper/petstore/.openapi-generator-ignore diff --git a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION rename to samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION diff --git a/samples/client/petstore/rust/.travis.yml b/samples/client/petstore/rust/hyper/petstore/.travis.yml similarity index 100% rename from samples/client/petstore/rust/.travis.yml rename to samples/client/petstore/rust/hyper/petstore/.travis.yml diff --git a/samples/client/petstore/rust/hyper/petstore/Cargo.toml b/samples/client/petstore/rust/hyper/petstore/Cargo.toml new file mode 100644 index 000000000000..67fc43707a92 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "petstore-hyper" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "1.5" +hyper = "~0.11" +serde_yaml = "0.7" +base64 = "~0.7.0" +futures = "0.1.23" + +[dev-dependencies] +tokio-core = "*" diff --git a/samples/client/petstore/rust/README.md b/samples/client/petstore/rust/hyper/petstore/README.md similarity index 98% rename from samples/client/petstore/rust/README.md rename to samples/client/petstore/rust/hyper/petstore/README.md index a1149b09036b..83a8b77584eb 100644 --- a/samples/client/petstore/rust/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -1,4 +1,4 @@ -# Rust API client for petstore_client +# Rust API client for petstore-hyper This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/rust-reqwest/docs/ApiResponse.md b/samples/client/petstore/rust/hyper/petstore/docs/ApiResponse.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/ApiResponse.md rename to samples/client/petstore/rust/hyper/petstore/docs/ApiResponse.md diff --git a/samples/client/petstore/rust-reqwest/docs/Category.md b/samples/client/petstore/rust/hyper/petstore/docs/Category.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/Category.md rename to samples/client/petstore/rust/hyper/petstore/docs/Category.md diff --git a/samples/client/petstore/rust-reqwest/docs/Order.md b/samples/client/petstore/rust/hyper/petstore/docs/Order.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/Order.md rename to samples/client/petstore/rust/hyper/petstore/docs/Order.md diff --git a/samples/client/petstore/rust-reqwest/docs/Pet.md b/samples/client/petstore/rust/hyper/petstore/docs/Pet.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/Pet.md rename to samples/client/petstore/rust/hyper/petstore/docs/Pet.md diff --git a/samples/client/petstore/rust/docs/PetApi.md b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md similarity index 100% rename from samples/client/petstore/rust/docs/PetApi.md rename to samples/client/petstore/rust/hyper/petstore/docs/PetApi.md diff --git a/samples/client/petstore/rust/docs/StoreApi.md b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md similarity index 100% rename from samples/client/petstore/rust/docs/StoreApi.md rename to samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md diff --git a/samples/client/petstore/rust-reqwest/docs/Tag.md b/samples/client/petstore/rust/hyper/petstore/docs/Tag.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/Tag.md rename to samples/client/petstore/rust/hyper/petstore/docs/Tag.md diff --git a/samples/client/petstore/rust-reqwest/docs/User.md b/samples/client/petstore/rust/hyper/petstore/docs/User.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/User.md rename to samples/client/petstore/rust/hyper/petstore/docs/User.md diff --git a/samples/client/petstore/rust/docs/UserApi.md b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md similarity index 100% rename from samples/client/petstore/rust/docs/UserApi.md rename to samples/client/petstore/rust/hyper/petstore/docs/UserApi.md diff --git a/samples/client/petstore/dart2/openapi-browser-client/git_push.sh b/samples/client/petstore/rust/hyper/petstore/git_push.sh similarity index 100% rename from samples/client/petstore/dart2/openapi-browser-client/git_push.sh rename to samples/client/petstore/rust/hyper/petstore/git_push.sh diff --git a/samples/client/petstore/rust/src/apis/client.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/client.rs rename to samples/client/petstore/rust/hyper/petstore/src/apis/client.rs diff --git a/samples/client/petstore/rust/src/apis/configuration.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/configuration.rs rename to samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs diff --git a/samples/client/petstore/rust/src/apis/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/mod.rs rename to samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs diff --git a/samples/client/petstore/rust/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/pet_api.rs rename to samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs new file mode 100644 index 000000000000..2d5c7eb5a64d --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs @@ -0,0 +1,239 @@ +use std::borrow::Cow; +use std::collections::HashMap; + +use super::{configuration, Error}; +use futures; +use futures::{Future, Stream}; +use hyper; +use hyper::header::UserAgent; +use serde; +use serde_json; + +pub(crate) struct ApiKey { + pub in_header: bool, + pub in_query: bool, + pub param_name: String, +} + +impl ApiKey { + fn key(&self, prefix: &Option, key: &str) -> String { + match prefix { + None => key.to_owned(), + Some(ref prefix) => format!("{} {}", prefix, key), + } + } +} + +#[allow(dead_code)] +pub(crate) enum Auth { + None, + ApiKey(ApiKey), + Basic, + Oauth, +} + +pub(crate) struct Request { + auth: Auth, + method: hyper::Method, + path: String, + query_params: HashMap, + no_return_type: bool, + path_params: HashMap, + form_params: HashMap, + header_params: HashMap, + // TODO: multiple body params are possible technically, but not supported here. + serialized_body: Option, +} + +impl Request { + pub fn new(method: hyper::Method, path: String) -> Self { + Request { + auth: Auth::None, + method: method, + path: path, + query_params: HashMap::new(), + path_params: HashMap::new(), + form_params: HashMap::new(), + header_params: HashMap::new(), + serialized_body: None, + no_return_type: false, + } + } + + pub fn with_body_param(mut self, param: T) -> Self { + self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); + self + } + + pub fn with_header_param(mut self, basename: String, param: String) -> Self { + self.header_params.insert(basename, param); + self + } + + pub fn with_query_param(mut self, basename: String, param: String) -> Self { + self.query_params.insert(basename, param); + self + } + + pub fn with_path_param(mut self, basename: String, param: String) -> Self { + self.path_params.insert(basename, param); + self + } + + pub fn with_form_param(mut self, basename: String, param: String) -> Self { + self.form_params.insert(basename, param); + self + } + + pub fn returns_nothing(mut self) -> Self { + self.no_return_type = true; + self + } + + pub fn with_auth(mut self, auth: Auth) -> Self { + self.auth = auth; + self + } + + pub fn execute<'a, C, U>( + self, + conf: &configuration::Configuration, + ) -> Box> + 'a> + where + C: hyper::client::Connect, + U: Sized + 'a, + for<'de> U: serde::Deserialize<'de>, + { + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); + // raw_headers is for headers we don't know the proper type of (e.g. custom api key + // headers); headers is for ones we do know the type of. + let mut raw_headers = HashMap::new(); + let mut headers: hyper::header::Headers = hyper::header::Headers::new(); + + let mut path = self.path; + for (k, v) in self.path_params { + // replace {id} with the value of the id path param + path = path.replace(&format!("{{{}}}", k), &v); + } + + for (k, v) in self.header_params { + raw_headers.insert(k, v); + } + + for (key, val) in self.query_params { + query_string.append_pair(&key, &val); + } + + match self.auth { + Auth::ApiKey(apikey) => { + if let Some(ref key) = conf.api_key { + let val = apikey.key(&key.prefix, &key.key); + if apikey.in_query { + query_string.append_pair(&apikey.param_name, &val); + } + if apikey.in_header { + raw_headers.insert(apikey.param_name, val); + } + } + } + Auth::Basic => { + if let Some(ref auth_conf) = conf.basic_auth { + let auth = hyper::header::Authorization(hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + }); + headers.set(auth); + } + } + Auth::Oauth => { + if let Some(ref token) = conf.oauth_access_token { + let auth = hyper::header::Authorization(hyper::header::Bearer { + token: token.to_owned(), + }); + headers.set(auth); + } + } + Auth::None => {} + } + + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if query_string_str != "" { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => { + return Box::new(futures::future::err(Error::UriError(e))); + } + Ok(u) => u, + }; + + let mut req = hyper::Request::new(self.method, uri); + { + let req_headers = req.headers_mut(); + if let Some(ref user_agent) = conf.user_agent { + req_headers.set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + req_headers.extend(headers.iter()); + + for (key, val) in raw_headers { + req_headers.set_raw(key, val); + } + } + + if self.form_params.len() > 0 { + req.headers_mut().set(hyper::header::ContentType::form_url_encoded()); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); + for (k, v) in self.form_params { + enc.append_pair(&k, &v); + } + req.set_body(enc.finish()); + } + + if let Some(body) = self.serialized_body { + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut() + .set(hyper::header::ContentLength(body.len() as u64)); + req.set_body(body); + } + + let no_ret_type = self.no_return_type; + let res = conf.client + .request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body() + .concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }); + Box::new( + res + .and_then(move |body| { + let parsed: Result = if no_ret_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + serde_json::from_str("null") + } else { + serde_json::from_slice(&body) + }; + parsed.map_err(|e| Error::from(e)) + }) + ) + } +} diff --git a/samples/client/petstore/rust/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/store_api.rs rename to samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs diff --git a/samples/client/petstore/rust/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs similarity index 100% rename from samples/client/petstore/rust/src/apis/user_api.rs rename to samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs diff --git a/samples/client/petstore/rust/hyper/petstore/src/lib.rs b/samples/client/petstore/rust/hyper/petstore/src/lib.rs new file mode 100644 index 000000000000..a76d822525da --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/lib.rs @@ -0,0 +1,11 @@ +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate hyper; +extern crate futures; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust-reqwest/src/models/api_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/api_response.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs diff --git a/samples/client/petstore/rust-reqwest/src/models/category.rs b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/category.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/category.rs diff --git a/samples/client/petstore/rust-reqwest/src/models/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/mod.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/mod.rs diff --git a/samples/client/petstore/rust-reqwest/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/order.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/order.rs diff --git a/samples/client/petstore/rust-reqwest/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/pet.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/pet.rs diff --git a/samples/client/petstore/rust-reqwest/src/models/tag.rs b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/tag.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/tag.rs diff --git a/samples/client/petstore/rust-reqwest/src/models/user.rs b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/models/user.rs rename to samples/client/petstore/rust/hyper/petstore/src/models/user.rs diff --git a/samples/client/petstore/rust/hyper/rust-test/.gitignore b/samples/client/petstore/rust/hyper/rust-test/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/hyper/rust-test/.openapi-generator-ignore b/samples/client/petstore/rust/hyper/rust-test/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/.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/rust-reqwest/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/rust-reqwest/.openapi-generator/VERSION rename to samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION diff --git a/samples/client/petstore/rust/hyper/rust-test/.travis.yml b/samples/client/petstore/rust/hyper/rust-test/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust/hyper/rust-test/Cargo.toml b/samples/client/petstore/rust/hyper/rust-test/Cargo.toml new file mode 100644 index 000000000000..0e17417c3d2d --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "rust-test-hyper" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "1.5" +hyper = "~0.11" +serde_yaml = "0.7" +base64 = "~0.7.0" +futures = "0.1.23" + +[dev-dependencies] +tokio-core = "*" diff --git a/samples/client/petstore/rust/hyper/rust-test/README.md b/samples/client/petstore/rust/hyper/rust-test/README.md new file mode 100644 index 000000000000..1383eecfd30d --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/README.md @@ -0,0 +1,44 @@ +# Rust API client for rust-test-hyper + +Special testing for the Rust client generator + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.7 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RustClientCodegen + +## Installation + +Put the package under your project folder and add the following to `Cargo.toml` under `[dependencies]`: + +``` + openapi = { path = "./generated" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**dummy_get**](docs/DefaultApi.md#dummy_get) | **Get** /dummy | A dummy endpoint to make the spec valid. + + +## Documentation For Models + + - [TypeTesting](docs/TypeTesting.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/hyper/rust-test/docs/DefaultApi.md b/samples/client/petstore/rust/hyper/rust-test/docs/DefaultApi.md new file mode 100644 index 000000000000..caf46321830a --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**dummy_get**](DefaultApi.md#dummy_get) | **Get** /dummy | A dummy endpoint to make the spec valid. + + + +## dummy_get + +> dummy_get() +A dummy endpoint to make the spec valid. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/rust/hyper/rust-test/docs/TypeTesting.md b/samples/client/petstore/rust/hyper/rust-test/docs/TypeTesting.md new file mode 100644 index 000000000000..e84136389e9b --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/docs/TypeTesting.md @@ -0,0 +1,16 @@ +# TypeTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **i32** | | [optional] +**long** | **i64** | | [optional] +**number** | **f32** | | [optional] +**float** | **f32** | | [optional] +**double** | **f64** | | [optional] +**uuid** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust-reqwest/git_push.sh b/samples/client/petstore/rust/hyper/rust-test/git_push.sh similarity index 100% rename from samples/client/petstore/rust-reqwest/git_push.sh rename to samples/client/petstore/rust/hyper/rust-test/git_push.sh diff --git a/samples/client/petstore/rust/hyper/rust-test/src/apis/client.rs b/samples/client/petstore/rust/hyper/rust-test/src/apis/client.rs new file mode 100644 index 000000000000..6105ed87f9db --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/apis/client.rs @@ -0,0 +1,23 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { + default_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient { + let rc = Rc::new(configuration); + + APIClient { + default_api: Box::new(crate::apis::DefaultApiClient::new(rc.clone())), + } + } + + pub fn default_api(&self) -> &crate::apis::DefaultApi{ + self.default_api.as_ref() + } + +} diff --git a/samples/client/petstore/rust/hyper/rust-test/src/apis/configuration.rs b/samples/client/petstore/rust/hyper/rust-test/src/apis/configuration.rs new file mode 100644 index 000000000000..79762a1437cb --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/apis/configuration.rs @@ -0,0 +1,41 @@ +/* + * Rust client test spec + * + * Special testing for the Rust client generator + * + * The version of the OpenAPI document: 1.0.7 + * + * Generated by: https://openapi-generator.tech + */ + +use hyper; + +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "http://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.7/rust".to_owned()), + client: client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/petstore/rust/hyper/rust-test/src/apis/default_api.rs b/samples/client/petstore/rust/hyper/rust-test/src/apis/default_api.rs new file mode 100644 index 000000000000..b1894d69ef23 --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/apis/default_api.rs @@ -0,0 +1,45 @@ +/* + * Rust client test spec + * + * Special testing for the Rust client generator + * + * The version of the OpenAPI document: 1.0.7 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; + +use hyper; +use serde_json; +use futures::Future; + +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct DefaultApiClient { + configuration: Rc>, +} + +impl DefaultApiClient { + pub fn new(configuration: Rc>) -> DefaultApiClient { + DefaultApiClient { + configuration: configuration, + } + } +} + +pub trait DefaultApi { + fn dummy_get(&self, ) -> Box>>; +} + + +implDefaultApi for DefaultApiClient { + fn dummy_get(&self, ) -> Box>> { + __internal_request::Request::new(hyper::Method::Get, "/dummy".to_string()) + .returns_nothing() + .execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper/rust-test/src/apis/mod.rs b/samples/client/petstore/rust/hyper/rust-test/src/apis/mod.rs new file mode 100644 index 000000000000..cb13d23efc24 --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/apis/mod.rs @@ -0,0 +1,58 @@ +use hyper; +use serde; +use serde_json; + +#[derive(Debug)] +pub enum Error { + UriError(hyper::error::UriError), + Hyper(hyper::Error), + Serde(serde_json::Error), + ApiError(ApiError), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub content: Option, +} + +impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error + where T: serde::Deserialize<'de> { + fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { + if e.1.len() == 0 { + return Error::ApiError(ApiError{ + code: e.0, + content: None, + }); + } + match serde_json::from_slice::(e.1) { + Ok(t) => Error::ApiError(ApiError{ + code: e.0, + content: Some(t), + }), + Err(e) => { + Error::from(e) + } + } + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + return Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + return Error::Serde(e) + } +} + +mod request; + +mod default_api; +pub use self::default_api::{ DefaultApi, DefaultApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/petstore/rust/hyper/rust-test/src/apis/request.rs b/samples/client/petstore/rust/hyper/rust-test/src/apis/request.rs new file mode 100644 index 000000000000..2d5c7eb5a64d --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/apis/request.rs @@ -0,0 +1,239 @@ +use std::borrow::Cow; +use std::collections::HashMap; + +use super::{configuration, Error}; +use futures; +use futures::{Future, Stream}; +use hyper; +use hyper::header::UserAgent; +use serde; +use serde_json; + +pub(crate) struct ApiKey { + pub in_header: bool, + pub in_query: bool, + pub param_name: String, +} + +impl ApiKey { + fn key(&self, prefix: &Option, key: &str) -> String { + match prefix { + None => key.to_owned(), + Some(ref prefix) => format!("{} {}", prefix, key), + } + } +} + +#[allow(dead_code)] +pub(crate) enum Auth { + None, + ApiKey(ApiKey), + Basic, + Oauth, +} + +pub(crate) struct Request { + auth: Auth, + method: hyper::Method, + path: String, + query_params: HashMap, + no_return_type: bool, + path_params: HashMap, + form_params: HashMap, + header_params: HashMap, + // TODO: multiple body params are possible technically, but not supported here. + serialized_body: Option, +} + +impl Request { + pub fn new(method: hyper::Method, path: String) -> Self { + Request { + auth: Auth::None, + method: method, + path: path, + query_params: HashMap::new(), + path_params: HashMap::new(), + form_params: HashMap::new(), + header_params: HashMap::new(), + serialized_body: None, + no_return_type: false, + } + } + + pub fn with_body_param(mut self, param: T) -> Self { + self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); + self + } + + pub fn with_header_param(mut self, basename: String, param: String) -> Self { + self.header_params.insert(basename, param); + self + } + + pub fn with_query_param(mut self, basename: String, param: String) -> Self { + self.query_params.insert(basename, param); + self + } + + pub fn with_path_param(mut self, basename: String, param: String) -> Self { + self.path_params.insert(basename, param); + self + } + + pub fn with_form_param(mut self, basename: String, param: String) -> Self { + self.form_params.insert(basename, param); + self + } + + pub fn returns_nothing(mut self) -> Self { + self.no_return_type = true; + self + } + + pub fn with_auth(mut self, auth: Auth) -> Self { + self.auth = auth; + self + } + + pub fn execute<'a, C, U>( + self, + conf: &configuration::Configuration, + ) -> Box> + 'a> + where + C: hyper::client::Connect, + U: Sized + 'a, + for<'de> U: serde::Deserialize<'de>, + { + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); + // raw_headers is for headers we don't know the proper type of (e.g. custom api key + // headers); headers is for ones we do know the type of. + let mut raw_headers = HashMap::new(); + let mut headers: hyper::header::Headers = hyper::header::Headers::new(); + + let mut path = self.path; + for (k, v) in self.path_params { + // replace {id} with the value of the id path param + path = path.replace(&format!("{{{}}}", k), &v); + } + + for (k, v) in self.header_params { + raw_headers.insert(k, v); + } + + for (key, val) in self.query_params { + query_string.append_pair(&key, &val); + } + + match self.auth { + Auth::ApiKey(apikey) => { + if let Some(ref key) = conf.api_key { + let val = apikey.key(&key.prefix, &key.key); + if apikey.in_query { + query_string.append_pair(&apikey.param_name, &val); + } + if apikey.in_header { + raw_headers.insert(apikey.param_name, val); + } + } + } + Auth::Basic => { + if let Some(ref auth_conf) = conf.basic_auth { + let auth = hyper::header::Authorization(hyper::header::Basic { + username: auth_conf.0.to_owned(), + password: auth_conf.1.to_owned(), + }); + headers.set(auth); + } + } + Auth::Oauth => { + if let Some(ref token) = conf.oauth_access_token { + let auth = hyper::header::Authorization(hyper::header::Bearer { + token: token.to_owned(), + }); + headers.set(auth); + } + } + Auth::None => {} + } + + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if query_string_str != "" { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => { + return Box::new(futures::future::err(Error::UriError(e))); + } + Ok(u) => u, + }; + + let mut req = hyper::Request::new(self.method, uri); + { + let req_headers = req.headers_mut(); + if let Some(ref user_agent) = conf.user_agent { + req_headers.set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + + req_headers.extend(headers.iter()); + + for (key, val) in raw_headers { + req_headers.set_raw(key, val); + } + } + + if self.form_params.len() > 0 { + req.headers_mut().set(hyper::header::ContentType::form_url_encoded()); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); + for (k, v) in self.form_params { + enc.append_pair(&k, &v); + } + req.set_body(enc.finish()); + } + + if let Some(body) = self.serialized_body { + req.headers_mut().set(hyper::header::ContentType::json()); + req.headers_mut() + .set(hyper::header::ContentLength(body.len() as u64)); + req.set_body(body); + } + + let no_ret_type = self.no_return_type; + let res = conf.client + .request(req) + .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body() + .concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }); + Box::new( + res + .and_then(move |body| { + let parsed: Result = if no_ret_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + serde_json::from_str("null") + } else { + serde_json::from_slice(&body) + }; + parsed.map_err(|e| Error::from(e)) + }) + ) + } +} diff --git a/samples/client/petstore/rust/hyper/rust-test/src/lib.rs b/samples/client/petstore/rust/hyper/rust-test/src/lib.rs new file mode 100644 index 000000000000..a76d822525da --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/lib.rs @@ -0,0 +1,11 @@ +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate hyper; +extern crate futures; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust/hyper/rust-test/src/models/mod.rs b/samples/client/petstore/rust/hyper/rust-test/src/models/mod.rs new file mode 100644 index 000000000000..8762207b5b3f --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/models/mod.rs @@ -0,0 +1,2 @@ +mod type_testing; +pub use self::type_testing::TypeTesting; 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 new file mode 100644 index 000000000000..abd6582cc66f --- /dev/null +++ b/samples/client/petstore/rust/hyper/rust-test/src/models/type_testing.rs @@ -0,0 +1,44 @@ +/* + * Rust client test spec + * + * Special testing for the Rust client generator + * + * The version of the OpenAPI document: 1.0.7 + * + * Generated by: https://openapi-generator.tech + */ + +/// TypeTesting : Test handling of differing types (see \\#3463) + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct TypeTesting { + #[serde(rename = "integer", skip_serializing_if = "Option::is_none")] + pub integer: Option, + #[serde(rename = "long", skip_serializing_if = "Option::is_none")] + pub long: Option, + #[serde(rename = "number", skip_serializing_if = "Option::is_none")] + pub number: Option, + #[serde(rename = "float", skip_serializing_if = "Option::is_none")] + pub float: Option, + #[serde(rename = "double", skip_serializing_if = "Option::is_none")] + pub double: Option, + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, +} + +impl TypeTesting { + /// Test handling of differing types (see \\#3463) + pub fn new() -> TypeTesting { + TypeTesting { + integer: None, + long: None, + number: None, + float: None, + double: None, + uuid: None, + } + } +} + + diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/.gitignore b/samples/client/petstore/rust/reqwest/fileResponseTest/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator-ignore b/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/.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/rust/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/rust/.openapi-generator/VERSION rename to samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/.travis.yml b/samples/client/petstore/rust/reqwest/fileResponseTest/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/Cargo.toml b/samples/client/petstore/rust/reqwest/fileResponseTest/Cargo.toml new file mode 100644 index 000000000000..97c0f07897b9 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "fileResponseTest-reqwest" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "1.5" +reqwest = "~0.9" + +[dev-dependencies] diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/README.md b/samples/client/petstore/rust/reqwest/fileResponseTest/README.md new file mode 100644 index 000000000000..8bf849adb68d --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/README.md @@ -0,0 +1,43 @@ +# Rust API client for fileResponseTest-reqwest + +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://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RustClientCodegen + +## Installation + +Put the package under your project folder and add the following to `Cargo.toml` under `[dependencies]`: + +``` + openapi = { path = "./generated" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**fileresponsetest**](docs/DefaultApi.md#fileresponsetest) | **get** /tests/fileResponse | + + +## Documentation For Models + + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/docs/DefaultApi.md b/samples/client/petstore/rust/reqwest/fileResponseTest/docs/DefaultApi.md new file mode 100644 index 000000000000..0b0273e4346b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://localhost/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fileresponsetest**](DefaultApi.md#fileresponsetest) | **get** /tests/fileResponse | + + + +## fileresponsetest + +> std::path::PathBuf fileresponsetest() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + +[[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) + diff --git a/samples/client/petstore/rust/git_push.sh b/samples/client/petstore/rust/reqwest/fileResponseTest/git_push.sh similarity index 100% rename from samples/client/petstore/rust/git_push.sh rename to samples/client/petstore/rust/reqwest/fileResponseTest/git_push.sh diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/client.rs b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/client.rs new file mode 100644 index 000000000000..2f76997d319f --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/client.rs @@ -0,0 +1,22 @@ +use std::rc::Rc; + +use super::configuration::Configuration; + +pub struct APIClient { + default_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient { + let rc = Rc::new(configuration); + + APIClient { + default_api: Box::new(crate::apis::DefaultApiClient::new(rc.clone())), + } + } + + pub fn default_api(&self) -> &crate::apis::DefaultApi{ + self.default_api.as_ref() + } + +} diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/configuration.rs b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/configuration.rs new file mode 100644 index 000000000000..107d558aa4f9 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/configuration.rs @@ -0,0 +1,50 @@ +/* + * File Response Test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost/v2".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/default_api.rs b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/default_api.rs new file mode 100644 index 000000000000..487e5d3af60e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/default_api.rs @@ -0,0 +1,52 @@ +/* + * File Response Test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; + +use reqwest; + +use super::{Error, configuration}; + +pub struct DefaultApiClient { + configuration: Rc, +} + +impl DefaultApiClient { + pub fn new(configuration: Rc) -> DefaultApiClient { + DefaultApiClient { + configuration: configuration, + } + } +} + +pub trait DefaultApi { + fn fileresponsetest(&self, ) -> Result; +} + +impl DefaultApi for DefaultApiClient { + fn fileresponsetest(&self, ) -> Result { + let configuration: &configuration::Configuration = self.configuration.borrow(); + let client = &configuration.client; + + let uri_str = format!("{}/tests/fileResponse", configuration.base_path); + let mut req_builder = client.get(uri_str.as_str()); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + // send request + let req = req_builder.build()?; + + Ok(client.execute(req)?.error_for_status()?.json()?) + } + +} diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/mod.rs b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/mod.rs new file mode 100644 index 000000000000..3b70668f6fd9 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/src/apis/mod.rs @@ -0,0 +1,37 @@ +use reqwest; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +mod default_api; +pub use self::default_api::{ DefaultApi, DefaultApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/petstore/rust-reqwest/src/lib.rs b/samples/client/petstore/rust/reqwest/fileResponseTest/src/lib.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/lib.rs rename to samples/client/petstore/rust/reqwest/fileResponseTest/src/lib.rs diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/src/models/mod.rs b/samples/client/petstore/rust/reqwest/fileResponseTest/src/models/mod.rs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/client/petstore/rust/reqwest/petstore/.gitignore b/samples/client/petstore/rust/reqwest/petstore/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator-ignore b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/.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/rust/reqwest/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION new file mode 100644 index 000000000000..2f81801b7943 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore/.travis.yml b/samples/client/petstore/rust/reqwest/petstore/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust-reqwest/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml similarity index 88% rename from samples/client/petstore/rust-reqwest/Cargo.toml rename to samples/client/petstore/rust/reqwest/petstore/Cargo.toml index 6d66b8f7c7cf..7a2aed735ea5 100644 --- a/samples/client/petstore/rust-reqwest/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "petstore_client" +name = "petstore-reqwest" version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] diff --git a/samples/client/petstore/rust-reqwest/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md similarity index 98% rename from samples/client/petstore/rust-reqwest/README.md rename to samples/client/petstore/rust/reqwest/petstore/README.md index d8591a2cb9f4..b83be74204c5 100644 --- a/samples/client/petstore/rust-reqwest/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -1,4 +1,4 @@ -# Rust API client for petstore_client +# Rust API client for petstore-reqwest This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/rust/docs/ApiResponse.md b/samples/client/petstore/rust/reqwest/petstore/docs/ApiResponse.md similarity index 100% rename from samples/client/petstore/rust/docs/ApiResponse.md rename to samples/client/petstore/rust/reqwest/petstore/docs/ApiResponse.md diff --git a/samples/client/petstore/rust/docs/Category.md b/samples/client/petstore/rust/reqwest/petstore/docs/Category.md similarity index 100% rename from samples/client/petstore/rust/docs/Category.md rename to samples/client/petstore/rust/reqwest/petstore/docs/Category.md diff --git a/samples/client/petstore/rust/docs/Order.md b/samples/client/petstore/rust/reqwest/petstore/docs/Order.md similarity index 100% rename from samples/client/petstore/rust/docs/Order.md rename to samples/client/petstore/rust/reqwest/petstore/docs/Order.md diff --git a/samples/client/petstore/rust/docs/Pet.md b/samples/client/petstore/rust/reqwest/petstore/docs/Pet.md similarity index 100% rename from samples/client/petstore/rust/docs/Pet.md rename to samples/client/petstore/rust/reqwest/petstore/docs/Pet.md diff --git a/samples/client/petstore/rust-reqwest/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/PetApi.md rename to samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md diff --git a/samples/client/petstore/rust-reqwest/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/StoreApi.md rename to samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md diff --git a/samples/client/petstore/rust/docs/Tag.md b/samples/client/petstore/rust/reqwest/petstore/docs/Tag.md similarity index 100% rename from samples/client/petstore/rust/docs/Tag.md rename to samples/client/petstore/rust/reqwest/petstore/docs/Tag.md diff --git a/samples/client/petstore/rust/docs/User.md b/samples/client/petstore/rust/reqwest/petstore/docs/User.md similarity index 100% rename from samples/client/petstore/rust/docs/User.md rename to samples/client/petstore/rust/reqwest/petstore/docs/User.md diff --git a/samples/client/petstore/rust-reqwest/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md similarity index 100% rename from samples/client/petstore/rust-reqwest/docs/UserApi.md rename to samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md diff --git a/samples/client/petstore/rust/reqwest/petstore/git_push.sh b/samples/client/petstore/rust/reqwest/petstore/git_push.sh new file mode 100644 index 000000000000..8442b80bb445 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/git_push.sh @@ -0,0 +1,52 @@ +#!/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" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +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://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${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://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/rust-reqwest/src/apis/client.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/client.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/apis/client.rs rename to samples/client/petstore/rust/reqwest/petstore/src/apis/client.rs diff --git a/samples/client/petstore/rust-reqwest/src/apis/configuration.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/configuration.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/apis/configuration.rs rename to samples/client/petstore/rust/reqwest/petstore/src/apis/configuration.rs diff --git a/samples/client/petstore/rust-reqwest/src/apis/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/mod.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/apis/mod.rs rename to samples/client/petstore/rust/reqwest/petstore/src/apis/mod.rs diff --git a/samples/client/petstore/rust-reqwest/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/apis/pet_api.rs rename to samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs diff --git a/samples/client/petstore/rust-reqwest/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/apis/store_api.rs rename to samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs diff --git a/samples/client/petstore/rust-reqwest/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs similarity index 100% rename from samples/client/petstore/rust-reqwest/src/apis/user_api.rs rename to samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs new file mode 100644 index 000000000000..c1dd666f7957 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs @@ -0,0 +1,10 @@ +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs similarity index 100% rename from samples/client/petstore/rust/src/models/api_response.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs diff --git a/samples/client/petstore/rust/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs similarity index 100% rename from samples/client/petstore/rust/src/models/category.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/category.rs diff --git a/samples/client/petstore/rust/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs similarity index 100% rename from samples/client/petstore/rust/src/models/mod.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs diff --git a/samples/client/petstore/rust/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs similarity index 100% rename from samples/client/petstore/rust/src/models/order.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/order.rs diff --git a/samples/client/petstore/rust/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs similarity index 100% rename from samples/client/petstore/rust/src/models/pet.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs diff --git a/samples/client/petstore/rust/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs similarity index 100% rename from samples/client/petstore/rust/src/models/tag.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs diff --git a/samples/client/petstore/rust/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs similarity index 100% rename from samples/client/petstore/rust/src/models/user.rs rename to samples/client/petstore/rust/reqwest/petstore/src/models/user.rs diff --git a/samples/client/petstore/rust/reqwest/rust-test/.gitignore b/samples/client/petstore/rust/reqwest/rust-test/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator-ignore b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/.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/rust/reqwest/rust-test/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/rust-test/.travis.yml b/samples/client/petstore/rust/reqwest/rust-test/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust/reqwest/rust-test/Cargo.toml b/samples/client/petstore/rust/reqwest/rust-test/Cargo.toml new file mode 100644 index 000000000000..60c968a7cf2f --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "rust-test-reqwest" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "1.5" +reqwest = "~0.9" + +[dev-dependencies] diff --git a/samples/client/petstore/rust/reqwest/rust-test/README.md b/samples/client/petstore/rust/reqwest/rust-test/README.md new file mode 100644 index 000000000000..097d18b77d0a --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/README.md @@ -0,0 +1,44 @@ +# Rust API client for rust-test-reqwest + +Special testing for the Rust client generator + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.7 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RustClientCodegen + +## Installation + +Put the package under your project folder and add the following to `Cargo.toml` under `[dependencies]`: + +``` + openapi = { path = "./generated" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**dummy_get**](docs/DefaultApi.md#dummy_get) | **get** /dummy | A dummy endpoint to make the spec valid. + + +## Documentation For Models + + - [TypeTesting](docs/TypeTesting.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/reqwest/rust-test/docs/DefaultApi.md b/samples/client/petstore/rust/reqwest/rust-test/docs/DefaultApi.md new file mode 100644 index 000000000000..ea01d010f01f --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**dummy_get**](DefaultApi.md#dummy_get) | **get** /dummy | A dummy endpoint to make the spec valid. + + + +## dummy_get + +> dummy_get() +A dummy endpoint to make the spec valid. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/client/petstore/rust/reqwest/rust-test/docs/TypeTesting.md b/samples/client/petstore/rust/reqwest/rust-test/docs/TypeTesting.md new file mode 100644 index 000000000000..e84136389e9b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/docs/TypeTesting.md @@ -0,0 +1,16 @@ +# TypeTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **i32** | | [optional] +**long** | **i64** | | [optional] +**number** | **f32** | | [optional] +**float** | **f32** | | [optional] +**double** | **f64** | | [optional] +**uuid** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/rust-test/git_push.sh b/samples/client/petstore/rust/reqwest/rust-test/git_push.sh new file mode 100644 index 000000000000..8442b80bb445 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/git_push.sh @@ -0,0 +1,52 @@ +#!/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" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +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://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${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://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/apis/client.rs b/samples/client/petstore/rust/reqwest/rust-test/src/apis/client.rs new file mode 100644 index 000000000000..2f76997d319f --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/apis/client.rs @@ -0,0 +1,22 @@ +use std::rc::Rc; + +use super::configuration::Configuration; + +pub struct APIClient { + default_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient { + let rc = Rc::new(configuration); + + APIClient { + default_api: Box::new(crate::apis::DefaultApiClient::new(rc.clone())), + } + } + + pub fn default_api(&self) -> &crate::apis::DefaultApi{ + self.default_api.as_ref() + } + +} diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/apis/configuration.rs b/samples/client/petstore/rust/reqwest/rust-test/src/apis/configuration.rs new file mode 100644 index 000000000000..6aa6915560fd --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/apis/configuration.rs @@ -0,0 +1,50 @@ +/* + * Rust client test spec + * + * Special testing for the Rust client generator + * + * The version of the OpenAPI document: 1.0.7 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.7/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/apis/default_api.rs b/samples/client/petstore/rust/reqwest/rust-test/src/apis/default_api.rs new file mode 100644 index 000000000000..9404fefb7dd9 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/apis/default_api.rs @@ -0,0 +1,53 @@ +/* + * Rust client test spec + * + * Special testing for the Rust client generator + * + * The version of the OpenAPI document: 1.0.7 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; + +use reqwest; + +use super::{Error, configuration}; + +pub struct DefaultApiClient { + configuration: Rc, +} + +impl DefaultApiClient { + pub fn new(configuration: Rc) -> DefaultApiClient { + DefaultApiClient { + configuration: configuration, + } + } +} + +pub trait DefaultApi { + fn dummy_get(&self, ) -> Result<(), Error>; +} + +impl DefaultApi for DefaultApiClient { + fn dummy_get(&self, ) -> Result<(), Error> { + let configuration: &configuration::Configuration = self.configuration.borrow(); + let client = &configuration.client; + + let uri_str = format!("{}/dummy", configuration.base_path); + let mut req_builder = client.get(uri_str.as_str()); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + // send request + let req = req_builder.build()?; + + client.execute(req)?.error_for_status()?; + Ok(()) + } + +} diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/apis/mod.rs b/samples/client/petstore/rust/reqwest/rust-test/src/apis/mod.rs new file mode 100644 index 000000000000..3b70668f6fd9 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/apis/mod.rs @@ -0,0 +1,37 @@ +use reqwest; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +mod default_api; +pub use self::default_api::{ DefaultApi, DefaultApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/lib.rs b/samples/client/petstore/rust/reqwest/rust-test/src/lib.rs new file mode 100644 index 000000000000..c1dd666f7957 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/lib.rs @@ -0,0 +1,10 @@ +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust/reqwest/rust-test/src/models/mod.rs b/samples/client/petstore/rust/reqwest/rust-test/src/models/mod.rs new file mode 100644 index 000000000000..8762207b5b3f --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/models/mod.rs @@ -0,0 +1,2 @@ +mod type_testing; +pub use self::type_testing::TypeTesting; 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 new file mode 100644 index 000000000000..abd6582cc66f --- /dev/null +++ b/samples/client/petstore/rust/reqwest/rust-test/src/models/type_testing.rs @@ -0,0 +1,44 @@ +/* + * Rust client test spec + * + * Special testing for the Rust client generator + * + * The version of the OpenAPI document: 1.0.7 + * + * Generated by: https://openapi-generator.tech + */ + +/// TypeTesting : Test handling of differing types (see \\#3463) + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct TypeTesting { + #[serde(rename = "integer", skip_serializing_if = "Option::is_none")] + pub integer: Option, + #[serde(rename = "long", skip_serializing_if = "Option::is_none")] + pub long: Option, + #[serde(rename = "number", skip_serializing_if = "Option::is_none")] + pub number: Option, + #[serde(rename = "float", skip_serializing_if = "Option::is_none")] + pub float: Option, + #[serde(rename = "double", skip_serializing_if = "Option::is_none")] + pub double: Option, + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, +} + +impl TypeTesting { + /// Test handling of differing types (see \\#3463) + pub fn new() -> TypeTesting { + TypeTesting { + integer: None, + long: None, + number: None, + float: None, + double: None, + uuid: None, + } + } +} + + diff --git a/samples/client/petstore/rust/src/apis/client.rs.orig b/samples/client/petstore/rust/src/apis/client.rs.orig deleted file mode 100644 index 39175e119e0d..000000000000 --- a/samples/client/petstore/rust/src/apis/client.rs.orig +++ /dev/null @@ -1,35 +0,0 @@ -use std::rc::Rc; - -use hyper; -use super::configuration::Configuration; - -pub struct APIClient { - pet_api: Box, - store_api: Box, - user_api: Box, -} - -impl APIClient { - pub fn new(configuration: Configuration) -> APIClient { - let rc = Rc::new(configuration); - - APIClient { - pet_api: Box::new(crate::apis::PetApiClient::new(rc.clone())), - store_api: Box::new(crate::apis::StoreApiClient::new(rc.clone())), - user_api: Box::new(crate::apis::UserApiClient::new(rc.clone())), - } - } - - pub fn pet_api(&self) -> &crate::apis::PetApi{ - self.pet_api.as_ref() - } - - pub fn store_api(&self) -> &crate::apis::StoreApi{ - self.store_api.as_ref() - } - - pub fn user_api(&self) -> &crate::apis::UserApi{ - self.user_api.as_ref() - } - -} diff --git a/samples/client/petstore/rust/src/models/inline_object.rs b/samples/client/petstore/rust/src/models/inline_object.rs new file mode 100644 index 000000000000..b1444810dcff --- /dev/null +++ b/samples/client/petstore/rust/src/models/inline_object.rs @@ -0,0 +1,32 @@ +/* + * 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://openapi-generator.tech + */ + + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct InlineObject { + /// Updated name of the pet + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Updated status of the pet + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl InlineObject { + pub fn new() -> InlineObject { + InlineObject { + name: None, + status: None, + } + } +} + + diff --git a/samples/client/petstore/rust/src/models/inline_object_1.rs b/samples/client/petstore/rust/src/models/inline_object_1.rs new file mode 100644 index 000000000000..ee4c1b78ae57 --- /dev/null +++ b/samples/client/petstore/rust/src/models/inline_object_1.rs @@ -0,0 +1,32 @@ +/* + * 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://openapi-generator.tech + */ + + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct InlineObject1 { + /// Additional data to pass to server + #[serde(rename = "additionalMetadata", skip_serializing_if = "Option::is_none")] + pub additional_metadata: Option, + /// file to upload + #[serde(rename = "file", skip_serializing_if = "Option::is_none")] + pub file: Option, +} + +impl InlineObject1 { + pub fn new() -> InlineObject1 { + InlineObject1 { + additional_metadata: None, + file: None, + } + } +} + + diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index afa636560641..0e97bd19efbf 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala index 85cc57e381ba..71ad618e31fb 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala index 9aeea7d8d61a..658f7fb8fe31 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,7 +32,7 @@ class PetApi(baseUrl: String) { * @param body Pet object that needs to be added to the store */ def addPet(body: Pet): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet", "application/json") + ApiRequest[Unit](ApiMethods.POST, baseUrl, "/pet", "application/json") .withBody(body) .withErrorResponse[Unit](405) @@ -45,7 +45,7 @@ class PetApi(baseUrl: String) { * @param apiKey */ def deletePet(petId: Long, apiKey: Option[String] = None): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.DELETE, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/json") + ApiRequest[Unit](ApiMethods.DELETE, baseUrl, "/pet/{petId}", "application/json") .withPathParam("petId", petId) .withHeaderParam("api_key", apiKey) .withErrorResponse[Unit](400) @@ -61,7 +61,7 @@ class PetApi(baseUrl: String) { * @param status Status values that need to be considered for filter */ def findPetsByStatus(status: Seq[String]): ApiRequest[Seq[Pet]] = - ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByStatus", "application/json") + ApiRequest[Seq[Pet]](ApiMethods.GET, baseUrl, "/pet/findByStatus", "application/json") .withQueryParam("status", ArrayValues(status, CSV)) .withSuccessResponse[Seq[Pet]](200) .withErrorResponse[Unit](400) @@ -77,7 +77,7 @@ class PetApi(baseUrl: String) { * @param tags Tags to filter by */ def findPetsByTags(tags: Seq[String]): ApiRequest[Seq[Pet]] = - ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByTags", "application/json") + ApiRequest[Seq[Pet]](ApiMethods.GET, baseUrl, "/pet/findByTags", "application/json") .withQueryParam("tags", ArrayValues(tags, CSV)) .withSuccessResponse[Seq[Pet]](200) .withErrorResponse[Unit](400) @@ -97,7 +97,7 @@ class PetApi(baseUrl: String) { * @param petId ID of pet to return */ def getPetById(petId: Long)(implicit apiKey: ApiKeyValue): ApiRequest[Pet] = - ApiRequest[Pet](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/json") + ApiRequest[Pet](ApiMethods.GET, baseUrl, "/pet/{petId}", "application/json") .withApiKey(apiKey, "api_key", HEADER) .withPathParam("petId", petId) .withSuccessResponse[Pet](200) @@ -114,7 +114,7 @@ class PetApi(baseUrl: String) { * @param body Pet object that needs to be added to the store */ def updatePet(body: Pet): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/pet", "application/json") + ApiRequest[Unit](ApiMethods.PUT, baseUrl, "/pet", "application/json") .withBody(body) .withErrorResponse[Unit](400) .withErrorResponse[Unit](404) @@ -130,7 +130,7 @@ class PetApi(baseUrl: String) { * @param status Updated status of the pet */ def updatePetWithForm(petId: Long, name: Option[String] = None, status: Option[String] = None): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}", "application/x-www-form-urlencoded") + ApiRequest[Unit](ApiMethods.POST, baseUrl, "/pet/{petId}", "application/x-www-form-urlencoded") .withFormParam("name", name) .withFormParam("status", status) .withPathParam("petId", petId) @@ -146,7 +146,7 @@ class PetApi(baseUrl: String) { * @param file file to upload */ def uploadFile(petId: Long, additionalMetadata: Option[String] = None, file: Option[File] = None): ApiRequest[ApiResponse] = - ApiRequest[ApiResponse](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet/{petId}/uploadImage", "multipart/form-data") + ApiRequest[ApiResponse](ApiMethods.POST, baseUrl, "/pet/{petId}/uploadImage", "multipart/form-data") .withFormParam("additionalMetadata", additionalMetadata) .withFormParam("file", file) .withPathParam("petId", petId) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala index 716625d5d6d4..534b3a4949a7 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -33,7 +33,7 @@ class StoreApi(baseUrl: String) { * @param orderId ID of the order that needs to be deleted */ def deleteOrder(orderId: String): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.DELETE, "http://petstore.swagger.io/v2", "/store/order/{orderId}", "application/json") + ApiRequest[Unit](ApiMethods.DELETE, baseUrl, "/store/order/{orderId}", "application/json") .withPathParam("orderId", orderId) .withErrorResponse[Unit](400) .withErrorResponse[Unit](404) @@ -49,7 +49,7 @@ class StoreApi(baseUrl: String) { * api_key (apiKey) */ def getInventory()(implicit apiKey: ApiKeyValue): ApiRequest[Map[String, Int]] = - ApiRequest[Map[String, Int]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/store/inventory", "application/json") + ApiRequest[Map[String, Int]](ApiMethods.GET, baseUrl, "/store/inventory", "application/json") .withApiKey(apiKey, "api_key", HEADER) .withSuccessResponse[Map[String, Int]](200) @@ -65,7 +65,7 @@ class StoreApi(baseUrl: String) { * @param orderId ID of pet that needs to be fetched */ def getOrderById(orderId: Long): ApiRequest[Order] = - ApiRequest[Order](ApiMethods.GET, "http://petstore.swagger.io/v2", "/store/order/{orderId}", "application/json") + ApiRequest[Order](ApiMethods.GET, baseUrl, "/store/order/{orderId}", "application/json") .withPathParam("orderId", orderId) .withSuccessResponse[Order](200) .withErrorResponse[Unit](400) @@ -80,7 +80,7 @@ class StoreApi(baseUrl: String) { * @param body order placed for purchasing the pet */ def placeOrder(body: Order): ApiRequest[Order] = - ApiRequest[Order](ApiMethods.POST, "http://petstore.swagger.io/v2", "/store/order", "application/json") + ApiRequest[Order](ApiMethods.POST, baseUrl, "/store/order", "application/json") .withBody(body) .withSuccessResponse[Order](200) .withErrorResponse[Unit](400) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala index e695e1b41908..7a1e796b70d4 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,7 +32,7 @@ class UserApi(baseUrl: String) { * @param body Created user object */ def createUser(body: User): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user", "application/json") + ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user", "application/json") .withBody(body) .withDefaultSuccessResponse[Unit] @@ -44,7 +44,7 @@ class UserApi(baseUrl: String) { * @param body List of user object */ def createUsersWithArrayInput(body: Seq[User]): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithArray", "application/json") + ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user/createWithArray", "application/json") .withBody(body) .withDefaultSuccessResponse[Unit] @@ -56,7 +56,7 @@ class UserApi(baseUrl: String) { * @param body List of user object */ def createUsersWithListInput(body: Seq[User]): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithList", "application/json") + ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user/createWithList", "application/json") .withBody(body) .withDefaultSuccessResponse[Unit] @@ -71,7 +71,7 @@ class UserApi(baseUrl: String) { * @param username The name that needs to be deleted */ def deleteUser(username: String): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.DELETE, "http://petstore.swagger.io/v2", "/user/{username}", "application/json") + ApiRequest[Unit](ApiMethods.DELETE, baseUrl, "/user/{username}", "application/json") .withPathParam("username", username) .withErrorResponse[Unit](400) .withErrorResponse[Unit](404) @@ -86,7 +86,7 @@ class UserApi(baseUrl: String) { * @param username The name that needs to be fetched. Use user1 for testing. */ def getUserByName(username: String): ApiRequest[User] = - ApiRequest[User](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/{username}", "application/json") + ApiRequest[User](ApiMethods.GET, baseUrl, "/user/{username}", "application/json") .withPathParam("username", username) .withSuccessResponse[User](200) .withErrorResponse[Unit](400) @@ -105,7 +105,7 @@ class UserApi(baseUrl: String) { * @param password The password for login in clear text */ def loginUser(username: String, password: String): ApiRequest[String] = - ApiRequest[String](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/login", "application/json") + ApiRequest[String](ApiMethods.GET, baseUrl, "/user/login", "application/json") .withQueryParam("username", username) .withQueryParam("password", password) .withSuccessResponse[String](200) @@ -121,7 +121,7 @@ class UserApi(baseUrl: String) { * code 0 : (successful operation) */ def logoutUser(): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/logout", "application/json") + ApiRequest[Unit](ApiMethods.GET, baseUrl, "/user/logout", "application/json") .withDefaultSuccessResponse[Unit] @@ -136,7 +136,7 @@ class UserApi(baseUrl: String) { * @param body Updated user object */ def updateUser(username: String, body: User): ApiRequest[Unit] = - ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/user/{username}", "application/json") + ApiRequest[Unit](ApiMethods.PUT, baseUrl, "/user/{username}", "application/json") .withBody(body) .withPathParam("username", username) .withErrorResponse[Unit](400) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala index 6b9b04d37458..8b6eeee0bb51 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala index 2378d8c5fe00..3dfa61094de0 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala index 448cd25f089c..2553aeb3c875 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala index ff715e3eb298..155a86dcf112 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala index 81370edb740c..0ef406429cbb 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala index 8d609a555229..23ba74821501 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala index fe4daa9c3597..83055706fd1d 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala index e5df29f24671..1f78a72e57ba 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala index e46602f84f43..30dfbf441914 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala index ef8eb6b4a0d2..0d33ce64753e 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.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/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 2ebd1da3282e..e5809e359252 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 ee09f8dc7388..f0c43d1979f8 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 56610a8f6118..27841689adb9 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 20e109b15caa..070012358683 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -24,7 +24,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/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.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/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 862e4695882a..46496f992fbb 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 d14b18696a79..a228c3b78e1d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 370af6c2e5ab..d8e0209ab106 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 20e109b15caa..070012358683 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -24,7 +24,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/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.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/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 68659995e73e..732391fac3cd 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 41bc02d2d81d..2b13c4ccfdd8 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 83c2c9019e20..933b4ee8ba53 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 20e109b15caa..070012358683 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -24,7 +24,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/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 62bfcb0f6892..9c9ee52b1e56 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 31b3c7046918..2c7456394027 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 42bac67fac3b..9ce463aa8299 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } diff --git a/samples/client/petstore/typescript-angular-v2/default/git_push.sh b/samples/client/petstore/typescript-angular-v2/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v2/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-v2/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 62bfcb0f6892..9c9ee52b1e56 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 31b3c7046918..2c7456394027 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 42bac67fac3b..9ce463aa8299 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/git_push.sh b/samples/client/petstore/typescript-angular-v2/npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v2/npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-v2/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 7aebfe5fef43..c75e5e46dddd 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 @@ -36,13 +36,14 @@ export class PetService implements PetServiceInterface { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 7fdd6d038832..147e0c8dfd57 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 @@ -35,13 +35,14 @@ export class StoreService implements StoreServiceInterface { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 d852fae20a1c..d9acd360ef3a 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 @@ -35,13 +35,14 @@ export class UserService implements UserServiceInterface { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh b/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-v4.3/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 52f9e5ee8d91..1d5843d4042c 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 @@ -33,13 +33,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 d853a0f4c88d..eb7539d0d529 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 @@ -32,13 +32,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 b8f2a9f32d9a..0f0a22e8234d 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 @@ -32,13 +32,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh b/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-v4/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 62bfcb0f6892..9c9ee52b1e56 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 31b3c7046918..2c7456394027 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } 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 42bac67fac3b..9ce463aa8299 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: QueryEncoder; constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } diff --git a/samples/client/petstore/typescript-angular-v4/npm/git_push.sh b/samples/client/petstore/typescript-angular-v4/npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v4/npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 989d91b5c028..380838570e9d 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 @@ -33,13 +33,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 97392be5f22a..f1fc543ad0c2 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 @@ -32,13 +32,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 5357ddadaa8f..89ca23713a24 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 @@ -32,13 +32,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 989d91b5c028..380838570e9d 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 @@ -33,13 +33,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 97392be5f22a..f1fc543ad0c2 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 @@ -32,13 +32,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 5357ddadaa8f..89ca23713a24 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 @@ -32,13 +32,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 a0df069e6a4a..25f4cdfc7f4a 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 6264d975e002..8fba3b49de87 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 a85d85649952..a9fc0b74c1a6 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 a0df069e6a4a..25f4cdfc7f4a 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 6264d975e002..8fba3b49de87 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 a85d85649952..a9fc0b74c1a6 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 989d91b5c028..380838570e9d 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 @@ -33,13 +33,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 97392be5f22a..f1fc543ad0c2 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 @@ -32,13 +32,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 5357ddadaa8f..89ca23713a24 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 @@ -32,13 +32,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 989d91b5c028..380838570e9d 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 @@ -33,13 +33,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 97392be5f22a..f1fc543ad0c2 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 @@ -32,13 +32,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 5357ddadaa8f..89ca23713a24 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 @@ -32,13 +32,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 a0df069e6a4a..25f4cdfc7f4a 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 6264d975e002..8fba3b49de87 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 a85d85649952..a9fc0b74c1a6 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 a0df069e6a4a..25f4cdfc7f4a 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 @@ -35,13 +35,14 @@ export class PetService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 6264d975e002..8fba3b49de87 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 @@ -34,13 +34,14 @@ export class StoreService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } 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 a85d85649952..a9fc0b74c1a6 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 @@ -34,13 +34,14 @@ export class UserService { public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { this.configuration = configuration; - this.configuration.basePath = configuration.basePath || basePath || this.basePath; - - } else { - this.configuration.basePath = basePath || this.basePath; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/git_push.sh +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-v7-provided-in-root/tests/default/src/test/configuration.spec.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/configuration.spec.ts index 0b8ec658ac1d..120c9d284cb0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/configuration.spec.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/configuration.spec.ts @@ -91,3 +91,68 @@ describe(`API (with ConfigurationFactory)`, () => { }); }); + +describe(`API (with ConfigurationFactory and empty basePath)`, () => { + let httpClient: HttpClient; + let httpTestingController: HttpTestingController; + + const pet: Pet = { + name: `pet`, + photoUrls: [] + }; + + let apiConfigurationParams: ConfigurationParameters = { + // add configuration params here + basePath: '' + }; + + let apiConfig: Configuration = new Configuration(apiConfigurationParams); + + const getApiConfig = () => { + return apiConfig; + }; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [ + HttpClientTestingModule , + ApiModule.forRoot(getApiConfig) + ], + providers: [ + PetService, + ] + }); + + // Inject the http service and test controller for each test + httpClient = TestBed.get(HttpClient); + httpTestingController = TestBed.get(HttpTestingController); + }); + + afterEach(() => { + // After every test, assert that there are no more pending requests. + httpTestingController.verify(); + }); + + describe(`PetService`, () => { + it(`should be provided`, () => { + const petService = TestBed.get(PetService); + expect(petService).toBeTruthy(); + }); + + it(`should call initially configured empty basePath /pet`, async(() => { + const petService = TestBed.get(PetService); + + petService.addPet(pet).subscribe( + result => expect(result).toEqual(pet), + error => fail(`expected a result, not the error: ${error.message}`), + ); + + const req = httpTestingController.expectOne('/pet'); + + expect(req.request.method).toEqual('POST'); + + req.flush(pet); + })); + }); + +}); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.gitignore b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.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/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/README.md new file mode 100644 index 000000000000..ab47bc7e4064 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/api.module.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api.module.ts new file mode 100644 index 000000000000..8487243a83b1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/api/api.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts new file mode 100644 index 000000000000..25f4cdfc7f4a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -0,0 +1,507 @@ +/** + * 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'; + + +@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 body Pet object that needs to be added to the store + * @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(body: Pet, observe?: 'body', reportProgress?: boolean): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 petId Pet id to delete + * @param apiKey + * @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(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + 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 status Status values that need to be considered for filter + * @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(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 tags Tags to filter by + * @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(tags: Array, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 petId ID of pet to return + * @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(petId: number, observe?: 'body', reportProgress?: boolean): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 body Pet object that needs to be added to the store + * @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(body: Pet, observe?: 'body', reportProgress?: boolean): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @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(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + 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 petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @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(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + 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/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts new file mode 100644 index 000000000000..8fba3b49de87 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -0,0 +1,209 @@ +/** + * 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'; + + +@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 orderId ID of the order that needs to be deleted + * @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(orderId: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 orderId ID of pet that needs to be fetched + * @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(orderId: number, observe?: 'body', reportProgress?: boolean): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 body order placed for purchasing the pet + * @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(body: Order, observe?: 'body', reportProgress?: boolean): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts new file mode 100644 index 000000000000..a9fc0b74c1a6 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -0,0 +1,387 @@ +/** + * 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'; + + +@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 body Created user object + * @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(body: User, observe?: 'body', reportProgress?: boolean): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 body List of user object + * @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(body: Array, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 body List of user object + * @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(body: Array, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 username The name that needs to be deleted + * @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(username: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 username The name that needs to be fetched. Use user1 for testing. + * @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(username: string, observe?: 'body', reportProgress?: boolean): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + 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 username The user name for login + * @param password The password for login in clear text + * @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(username: string, password: string, observe?: 'body', reportProgress?: boolean): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + 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 username name that need to be deleted + * @param body Updated user object + * @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(username: string, body: User, observe?: 'body', reportProgress?: boolean): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + 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/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts new file mode 100644 index 000000000000..c038bbc94787 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/encoder.ts new file mode 100644 index 000000000000..cbefb4a6dd95 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/index.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/category.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/models.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/order.ts new file mode 100644 index 000000000000..c8d8a5e55c03 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/tag.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/model/user.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/ng-package.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/ng-package.json new file mode 100644 index 000000000000..3b17900dc9c3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/package.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/package.json new file mode 100644 index 000000000000..4704f50abdce --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/tsconfig.json new file mode 100644 index 000000000000..c01ebe255d4c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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/with-npm/variables.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/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-angularjs/.openapi-generator/VERSION b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angularjs/.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/client/petstore/typescript-angularjs/git_push.sh b/samples/client/petstore/typescript-angularjs/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-angularjs/git_push.sh +++ b/samples/client/petstore/typescript-angularjs/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.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/client/petstore/typescript-aurelia/default/git_push.sh b/samples/client/petstore/typescript-aurelia/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-aurelia/default/git_push.sh +++ b/samples/client/petstore/typescript-aurelia/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index a74fbd67faeb..3d4ced41f5a3 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -663,7 +665,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -678,7 +680,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -734,7 +736,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -750,7 +752,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1148,7 +1150,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1630,7 +1632,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1644,7 +1646,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1658,7 +1660,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1672,7 +1674,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1714,7 +1716,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1729,7 +1731,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/default/base.ts b/samples/client/petstore/typescript-axios/builds/default/base.ts index 05fbaa6ea4eb..64562bd0dd14 100644 --- a/samples/client/petstore/typescript-axios/builds/default/base.ts +++ b/samples/client/petstore/typescript-axios/builds/default/base.ts @@ -14,6 +14,8 @@ import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); diff --git a/samples/client/petstore/typescript-axios/builds/default/configuration.ts b/samples/client/petstore/typescript-axios/builds/default/configuration.ts index e53e30f35e37..d9929800b914 100644 --- a/samples/client/petstore/typescript-axios/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/default/configuration.ts @@ -70,5 +70,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/samples/client/petstore/typescript-axios/builds/default/git_push.sh b/samples/client/petstore/typescript-axios/builds/default/git_push.sh index 188eeaea7bca..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-axios/builds/default/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index a74fbd67faeb..3d4ced41f5a3 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -663,7 +665,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -678,7 +680,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -734,7 +736,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -750,7 +752,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1148,7 +1150,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1630,7 +1632,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1644,7 +1646,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1658,7 +1660,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1672,7 +1674,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1714,7 +1716,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1729,7 +1731,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/base.ts b/samples/client/petstore/typescript-axios/builds/es6-target/base.ts index 05fbaa6ea4eb..64562bd0dd14 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/base.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/base.ts @@ -14,6 +14,8 @@ import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts index e53e30f35e37..d9929800b914 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts @@ -70,5 +70,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh b/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh index 188eeaea7bca..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/es6-target/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 8414cbc351d1..7658f3616530 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -714,7 +716,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(pet, header1, header2, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -729,7 +731,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -785,7 +787,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(pet: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePet(pet: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(pet, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -801,7 +803,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1203,7 +1205,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1685,7 +1687,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(user: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUser(user: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(user, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1699,7 +1701,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(user: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithArrayInput(user: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(user, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1713,7 +1715,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(user: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithListInput(user: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(user, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1727,7 +1729,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1769,7 +1771,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1784,7 +1786,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, user: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updateUser(username: string, user: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, user, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts index 05fbaa6ea4eb..64562bd0dd14 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts @@ -14,6 +14,8 @@ import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts index e53e30f35e37..d9929800b914 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts @@ -70,5 +70,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh index 188eeaea7bca..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 2e124df78073..a6acb17b1c8a 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -663,7 +665,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -678,7 +680,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -734,7 +736,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -750,7 +752,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1241,7 +1243,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1770,7 +1772,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1784,7 +1786,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1798,7 +1800,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1812,7 +1814,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1854,7 +1856,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1869,7 +1871,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts index 05fbaa6ea4eb..64562bd0dd14 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts @@ -14,6 +14,8 @@ import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts index e53e30f35e37..d9929800b914 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts @@ -70,5 +70,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh index 188eeaea7bca..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 486d267caf23..a2d92d88e155 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../../../base'; import { ApiResponse } from '../../../model/some/levels/deep'; @@ -438,7 +440,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -453,7 +455,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -509,7 +511,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -525,7 +527,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index fde70168950e..4ba4f4c122d4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../../../base'; import { Order } from '../../../model/some/levels/deep'; @@ -186,7 +188,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index d8ded5b31dfb..a0122ec11077 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../../../base'; import { User } from '../../../model/some/levels/deep'; @@ -345,7 +347,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -359,7 +361,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -373,7 +375,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -387,7 +389,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -429,7 +431,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -444,7 +446,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts index 05fbaa6ea4eb..64562bd0dd14 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts @@ -14,6 +14,8 @@ import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts index e53e30f35e37..d9929800b914 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts @@ -70,5 +70,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh index 188eeaea7bca..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index a74fbd67faeb..3d4ced41f5a3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -16,6 +16,8 @@ import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -663,7 +665,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + addPet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -678,7 +680,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -734,7 +736,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePet(body: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -750,7 +752,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1148,7 +1150,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1630,7 +1632,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUser(body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1644,7 +1646,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithArrayInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1658,7 +1660,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + createUsersWithListInput(body: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1672,7 +1674,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1714,7 +1716,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -1729,7 +1731,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + updateUser(username: string, body: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts index 05fbaa6ea4eb..64562bd0dd14 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts @@ -14,6 +14,8 @@ import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts index e53e30f35e37..d9929800b914 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts @@ -70,5 +70,6 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.baseOptions = param.baseOptions; } } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh index 188eeaea7bca..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts index e43896cc2929..1b59ed3ef08a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -335,13 +335,26 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); + formParams.append('name', requestParameters.name as any); } if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); + formParams.append('status', requestParameters.status as any); } const response = await this.request({ @@ -349,15 +362,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -383,13 +396,28 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); } if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); + formParams.append('file', requestParameters.file as any); } const response = await this.request({ @@ -397,15 +425,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts index f8809dccbea3..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts @@ -33,17 +33,29 @@ export interface Category { } export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts index 8b8e2c45fecd..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts @@ -39,18 +39,30 @@ export interface ModelApiResponse { } export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'code': !exists(json, 'code') ? undefined : json['code'], 'type': !exists(json, 'type') ? undefined : json['type'], 'message': !exists(json, 'message') ? undefined : json['message'], }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'code': value.code, 'type': value.type, 'message': value.message, diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts index 6ce0496794f6..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts @@ -57,7 +57,15 @@ export interface Order { } export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], @@ -67,15 +75,19 @@ export function OrderFromJSON(json: any): Order { }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? 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/default/src/models/Pet.ts index 770f991b89d9..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts @@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime'; import { Category, CategoryFromJSON, + CategoryFromJSONTyped, CategoryToJSON, Tag, TagFromJSON, + TagFromJSONTyped, TagToJSON, } from './'; @@ -66,7 +68,15 @@ export interface Pet { } export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], @@ -76,16 +86,20 @@ export function PetFromJSON(json: any): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? 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/src/models/Tag.ts index 7c8098f6dc01..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts @@ -33,17 +33,29 @@ export interface Tag { } export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts index fd7430063f1c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts @@ -69,7 +69,15 @@ export interface User { } export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'username': !exists(json, 'username') ? undefined : json['username'], 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], @@ -81,11 +89,15 @@ export function UserFromJSON(json: any): User { }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'username': value.username, 'firstName': value.firstName, diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts index eec2074ab690..473d2e72316c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts @@ -195,7 +195,7 @@ export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; -export type HTTPBody = Json | FormData; +export type HTTPBody = Json | FormData | URLSearchParams; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface FetchParams { @@ -242,6 +242,19 @@ export function mapValues(data: any, fn: (item: any) => any) { ); } +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + export interface RequestContext { fetch: FetchAPI; url: string; 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json index 3ea8a1ec7069..478c94e3f2e2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json @@ -5,7 +5,7 @@ "author": "OpenAPI-Generator", "main": "./dist/index.js", "typings": "./dist/index.d.ts", - "scripts" : { + "scripts": { "build": "tsc", "prepare": "npm run build" }, diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts index e43896cc2929..1b59ed3ef08a 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -335,13 +335,26 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); + formParams.append('name', requestParameters.name as any); } if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); + formParams.append('status', requestParameters.status as any); } const response = await this.request({ @@ -349,15 +362,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -383,13 +396,28 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); } if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); + formParams.append('file', requestParameters.file as any); } const response = await this.request({ @@ -397,15 +425,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts index f8809dccbea3..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts @@ -33,17 +33,29 @@ export interface Category { } export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts index 8b8e2c45fecd..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts @@ -39,18 +39,30 @@ export interface ModelApiResponse { } export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'code': !exists(json, 'code') ? undefined : json['code'], 'type': !exists(json, 'type') ? undefined : json['type'], 'message': !exists(json, 'message') ? undefined : json['message'], }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'code': value.code, 'type': value.type, 'message': value.message, 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 6ce0496794f6..da4ad33711d6 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 @@ -57,7 +57,15 @@ export interface Order { } export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], @@ -67,15 +75,19 @@ export function OrderFromJSON(json: any): Order { }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? 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 770f991b89d9..8f921c6b159f 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 @@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime'; import { Category, CategoryFromJSON, + CategoryFromJSONTyped, CategoryToJSON, Tag, TagFromJSON, + TagFromJSONTyped, TagToJSON, } from './'; @@ -66,7 +68,15 @@ export interface Pet { } export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], @@ -76,16 +86,20 @@ export function PetFromJSON(json: any): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts index 7c8098f6dc01..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts @@ -33,17 +33,29 @@ export interface Tag { } export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts index fd7430063f1c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts @@ -69,7 +69,15 @@ export interface User { } export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'username': !exists(json, 'username') ? undefined : json['username'], 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], @@ -81,11 +89,15 @@ export function UserFromJSON(json: any): User { }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'username': value.username, 'firstName': value.firstName, diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index eec2074ab690..473d2e72316c 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -195,7 +195,7 @@ export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; -export type HTTPBody = Json | FormData; +export type HTTPBody = Json | FormData | URLSearchParams; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface FetchParams { @@ -242,6 +242,19 @@ export function mapValues(data: any, fn: (item: any) => any) { ); } +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + export interface RequestContext { fetch: FetchAPI; url: string; 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts index e3501ab3f26a..28a239690b88 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(body: Pet): Promise { await this.addPetRaw({ body: body }); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(petId: number, apiKey?: string): Promise { await this.deletePetRaw({ petId: petId, apiKey: apiKey }); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(status: Array): Promise> { const response = await this.findPetsByStatusRaw({ status: status }); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(tags: Array): Promise> { const response = await this.findPetsByTagsRaw({ tags: tags }); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(petId: number): Promise { const response = await this.getPetByIdRaw({ petId: petId }); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(body: Pet): Promise { await this.updatePetRaw({ body: body }); } @@ -335,13 +335,26 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); + formParams.append('name', requestParameters.name as any); } if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); + formParams.append('status', requestParameters.status as any); } const response = await this.request({ @@ -349,15 +362,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(petId: number, name?: string, status?: string): Promise { await this.updatePetWithFormRaw({ petId: petId, name: name, status: status }); } @@ -383,13 +396,28 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); } if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); + formParams.append('file', requestParameters.file as any); } const response = await this.request({ @@ -397,15 +425,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(petId: number, additionalMetadata?: string, file?: Blob): Promise { const response = await this.uploadFileRaw({ petId: petId, additionalMetadata: additionalMetadata, file: file }); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts index 5b3424aafba4..e8635189f620 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(orderId: string): Promise { await this.deleteOrderRaw({ orderId: orderId }); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(orderId: number): Promise { const response = await this.getOrderByIdRaw({ orderId: orderId }); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(body: Order): Promise { const response = await this.placeOrderRaw({ body: body }); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts index 443e52fe2c2f..ce75bed4fd16 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(body: User): Promise { await this.createUserRaw({ body: body }); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(body: Array): Promise { await this.createUsersWithArrayInputRaw({ body: body }); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(body: Array): Promise { await this.createUsersWithListInputRaw({ body: body }); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(username: string): Promise { await this.deleteUserRaw({ username: username }); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(username: string): Promise { const response = await this.getUserByNameRaw({ username: username }); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(username: string, password: string): Promise { const response = await this.loginUserRaw({ username: username, password: password }); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(username: string, body: User): Promise { await this.updateUserRaw({ username: username, body: body }); } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts index f8809dccbea3..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts @@ -33,17 +33,29 @@ export interface Category { } export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts index 8b8e2c45fecd..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts @@ -39,18 +39,30 @@ export interface ModelApiResponse { } export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'code': !exists(json, 'code') ? undefined : json['code'], 'type': !exists(json, 'type') ? undefined : json['type'], 'message': !exists(json, 'message') ? undefined : json['message'], }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'code': value.code, 'type': value.type, 'message': value.message, diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts index 6ce0496794f6..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts @@ -57,7 +57,15 @@ export interface Order { } export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], @@ -67,15 +75,19 @@ export function OrderFromJSON(json: any): Order { }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? 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/src/models/Pet.ts index 770f991b89d9..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts @@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime'; import { Category, CategoryFromJSON, + CategoryFromJSONTyped, CategoryToJSON, Tag, TagFromJSON, + TagFromJSONTyped, TagToJSON, } from './'; @@ -66,7 +68,15 @@ export interface Pet { } export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], @@ -76,16 +86,20 @@ export function PetFromJSON(json: any): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? 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/src/models/Tag.ts index 7c8098f6dc01..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts @@ -33,17 +33,29 @@ export interface Tag { } export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts index fd7430063f1c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts @@ -69,7 +69,15 @@ export interface User { } export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'username': !exists(json, 'username') ? undefined : json['username'], 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], @@ -81,11 +89,15 @@ export function UserFromJSON(json: any): User { }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'username': value.username, 'firstName': value.firstName, diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts index eec2074ab690..473d2e72316c 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts @@ -195,7 +195,7 @@ export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; -export type HTTPBody = Json | FormData; +export type HTTPBody = Json | FormData | URLSearchParams; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface FetchParams { @@ -242,6 +242,19 @@ export function mapValues(data: any, fn: (item: any) => any) { ); } +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + export interface RequestContext { fetch: FetchAPI; url: string; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.gitignore b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.npmignore b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.npmignore new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.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-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md new file mode 100644 index 000000000000..8c188be0ead2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md @@ -0,0 +1,45 @@ +## @openapitools/typescript-fetch-petstore@1.0.0 + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build and compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install @openapitools/typescript-fetch-petstore@1.0.0 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json new file mode 100644 index 000000000000..478c94e3f2e2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json @@ -0,0 +1,18 @@ +{ + "name": "@openapitools/typescript-fetch-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-fetch-petstore", + "author": "OpenAPI-Generator", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "build": "tsc", + "prepare": "npm run build" + }, + "devDependencies": { + "typescript": "^2.4" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml new file mode 100644 index 000000000000..35c073c7dcaf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + org.openapitools + TypeScriptFetchBuildPrefixParameterInterfacesPestoreClientTests + pom + 1.0-SNAPSHOT + TS Fetch Petstore Client (with namespacing for parameter interfaces) + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + integration-test + + exec + + + npm + + install + + + + + npm-build + integration-test + + exec + + + npm + + run + build + + + + + npm-test + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts new file mode 100644 index 000000000000..3bd5d9cf411d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/PetApi.ts @@ -0,0 +1,452 @@ +// tslint:disable +/** + * 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 * as runtime from '../runtime'; +import { + ModelApiResponse, + ModelApiResponseFromJSON, + ModelApiResponseToJSON, + Pet, + PetFromJSON, + PetToJSON, +} from '../models'; + +export interface PetApiAddPetRequest { + body: Pet; +} + +export interface PetApiDeletePetRequest { + petId: number; + apiKey?: string; +} + +export interface PetApiFindPetsByStatusRequest { + status: Array; +} + +export interface PetApiFindPetsByTagsRequest { + tags: Array; +} + +export interface PetApiGetPetByIdRequest { + petId: number; +} + +export interface PetApiUpdatePetRequest { + body: Pet; +} + +export interface PetApiUpdatePetWithFormRequest { + petId: number; + name?: string; + status?: string; +} + +export interface PetApiUploadFileRequest { + petId: number; + additionalMetadata?: string; + file?: Blob; +} + +/** + * no description + */ +export class PetApi extends runtime.BaseAPI { + + /** + * Add a new pet to the store + */ + async addPetRaw(requestParameters: PetApiAddPetRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling addPet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Add a new pet to the store + */ + async addPet(requestParameters: PetApiAddPetRequest): Promise { + await this.addPetRaw(requestParameters); + } + + /** + * Deletes a pet + */ + async deletePetRaw(requestParameters: PetApiDeletePetRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling deletePet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.apiKey !== undefined && requestParameters.apiKey !== null) { + headerParameters['api_key'] = String(requestParameters.apiKey); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Deletes a pet + */ + async deletePet(requestParameters: PetApiDeletePetRequest): Promise { + await this.deletePetRaw(requestParameters); + } + + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ + async findPetsByStatusRaw(requestParameters: PetApiFindPetsByStatusRequest): Promise>> { + if (requestParameters.status === null || requestParameters.status === undefined) { + throw new runtime.RequiredError('status','Required parameter requestParameters.status was null or undefined when calling findPetsByStatus.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.status) { + queryParameters['status'] = requestParameters.status.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet/findByStatus`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); + } + + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ + async findPetsByStatus(requestParameters: PetApiFindPetsByStatusRequest): Promise> { + const response = await this.findPetsByStatusRaw(requestParameters); + return await response.value(); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ + async findPetsByTagsRaw(requestParameters: PetApiFindPetsByTagsRequest): Promise>> { + if (requestParameters.tags === null || requestParameters.tags === undefined) { + throw new runtime.RequiredError('tags','Required parameter requestParameters.tags was null or undefined when calling findPetsByTags.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.tags) { + queryParameters['tags'] = requestParameters.tags.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet/findByTags`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ + async findPetsByTags(requestParameters: PetApiFindPetsByTagsRequest): Promise> { + const response = await this.findPetsByTagsRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a single pet + * Find pet by ID + */ + async getPetByIdRaw(requestParameters: PetApiGetPetByIdRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling getPetById.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + const response = await this.request({ + path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); + } + + /** + * Returns a single pet + * Find pet by ID + */ + async getPetById(requestParameters: PetApiGetPetByIdRequest): Promise { + const response = await this.getPetByIdRaw(requestParameters); + return await response.value(); + } + + /** + * Update an existing pet + */ + async updatePetRaw(requestParameters: PetApiUpdatePetRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updatePet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update an existing pet + */ + async updatePet(requestParameters: PetApiUpdatePetRequest): Promise { + await this.updatePetRaw(requestParameters); + } + + /** + * Updates a pet in the store with form data + */ + async updatePetWithFormRaw(requestParameters: PetApiUpdatePetWithFormRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling updatePetWithForm.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.name !== undefined) { + formParams.append('name', requestParameters.name as any); + } + + if (requestParameters.status !== undefined) { + formParams.append('status', requestParameters.status as any); + } + + const response = await this.request({ + path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Updates a pet in the store with form data + */ + async updatePetWithForm(requestParameters: PetApiUpdatePetWithFormRequest): Promise { + await this.updatePetWithFormRaw(requestParameters); + } + + /** + * uploads an image + */ + async uploadFileRaw(requestParameters: PetApiUploadFileRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling uploadFile.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.additionalMetadata !== undefined) { + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); + } + + if (requestParameters.file !== undefined) { + formParams.append('file', requestParameters.file as any); + } + + const response = await this.request({ + path: `/pet/{petId}/uploadImage`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); + } + + /** + * uploads an image + */ + async uploadFile(requestParameters: PetApiUploadFileRequest): Promise { + const response = await this.uploadFileRaw(requestParameters); + return await response.value(); + } + +} + +/** + * @export + * @enum {string} + */ +export enum FindPetsByStatusStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts new file mode 100644 index 000000000000..cfe73a1da647 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts @@ -0,0 +1,167 @@ +// tslint:disable +/** + * 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 * as runtime from '../runtime'; +import { + Order, + OrderFromJSON, + OrderToJSON, +} from '../models'; + +export interface StoreApiDeleteOrderRequest { + orderId: string; +} + +export interface StoreApiGetOrderByIdRequest { + orderId: number; +} + +export interface StoreApiPlaceOrderRequest { + body: Order; +} + +/** + * no description + */ +export class StoreApi extends runtime.BaseAPI { + + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ + async deleteOrderRaw(requestParameters: StoreApiDeleteOrderRequest): Promise> { + if (requestParameters.orderId === null || requestParameters.orderId === undefined) { + throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling deleteOrder.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/store/order/{orderId}`.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters.orderId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ + async deleteOrder(requestParameters: StoreApiDeleteOrderRequest): Promise { + await this.deleteOrderRaw(requestParameters); + } + + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ + async getInventoryRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + const response = await this.request({ + path: `/store/inventory`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ + async getInventory(): Promise<{ [key: string]: number; }> { + const response = await this.getInventoryRaw(); + return await response.value(); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ + async getOrderByIdRaw(requestParameters: StoreApiGetOrderByIdRequest): Promise> { + if (requestParameters.orderId === null || requestParameters.orderId === undefined) { + throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling getOrderById.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/store/order/{orderId}`.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters.orderId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ + async getOrderById(requestParameters: StoreApiGetOrderByIdRequest): Promise { + const response = await this.getOrderByIdRaw(requestParameters); + return await response.value(); + } + + /** + * Place an order for a pet + */ + async placeOrderRaw(requestParameters: StoreApiPlaceOrderRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling placeOrder.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/store/order`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OrderToJSON(requestParameters.body), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); + } + + /** + * Place an order for a pet + */ + async placeOrder(requestParameters: StoreApiPlaceOrderRequest): Promise { + const response = await this.placeOrderRaw(requestParameters); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts new file mode 100644 index 000000000000..f28cd54fc893 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/UserApi.ts @@ -0,0 +1,321 @@ +// tslint:disable +/** + * 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 * as runtime from '../runtime'; +import { + User, + UserFromJSON, + UserToJSON, +} from '../models'; + +export interface UserApiCreateUserRequest { + body: User; +} + +export interface UserApiCreateUsersWithArrayInputRequest { + body: Array; +} + +export interface UserApiCreateUsersWithListInputRequest { + body: Array; +} + +export interface UserApiDeleteUserRequest { + username: string; +} + +export interface UserApiGetUserByNameRequest { + username: string; +} + +export interface UserApiLoginUserRequest { + username: string; + password: string; +} + +export interface UserApiUpdateUserRequest { + username: string; + body: User; +} + +/** + * no description + */ +export class UserApi extends runtime.BaseAPI { + + /** + * This can only be done by the logged in user. + * Create user + */ + async createUserRaw(requestParameters: UserApiCreateUserRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Create user + */ + async createUser(requestParameters: UserApiCreateUserRequest): Promise { + await this.createUserRaw(requestParameters); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithArrayInputRaw(requestParameters: UserApiCreateUsersWithArrayInputRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithArrayInput.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user/createWithArray`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.body.map(UserToJSON), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithArrayInput(requestParameters: UserApiCreateUsersWithArrayInputRequest): Promise { + await this.createUsersWithArrayInputRaw(requestParameters); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithListInputRaw(requestParameters: UserApiCreateUsersWithListInputRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithListInput.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user/createWithList`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.body.map(UserToJSON), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithListInput(requestParameters: UserApiCreateUsersWithListInputRequest): Promise { + await this.createUsersWithListInputRaw(requestParameters); + } + + /** + * This can only be done by the logged in user. + * Delete user + */ + async deleteUserRaw(requestParameters: UserApiDeleteUserRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling deleteUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Delete user + */ + async deleteUser(requestParameters: UserApiDeleteUserRequest): Promise { + await this.deleteUserRaw(requestParameters); + } + + /** + * Get user by user name + */ + async getUserByNameRaw(requestParameters: UserApiGetUserByNameRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling getUserByName.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Get user by user name + */ + async getUserByName(requestParameters: UserApiGetUserByNameRequest): Promise { + const response = await this.getUserByNameRaw(requestParameters); + return await response.value(); + } + + /** + * Logs user into the system + */ + async loginUserRaw(requestParameters: UserApiLoginUserRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling loginUser.'); + } + + if (requestParameters.password === null || requestParameters.password === undefined) { + throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling loginUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.username !== undefined) { + queryParameters['username'] = requestParameters.username; + } + + if (requestParameters.password !== undefined) { + queryParameters['password'] = requestParameters.password; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/login`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Logs user into the system + */ + async loginUser(requestParameters: UserApiLoginUserRequest): Promise { + const response = await this.loginUserRaw(requestParameters); + return await response.value(); + } + + /** + * Logs out current logged in user session + */ + async logoutUserRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/logout`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Logs out current logged in user session + */ + async logoutUser(): Promise { + await this.logoutUserRaw(); + } + + /** + * This can only be done by the logged in user. + * Updated user + */ + async updateUserRaw(requestParameters: UserApiUpdateUserRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.'); + } + + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Updated user + */ + async updateUser(requestParameters: UserApiUpdateUserRequest): Promise { + await this.updateUserRaw(requestParameters); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/index.ts new file mode 100644 index 000000000000..056206bfaca3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/index.ts @@ -0,0 +1,3 @@ +export * from './PetApi'; +export * from './StoreApi'; +export * from './UserApi'; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/index.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/index.ts new file mode 100644 index 000000000000..848ecfa4d100 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/index.ts @@ -0,0 +1,3 @@ +export * from './runtime'; +export * from './apis'; +export * from './models'; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts new file mode 100644 index 000000000000..7e3076d412d2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts @@ -0,0 +1,64 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + +export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + }; +} + +export function CategoryToJSON(value?: Category | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts new file mode 100644 index 000000000000..c89b98fc62be --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts @@ -0,0 +1,72 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * Describes the result of uploading an image resource + * @export + * @interface ModelApiResponse + */ +export interface ModelApiResponse { + /** + * + * @type {number} + * @memberof ModelApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + message?: string; +} + +export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'code': !exists(json, 'code') ? undefined : json['code'], + 'type': !exists(json, 'type') ? undefined : json['type'], + 'message': !exists(json, 'message') ? undefined : json['message'], + }; +} + +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'code': value.code, + 'type': value.type, + 'message': value.message, + }; +} + + 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 new file mode 100644 index 000000000000..da4ad33711d6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts @@ -0,0 +1,106 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + +export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + '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']), + 'status': !exists(json, 'status') ? undefined : json['status'], + 'complete': !exists(json, 'complete') ? undefined : json['complete'], + }; +} + +export function OrderToJSON(value?: Order | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'petId': value.petId, + 'quantity': value.quantity, + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'status': value.status, + 'complete': value.complete, + }; +} + +/** +* @export +* @enum {string} +*/ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + + 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 new file mode 100644 index 000000000000..8f921c6b159f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts @@ -0,0 +1,117 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +import { + Category, + CategoryFromJSON, + CategoryFromJSONTyped, + CategoryToJSON, + Tag, + TagFromJSON, + TagFromJSONTyped, + TagToJSON, +} from './'; + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + +export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + '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), + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function PetToJSON(value?: Pet | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'category': CategoryToJSON(value.category), + 'name': value.name, + 'photoUrls': value.photoUrls, + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'status': value.status, + }; +} + +/** +* @export +* @enum {string} +*/ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts new file mode 100644 index 000000000000..5ea1fd63e818 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts @@ -0,0 +1,64 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + +export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + }; +} + +export function TagToJSON(value?: Tag | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts new file mode 100644 index 000000000000..302960bfef96 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts @@ -0,0 +1,112 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'username': !exists(json, 'username') ? undefined : json['username'], + 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], + 'lastName': !exists(json, 'lastName') ? undefined : json['lastName'], + 'email': !exists(json, 'email') ? undefined : json['email'], + 'password': !exists(json, 'password') ? undefined : json['password'], + 'phone': !exists(json, 'phone') ? undefined : json['phone'], + 'userStatus': !exists(json, 'userStatus') ? undefined : json['userStatus'], + }; +} + +export function UserToJSON(value?: User | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'username': value.username, + 'firstName': value.firstName, + 'lastName': value.lastName, + 'email': value.email, + 'password': value.password, + 'phone': value.phone, + 'userStatus': value.userStatus, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/index.ts new file mode 100644 index 000000000000..b07ddc8446a0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/index.ts @@ -0,0 +1,6 @@ +export * from './Category'; +export * from './ModelApiResponse'; +export * from './Order'; +export * from './Pet'; +export * from './Tag'; +export * from './User'; diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts new file mode 100644 index 000000000000..473d2e72316c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts @@ -0,0 +1,315 @@ +// tslint:disable +/** + * 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. + */ + + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +const isBlob = (value: any) => typeof Blob !== 'undefined' && value instanceof Blob; + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private middleware: Middleware[]; + + constructor(protected configuration = new Configuration()) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + protected async request(context: RequestOpts): Promise { + const { url, init } = this.createFetchParams(context); + const response = await this.fetchApi(url, init); + if (response.status >= 200 && response.status < 300) { + return response; + } + throw response; + } + + private createFetchParams(context: RequestOpts) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + const body = (context.body instanceof FormData || isBlob(context.body)) + ? context.body + : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); + const init = { + method: context.method, + headers: headers, + body, + credentials: this.configuration.credentials + }; + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response = await this.configuration.fetchApi(fetchParams.url, fetchParams.init); + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url, + init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = GlobalFetch['fetch']; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + get basePath(): string { + return this.configuration.basePath || BASE_PATH; + } + + get fetchApi(): FetchAPI { + return this.configuration.fetchApi || window.fetch.bind(window); + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map((key) => { + const fullKey = prefix + (prefix.length ? `[${key}]` : key); + const value = params[key]; + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; + }) + .filter(part => part.length > 0) + .join('&'); +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value() { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value() { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value() { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value() { + return await this.raw.text(); + }; +} diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/tsconfig.json new file mode 100644 index 000000000000..4567ec19899a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/tsconfig.json @@ -0,0 +1,20 @@ +{ + "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/typescript-three-plus/.gitignore b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.npmignore b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.npmignore new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.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-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/README.md b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/README.md new file mode 100644 index 000000000000..8c188be0ead2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/README.md @@ -0,0 +1,45 @@ +## @openapitools/typescript-fetch-petstore@1.0.0 + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build and compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install @openapitools/typescript-fetch-petstore@1.0.0 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/package.json b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/package.json new file mode 100644 index 000000000000..96268c493a59 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/package.json @@ -0,0 +1,18 @@ +{ + "name": "@openapitools/typescript-fetch-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-fetch-petstore", + "author": "OpenAPI-Generator", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "build": "tsc", + "prepare": "npm run build" + }, + "devDependencies": { + "typescript": "^3.6" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts new file mode 100644 index 000000000000..1b59ed3ef08a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/PetApi.ts @@ -0,0 +1,452 @@ +// tslint:disable +/** + * 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 * as runtime from '../runtime'; +import { + ModelApiResponse, + ModelApiResponseFromJSON, + ModelApiResponseToJSON, + Pet, + PetFromJSON, + PetToJSON, +} from '../models'; + +export interface AddPetRequest { + body: Pet; +} + +export interface DeletePetRequest { + petId: number; + apiKey?: string; +} + +export interface FindPetsByStatusRequest { + status: Array; +} + +export interface FindPetsByTagsRequest { + tags: Array; +} + +export interface GetPetByIdRequest { + petId: number; +} + +export interface UpdatePetRequest { + body: Pet; +} + +export interface UpdatePetWithFormRequest { + petId: number; + name?: string; + status?: string; +} + +export interface UploadFileRequest { + petId: number; + additionalMetadata?: string; + file?: Blob; +} + +/** + * no description + */ +export class PetApi extends runtime.BaseAPI { + + /** + * Add a new pet to the store + */ + async addPetRaw(requestParameters: AddPetRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling addPet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Add a new pet to the store + */ + async addPet(requestParameters: AddPetRequest): Promise { + await this.addPetRaw(requestParameters); + } + + /** + * Deletes a pet + */ + async deletePetRaw(requestParameters: DeletePetRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling deletePet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.apiKey !== undefined && requestParameters.apiKey !== null) { + headerParameters['api_key'] = String(requestParameters.apiKey); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Deletes a pet + */ + async deletePet(requestParameters: DeletePetRequest): Promise { + await this.deletePetRaw(requestParameters); + } + + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ + async findPetsByStatusRaw(requestParameters: FindPetsByStatusRequest): Promise>> { + if (requestParameters.status === null || requestParameters.status === undefined) { + throw new runtime.RequiredError('status','Required parameter requestParameters.status was null or undefined when calling findPetsByStatus.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.status) { + queryParameters['status'] = requestParameters.status.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet/findByStatus`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); + } + + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ + async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { + const response = await this.findPetsByStatusRaw(requestParameters); + return await response.value(); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ + async findPetsByTagsRaw(requestParameters: FindPetsByTagsRequest): Promise>> { + if (requestParameters.tags === null || requestParameters.tags === undefined) { + throw new runtime.RequiredError('tags','Required parameter requestParameters.tags was null or undefined when calling findPetsByTags.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.tags) { + queryParameters['tags'] = requestParameters.tags.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet/findByTags`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ + async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { + const response = await this.findPetsByTagsRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a single pet + * Find pet by ID + */ + async getPetByIdRaw(requestParameters: GetPetByIdRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling getPetById.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + const response = await this.request({ + path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); + } + + /** + * Returns a single pet + * Find pet by ID + */ + async getPetById(requestParameters: GetPetByIdRequest): Promise { + const response = await this.getPetByIdRaw(requestParameters); + return await response.value(); + } + + /** + * Update an existing pet + */ + async updatePetRaw(requestParameters: UpdatePetRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updatePet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const response = await this.request({ + path: `/pet`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update an existing pet + */ + async updatePet(requestParameters: UpdatePetRequest): Promise { + await this.updatePetRaw(requestParameters); + } + + /** + * Updates a pet in the store with form data + */ + async updatePetWithFormRaw(requestParameters: UpdatePetWithFormRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling updatePetWithForm.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.name !== undefined) { + formParams.append('name', requestParameters.name as any); + } + + if (requestParameters.status !== undefined) { + formParams.append('status', requestParameters.status as any); + } + + const response = await this.request({ + path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Updates a pet in the store with form data + */ + async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { + await this.updatePetWithFormRaw(requestParameters); + } + + /** + * uploads an image + */ + async uploadFileRaw(requestParameters: UploadFileRequest): Promise> { + if (requestParameters.petId === null || requestParameters.petId === undefined) { + throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling uploadFile.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + if (typeof this.configuration.accessToken === 'function') { + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } else { + headerParameters["Authorization"] = this.configuration.accessToken; + } + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters.additionalMetadata !== undefined) { + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); + } + + if (requestParameters.file !== undefined) { + formParams.append('file', requestParameters.file as any); + } + + const response = await this.request({ + path: `/pet/{petId}/uploadImage`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); + } + + /** + * uploads an image + */ + async uploadFile(requestParameters: UploadFileRequest): Promise { + const response = await this.uploadFileRaw(requestParameters); + return await response.value(); + } + +} + +/** + * @export + * @enum {string} + */ +export enum FindPetsByStatusStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts new file mode 100644 index 000000000000..4b645dea987e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/StoreApi.ts @@ -0,0 +1,167 @@ +// tslint:disable +/** + * 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 * as runtime from '../runtime'; +import { + Order, + OrderFromJSON, + OrderToJSON, +} from '../models'; + +export interface DeleteOrderRequest { + orderId: string; +} + +export interface GetOrderByIdRequest { + orderId: number; +} + +export interface PlaceOrderRequest { + body: Order; +} + +/** + * no description + */ +export class StoreApi extends runtime.BaseAPI { + + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ + async deleteOrderRaw(requestParameters: DeleteOrderRequest): Promise> { + if (requestParameters.orderId === null || requestParameters.orderId === undefined) { + throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling deleteOrder.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/store/order/{orderId}`.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters.orderId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ + async deleteOrder(requestParameters: DeleteOrderRequest): Promise { + await this.deleteOrderRaw(requestParameters); + } + + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ + async getInventoryRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication + } + + const response = await this.request({ + path: `/store/inventory`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ + async getInventory(): Promise<{ [key: string]: number; }> { + const response = await this.getInventoryRaw(); + return await response.value(); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ + async getOrderByIdRaw(requestParameters: GetOrderByIdRequest): Promise> { + if (requestParameters.orderId === null || requestParameters.orderId === undefined) { + throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling getOrderById.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/store/order/{orderId}`.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters.orderId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ + async getOrderById(requestParameters: GetOrderByIdRequest): Promise { + const response = await this.getOrderByIdRaw(requestParameters); + return await response.value(); + } + + /** + * Place an order for a pet + */ + async placeOrderRaw(requestParameters: PlaceOrderRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling placeOrder.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/store/order`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OrderToJSON(requestParameters.body), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); + } + + /** + * Place an order for a pet + */ + async placeOrder(requestParameters: PlaceOrderRequest): Promise { + const response = await this.placeOrderRaw(requestParameters); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts new file mode 100644 index 000000000000..4126b817ee94 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/UserApi.ts @@ -0,0 +1,321 @@ +// tslint:disable +/** + * 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 * as runtime from '../runtime'; +import { + User, + UserFromJSON, + UserToJSON, +} from '../models'; + +export interface CreateUserRequest { + body: User; +} + +export interface CreateUsersWithArrayInputRequest { + body: Array; +} + +export interface CreateUsersWithListInputRequest { + body: Array; +} + +export interface DeleteUserRequest { + username: string; +} + +export interface GetUserByNameRequest { + username: string; +} + +export interface LoginUserRequest { + username: string; + password: string; +} + +export interface UpdateUserRequest { + username: string; + body: User; +} + +/** + * no description + */ +export class UserApi extends runtime.BaseAPI { + + /** + * This can only be done by the logged in user. + * Create user + */ + async createUserRaw(requestParameters: CreateUserRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Create user + */ + async createUser(requestParameters: CreateUserRequest): Promise { + await this.createUserRaw(requestParameters); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithArrayInput.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user/createWithArray`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.body.map(UserToJSON), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { + await this.createUsersWithArrayInputRaw(requestParameters); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithListInput.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user/createWithList`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.body.map(UserToJSON), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Creates list of users with given input array + */ + async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { + await this.createUsersWithListInputRaw(requestParameters); + } + + /** + * This can only be done by the logged in user. + * Delete user + */ + async deleteUserRaw(requestParameters: DeleteUserRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling deleteUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Delete user + */ + async deleteUser(requestParameters: DeleteUserRequest): Promise { + await this.deleteUserRaw(requestParameters); + } + + /** + * Get user by user name + */ + async getUserByNameRaw(requestParameters: GetUserByNameRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling getUserByName.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * Get user by user name + */ + async getUserByName(requestParameters: GetUserByNameRequest): Promise { + const response = await this.getUserByNameRaw(requestParameters); + return await response.value(); + } + + /** + * Logs user into the system + */ + async loginUserRaw(requestParameters: LoginUserRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling loginUser.'); + } + + if (requestParameters.password === null || requestParameters.password === undefined) { + throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling loginUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.username !== undefined) { + queryParameters['username'] = requestParameters.username; + } + + if (requestParameters.password !== undefined) { + queryParameters['password'] = requestParameters.password; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/login`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Logs user into the system + */ + async loginUser(requestParameters: LoginUserRequest): Promise { + const response = await this.loginUserRaw(requestParameters); + return await response.value(); + } + + /** + * Logs out current logged in user session + */ + async logoutUserRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/user/logout`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Logs out current logged in user session + */ + async logoutUser(): Promise { + await this.logoutUserRaw(); + } + + /** + * This can only be done by the logged in user. + * Updated user + */ + async updateUserRaw(requestParameters: UpdateUserRequest): Promise> { + if (requestParameters.username === null || requestParameters.username === undefined) { + throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.'); + } + + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateUser.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters.body), + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Updated user + */ + async updateUser(requestParameters: UpdateUserRequest): Promise { + await this.updateUserRaw(requestParameters); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/index.ts new file mode 100644 index 000000000000..056206bfaca3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/apis/index.ts @@ -0,0 +1,3 @@ +export * from './PetApi'; +export * from './StoreApi'; +export * from './UserApi'; diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/index.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/index.ts new file mode 100644 index 000000000000..848ecfa4d100 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/index.ts @@ -0,0 +1,3 @@ +export * from './runtime'; +export * from './apis'; +export * from './models'; diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts new file mode 100644 index 000000000000..7e3076d412d2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Category.ts @@ -0,0 +1,64 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + +export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + }; +} + +export function CategoryToJSON(value?: Category | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts new file mode 100644 index 000000000000..c89b98fc62be --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/ModelApiResponse.ts @@ -0,0 +1,72 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * Describes the result of uploading an image resource + * @export + * @interface ModelApiResponse + */ +export interface ModelApiResponse { + /** + * + * @type {number} + * @memberof ModelApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + message?: string; +} + +export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'code': !exists(json, 'code') ? undefined : json['code'], + 'type': !exists(json, 'type') ? undefined : json['type'], + 'message': !exists(json, 'message') ? undefined : json['message'], + }; +} + +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'code': value.code, + 'type': value.type, + 'message': value.message, + }; +} + + 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 new file mode 100644 index 000000000000..da4ad33711d6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Order.ts @@ -0,0 +1,106 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + +export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + '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']), + 'status': !exists(json, 'status') ? undefined : json['status'], + 'complete': !exists(json, 'complete') ? undefined : json['complete'], + }; +} + +export function OrderToJSON(value?: Order | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'petId': value.petId, + 'quantity': value.quantity, + 'shipDate': value.shipDate == null ? undefined : value.shipDate.toISOString(), + 'status': value.status, + 'complete': value.complete, + }; +} + +/** +* @export +* @enum {string} +*/ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + + 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 new file mode 100644 index 000000000000..8f921c6b159f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts @@ -0,0 +1,117 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +import { + Category, + CategoryFromJSON, + CategoryFromJSONTyped, + CategoryToJSON, + Tag, + TagFromJSON, + TagFromJSONTyped, + TagToJSON, +} from './'; + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + +export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + '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), + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function PetToJSON(value?: Pet | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'category': CategoryToJSON(value.category), + 'name': value.name, + 'photoUrls': value.photoUrls, + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), + 'status': value.status, + }; +} + +/** +* @export +* @enum {string} +*/ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts new file mode 100644 index 000000000000..5ea1fd63e818 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Tag.ts @@ -0,0 +1,64 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + +export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + }; +} + +export function TagToJSON(value?: Tag | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts new file mode 100644 index 000000000000..302960bfef96 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/User.ts @@ -0,0 +1,112 @@ +// tslint:disable +/** + * 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 { exists, mapValues } from '../runtime'; +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'username': !exists(json, 'username') ? undefined : json['username'], + 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], + 'lastName': !exists(json, 'lastName') ? undefined : json['lastName'], + 'email': !exists(json, 'email') ? undefined : json['email'], + 'password': !exists(json, 'password') ? undefined : json['password'], + 'phone': !exists(json, 'phone') ? undefined : json['phone'], + 'userStatus': !exists(json, 'userStatus') ? undefined : json['userStatus'], + }; +} + +export function UserToJSON(value?: User | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'username': value.username, + 'firstName': value.firstName, + 'lastName': value.lastName, + 'email': value.email, + 'password': value.password, + 'phone': value.phone, + 'userStatus': value.userStatus, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/index.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/index.ts new file mode 100644 index 000000000000..b07ddc8446a0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/index.ts @@ -0,0 +1,6 @@ +export * from './Category'; +export * from './ModelApiResponse'; +export * from './Order'; +export * from './Pet'; +export * from './Tag'; +export * from './User'; diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts new file mode 100644 index 000000000000..aa2ef6158928 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/runtime.ts @@ -0,0 +1,315 @@ +// tslint:disable +/** + * 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. + */ + + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +const isBlob = (value: any) => typeof Blob !== 'undefined' && value instanceof Blob; + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private middleware: Middleware[]; + + constructor(protected configuration = new Configuration()) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + protected async request(context: RequestOpts): Promise { + const { url, init } = this.createFetchParams(context); + const response = await this.fetchApi(url, init); + if (response.status >= 200 && response.status < 300) { + return response; + } + throw response; + } + + private createFetchParams(context: RequestOpts) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + const body = (context.body instanceof FormData || isBlob(context.body)) + ? context.body + : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); + const init = { + method: context.method, + headers: headers, + body, + credentials: this.configuration.credentials + }; + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response = await this.configuration.fetchApi(fetchParams.url, fetchParams.init); + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url, + init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + get basePath(): string { + return this.configuration.basePath || BASE_PATH; + } + + get fetchApi(): FetchAPI { + return this.configuration.fetchApi || window.fetch.bind(window); + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map((key) => { + const fullKey = prefix + (prefix.length ? `[${key}]` : key); + const value = params[key]; + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; + }) + .filter(part => part.length > 0) + .join('&'); +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value() { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value() { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value() { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value() { + return await this.raw.text(); + }; +} diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/tsconfig.json new file mode 100644 index 000000000000..4567ec19899a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/tsconfig.json @@ -0,0 +1,20 @@ +{ + "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-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts index e43896cc2929..1b59ed3ef08a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -335,13 +335,26 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); + formParams.append('name', requestParameters.name as any); } if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); + formParams.append('status', requestParameters.status as any); } const response = await this.request({ @@ -349,15 +362,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -383,13 +396,28 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); } if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); + formParams.append('file', requestParameters.file as any); } const response = await this.request({ @@ -397,15 +425,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts index f8809dccbea3..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts @@ -33,17 +33,29 @@ export interface Category { } export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts index 8b8e2c45fecd..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts @@ -39,18 +39,30 @@ export interface ModelApiResponse { } export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'code': !exists(json, 'code') ? undefined : json['code'], 'type': !exists(json, 'type') ? undefined : json['type'], 'message': !exists(json, 'message') ? undefined : json['message'], }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'code': value.code, 'type': value.type, 'message': value.message, diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts index 6ce0496794f6..da4ad33711d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts @@ -57,7 +57,15 @@ export interface Order { } export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], @@ -67,15 +75,19 @@ export function OrderFromJSON(json: any): Order { }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? 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/with-interfaces/src/models/Pet.ts index 770f991b89d9..8f921c6b159f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts @@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime'; import { Category, CategoryFromJSON, + CategoryFromJSONTyped, CategoryToJSON, Tag, TagFromJSON, + TagFromJSONTyped, TagToJSON, } from './'; @@ -66,7 +68,15 @@ export interface Pet { } export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], @@ -76,16 +86,20 @@ export function PetFromJSON(json: any): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? 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/src/models/Tag.ts index 7c8098f6dc01..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts @@ -33,17 +33,29 @@ export interface Tag { } export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts index fd7430063f1c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts @@ -69,7 +69,15 @@ export interface User { } export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'username': !exists(json, 'username') ? undefined : json['username'], 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], @@ -81,11 +89,15 @@ export function UserFromJSON(json: any): User { }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'username': value.username, 'firstName': value.firstName, diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts index eec2074ab690..473d2e72316c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts @@ -195,7 +195,7 @@ export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; -export type HTTPBody = Json | FormData; +export type HTTPBody = Json | FormData | URLSearchParams; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface FetchParams { @@ -242,6 +242,19 @@ export function mapValues(data: any, fn: (item: any) => any) { ); } +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + export interface RequestContext { fetch: FetchAPI; url: string; 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json index 3ea8a1ec7069..478c94e3f2e2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json @@ -5,7 +5,7 @@ "author": "OpenAPI-Generator", "main": "./dist/index.js", "typings": "./dist/index.d.ts", - "scripts" : { + "scripts": { "build": "tsc", "prepare": "npm run build" }, diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts index e43896cc2929..1b59ed3ef08a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts @@ -98,9 +98,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Add a new pet to the store - */ + /** + * Add a new pet to the store + */ async addPet(requestParameters: AddPetRequest): Promise { await this.addPetRaw(requestParameters); } @@ -140,9 +140,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Deletes a pet - */ + /** + * Deletes a pet + */ async deletePet(requestParameters: DeletePetRequest): Promise { await this.deletePetRaw(requestParameters); } @@ -183,10 +183,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple status values can be provided with comma separated strings - * Finds Pets by status - */ + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ async findPetsByStatus(requestParameters: FindPetsByStatusRequest): Promise> { const response = await this.findPetsByStatusRaw(requestParameters); return await response.value(); @@ -228,10 +228,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Finds Pets by tags - */ + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + */ async findPetsByTags(requestParameters: FindPetsByTagsRequest): Promise> { const response = await this.findPetsByTagsRaw(requestParameters); return await response.value(); @@ -264,10 +264,10 @@ export class PetApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); } - /** - * Returns a single pet - * Find pet by ID - */ + /** + * Returns a single pet + * Find pet by ID + */ async getPetById(requestParameters: GetPetByIdRequest): Promise { const response = await this.getPetByIdRaw(requestParameters); return await response.value(); @@ -307,9 +307,9 @@ export class PetApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Update an existing pet - */ + /** + * Update an existing pet + */ async updatePet(requestParameters: UpdatePetRequest): Promise { await this.updatePetRaw(requestParameters); } @@ -335,13 +335,26 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); + formParams.append('name', requestParameters.name as any); } if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); + formParams.append('status', requestParameters.status as any); } const response = await this.request({ @@ -349,15 +362,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.VoidApiResponse(response); } - /** - * Updates a pet in the store with form data - */ + /** + * Updates a pet in the store with form data + */ async updatePetWithForm(requestParameters: UpdatePetWithFormRequest): Promise { await this.updatePetWithFormRaw(requestParameters); } @@ -383,13 +396,28 @@ export class PetApi extends runtime.BaseAPI { } } - const formData = new FormData(); + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); + formParams.append('additionalMetadata', requestParameters.additionalMetadata as any); } if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); + formParams.append('file', requestParameters.file as any); } const response = await this.request({ @@ -397,15 +425,15 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: formData, + body: formParams, }); return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); } - /** - * uploads an image - */ + /** + * uploads an image + */ async uploadFile(requestParameters: UploadFileRequest): Promise { const response = await this.uploadFileRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts index 916660981657..4b645dea987e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts @@ -59,10 +59,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete purchase order by ID - */ + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ async deleteOrder(requestParameters: DeleteOrderRequest): Promise { await this.deleteOrderRaw(requestParameters); } @@ -90,10 +90,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); } - /** - * Returns a map of status codes to quantities - * Returns pet inventories by status - */ + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ async getInventory(): Promise<{ [key: string]: number; }> { const response = await this.getInventoryRaw(); return await response.value(); @@ -122,10 +122,10 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Find purchase order by ID - */ + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID + */ async getOrderById(requestParameters: GetOrderByIdRequest): Promise { const response = await this.getOrderByIdRaw(requestParameters); return await response.value(); @@ -156,9 +156,9 @@ export class StoreApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); } - /** - * Place an order for a pet - */ + /** + * Place an order for a pet + */ async placeOrder(requestParameters: PlaceOrderRequest): Promise { const response = await this.placeOrderRaw(requestParameters); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts index 1696b600f57f..4126b817ee94 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts @@ -80,10 +80,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Create user - */ + /** + * This can only be done by the logged in user. + * Create user + */ async createUser(requestParameters: CreateUserRequest): Promise { await this.createUserRaw(requestParameters); } @@ -113,9 +113,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest): Promise { await this.createUsersWithArrayInputRaw(requestParameters); } @@ -145,9 +145,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Creates list of users with given input array - */ + /** + * Creates list of users with given input array + */ async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest): Promise { await this.createUsersWithListInputRaw(requestParameters); } @@ -175,10 +175,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Delete user - */ + /** + * This can only be done by the logged in user. + * Delete user + */ async deleteUser(requestParameters: DeleteUserRequest): Promise { await this.deleteUserRaw(requestParameters); } @@ -205,9 +205,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); } - /** - * Get user by user name - */ + /** + * Get user by user name + */ async getUserByName(requestParameters: GetUserByNameRequest): Promise { const response = await this.getUserByNameRaw(requestParameters); return await response.value(); @@ -247,9 +247,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.TextApiResponse(response); } - /** - * Logs user into the system - */ + /** + * Logs user into the system + */ async loginUser(requestParameters: LoginUserRequest): Promise { const response = await this.loginUserRaw(requestParameters); return await response.value(); @@ -273,9 +273,9 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * Logs out current logged in user session - */ + /** + * Logs out current logged in user session + */ async logoutUser(): Promise { await this.logoutUserRaw(); } @@ -310,10 +310,10 @@ export class UserApi extends runtime.BaseAPI { return new runtime.VoidApiResponse(response); } - /** - * This can only be done by the logged in user. - * Updated user - */ + /** + * This can only be done by the logged in user. + * Updated user + */ async updateUser(requestParameters: UpdateUserRequest): Promise { await this.updateUserRaw(requestParameters); } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts index f8809dccbea3..7e3076d412d2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts @@ -33,17 +33,29 @@ export interface Category { } export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function CategoryToJSON(value?: Category): any { +export function CategoryToJSON(value?: Category | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts index 8b8e2c45fecd..c89b98fc62be 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts @@ -39,18 +39,30 @@ export interface ModelApiResponse { } export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'code': !exists(json, 'code') ? undefined : json['code'], 'type': !exists(json, 'type') ? undefined : json['type'], 'message': !exists(json, 'message') ? undefined : json['message'], }; } -export function ModelApiResponseToJSON(value?: ModelApiResponse): any { +export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'code': value.code, 'type': value.type, 'message': value.message, 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 6ce0496794f6..da4ad33711d6 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 @@ -57,7 +57,15 @@ export interface Order { } export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'petId': !exists(json, 'petId') ? undefined : json['petId'], 'quantity': !exists(json, 'quantity') ? undefined : json['quantity'], @@ -67,15 +75,19 @@ export function OrderFromJSON(json: any): Order { }; } -export function OrderToJSON(value?: Order): any { +export function OrderToJSON(value?: Order | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'petId': value.petId, 'quantity': value.quantity, - 'shipDate': value.shipDate === undefined ? undefined : value.shipDate.toISOString(), + 'shipDate': value.shipDate == null ? 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 770f991b89d9..8f921c6b159f 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 @@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime'; import { Category, CategoryFromJSON, + CategoryFromJSONTyped, CategoryToJSON, Tag, TagFromJSON, + TagFromJSONTyped, TagToJSON, } from './'; @@ -66,7 +68,15 @@ export interface Pet { } export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']), 'name': json['name'], @@ -76,16 +86,20 @@ export function PetFromJSON(json: any): Pet { }; } -export function PetToJSON(value?: Pet): any { +export function PetToJSON(value?: Pet | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'category': CategoryToJSON(value.category), 'name': value.name, 'photoUrls': value.photoUrls, - 'tags': value.tags === undefined ? undefined : (value.tags as Array).map(TagToJSON), + 'tags': value.tags == null ? undefined : (value.tags as Array).map(TagToJSON), 'status': value.status, }; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts index 7c8098f6dc01..5ea1fd63e818 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts @@ -33,17 +33,29 @@ export interface Tag { } export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': !exists(json, 'name') ? undefined : json['name'], }; } -export function TagToJSON(value?: Tag): any { +export function TagToJSON(value?: Tag | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'name': value.name, }; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts index fd7430063f1c..302960bfef96 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts @@ -69,7 +69,15 @@ export interface User { } export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if ((json === undefined) || (json === null)) { + return json; + } return { + 'id': !exists(json, 'id') ? undefined : json['id'], 'username': !exists(json, 'username') ? undefined : json['username'], 'firstName': !exists(json, 'firstName') ? undefined : json['firstName'], @@ -81,11 +89,15 @@ export function UserFromJSON(json: any): User { }; } -export function UserToJSON(value?: User): any { +export function UserToJSON(value?: User | null): any { if (value === undefined) { return undefined; } + if (value === null) { + return null; + } return { + 'id': value.id, 'username': value.username, 'firstName': value.firstName, diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index eec2074ab690..473d2e72316c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -195,7 +195,7 @@ export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; -export type HTTPBody = Json | FormData; +export type HTTPBody = Json | FormData | URLSearchParams; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface FetchParams { @@ -242,6 +242,19 @@ export function mapValues(data: any, fn: (item: any) => any) { ); } +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string +} + export interface RequestContext { fetch: FetchAPI; url: string; diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.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/client/petstore/typescript-inversify/HttpClient.ts b/samples/client/petstore/typescript-inversify/HttpClient.ts index 391f48529770..4a9745c654d1 100644 --- a/samples/client/petstore/typescript-inversify/HttpClient.ts +++ b/samples/client/petstore/typescript-inversify/HttpClient.ts @@ -14,15 +14,15 @@ class HttpClient implements IHttpClient { return this.performNetworkCall(url, "GET", undefined, headers); } - post(url: string, body: {}|FormData, headers?: Headers): Observable { + post(url: string, body?: {}|FormData, headers?: Headers): Observable { return this.performNetworkCall(url, "POST", this.getJsonBody(body), this.addJsonHeaders(headers)); } - put(url: string, body: {}, headers?: Headers): Observable { + put(url: string, body?: {}, headers?: Headers): Observable { return this.performNetworkCall(url, "PUT", this.getJsonBody(body), this.addJsonHeaders(headers)); } - patch(url: string, body: {}, headers?: Headers): Observable { + patch(url: string, body?: {}, headers?: Headers): Observable { return this.performNetworkCall(url, "PATCH", this.getJsonBody(body), this.addJsonHeaders(headers)); } @@ -31,11 +31,14 @@ class HttpClient implements IHttpClient { return this.performNetworkCall(url, "DELETE", undefined, headers); } - private getJsonBody(body: {}|FormData) { - return !(body instanceof FormData) ? JSON.stringify(body) : body; + private getJsonBody(body?: {}|FormData) { + if (body === undefined || body instanceof FormData) { + return body; + } + return JSON.stringify(body); } - private addJsonHeaders(headers: Headers) { + private addJsonHeaders(headers?: Headers) { return Object.assign({}, { "Accept": "application/json", "Content-Type": "application/json" @@ -67,4 +70,4 @@ class HttpClient implements IHttpClient { } } -export default HttpClient \ No newline at end of file +export default HttpClient diff --git a/samples/client/petstore/typescript-inversify/IHttpClient.ts b/samples/client/petstore/typescript-inversify/IHttpClient.ts index 09f8fff96dbb..51064868934b 100644 --- a/samples/client/petstore/typescript-inversify/IHttpClient.ts +++ b/samples/client/petstore/typescript-inversify/IHttpClient.ts @@ -4,9 +4,9 @@ import { Headers } from "./Headers"; interface IHttpClient { get(url:string, headers?: Headers):Observable - post(url:string, body:{}|FormData, headers?: Headers):Observable - put(url:string, body:{}, headers?: Headers):Observable - patch(url:string, body:{}, headers?: Headers):Observable + post(url:string, body?:{}|FormData, headers?: Headers):Observable + put(url:string, body?:{}, headers?: Headers):Observable + patch(url:string, body?:{}, headers?: Headers):Observable delete(url:string, headers?: Headers):Observable } diff --git a/samples/client/petstore/typescript-inversify/api/pet.service.ts b/samples/client/petstore/typescript-inversify/api/pet.service.ts index 06dbd62cdf39..37a5bf4004ca 100644 --- a/samples/client/petstore/typescript-inversify/api/pet.service.ts +++ b/samples/client/petstore/typescript-inversify/api/pet.service.ts @@ -46,7 +46,7 @@ export class PetService { public addPet(body: Pet, observe?: 'body', headers?: Headers): Observable; public addPet(body: Pet, observe?: 'response', headers?: Headers): Observable>; public addPet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -80,7 +80,7 @@ export class PetService { public deletePet(petId: number, apiKey?: string, observe?: 'body', headers?: Headers): Observable; public deletePet(petId: number, apiKey?: string, observe?: 'response', headers?: Headers): Observable>; public deletePet(petId: number, apiKey?: string, observe: any = 'body', headers: Headers = {}): Observable { - if (!petId){ + if (petId === null || petId === undefined){ throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -116,7 +116,7 @@ export class PetService { public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', headers?: Headers): Observable>; public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', headers?: Headers): Observable>>; public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', headers: Headers = {}): Observable { - if (!status){ + if (status === null || status === undefined){ throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -132,7 +132,7 @@ export class PetService { : this.APIConfiguration.accessToken; headers['Authorization'] = 'Bearer ' + accessToken; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; const response: Observable>> = this.httpClient.get(`${this.basePath}/pet/findByStatus?${queryParameters.join('&')}`, headers); if (observe == 'body') { @@ -153,7 +153,7 @@ export class PetService { public findPetsByTags(tags: Array, observe?: 'body', headers?: Headers): Observable>; public findPetsByTags(tags: Array, observe?: 'response', headers?: Headers): Observable>>; public findPetsByTags(tags: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!tags){ + if (tags === null || tags === undefined){ throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -169,7 +169,7 @@ export class PetService { : this.APIConfiguration.accessToken; headers['Authorization'] = 'Bearer ' + accessToken; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; const response: Observable>> = this.httpClient.get(`${this.basePath}/pet/findByTags?${queryParameters.join('&')}`, headers); if (observe == 'body') { @@ -190,7 +190,7 @@ export class PetService { public getPetById(petId: number, observe?: 'body', headers?: Headers): Observable; public getPetById(petId: number, observe?: 'response', headers?: Headers): Observable>; public getPetById(petId: number, observe: any = 'body', headers: Headers = {}): Observable { - if (!petId){ + if (petId === null || petId === undefined){ throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -198,7 +198,7 @@ export class PetService { if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys["api_key"]) { headers['api_key'] = this.APIConfiguration.apiKeys["api_key"]; } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, headers); if (observe == 'body') { @@ -219,7 +219,7 @@ export class PetService { public updatePet(body: Pet, observe?: 'body', headers?: Headers): Observable; public updatePet(body: Pet, observe?: 'response', headers?: Headers): Observable>; public updatePet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -254,7 +254,7 @@ export class PetService { public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', headers?: Headers): Observable; public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', headers?: Headers): Observable>; public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', headers: Headers = {}): Observable { - if (!petId){ + if (petId === null || petId === undefined){ throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -297,7 +297,7 @@ export class PetService { public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', headers?: Headers): Observable; public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', headers?: Headers): Observable>; public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', headers: Headers = {}): Observable { - if (!petId){ + if (petId === null || petId === undefined){ throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } diff --git a/samples/client/petstore/typescript-inversify/api/store.service.ts b/samples/client/petstore/typescript-inversify/api/store.service.ts index 778e00e5c3ae..b383a6937d5c 100644 --- a/samples/client/petstore/typescript-inversify/api/store.service.ts +++ b/samples/client/petstore/typescript-inversify/api/store.service.ts @@ -45,7 +45,7 @@ export class StoreService { public deleteOrder(orderId: string, observe?: 'body', headers?: Headers): Observable; public deleteOrder(orderId: string, observe?: 'response', headers?: Headers): Observable>; public deleteOrder(orderId: string, observe: any = 'body', headers: Headers = {}): Observable { - if (!orderId){ + if (orderId === null || orderId === undefined){ throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -94,11 +94,11 @@ export class StoreService { public getOrderById(orderId: number, observe?: 'body', headers?: Headers): Observable; public getOrderById(orderId: number, observe?: 'response', headers?: Headers): Observable>; public getOrderById(orderId: number, observe: any = 'body', headers: Headers = {}): Observable { - if (!orderId){ + if (orderId === null || orderId === undefined){ throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, headers); if (observe == 'body') { @@ -119,11 +119,11 @@ export class StoreService { public placeOrder(body: Order, observe?: 'body', headers?: Headers): Observable; public placeOrder(body: Order, observe?: 'response', headers?: Headers): Observable>; public placeOrder(body: Order, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, body , headers); diff --git a/samples/client/petstore/typescript-inversify/api/user.service.ts b/samples/client/petstore/typescript-inversify/api/user.service.ts index f2e8b83c4ab6..a2c15a745413 100644 --- a/samples/client/petstore/typescript-inversify/api/user.service.ts +++ b/samples/client/petstore/typescript-inversify/api/user.service.ts @@ -45,7 +45,7 @@ export class UserService { public createUser(body: User, observe?: 'body', headers?: Headers): Observable; public createUser(body: User, observe?: 'response', headers?: Headers): Observable>; public createUser(body: User, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -71,7 +71,7 @@ export class UserService { public createUsersWithArrayInput(body: Array, observe?: 'body', headers?: Headers): Observable; public createUsersWithArrayInput(body: Array, observe?: 'response', headers?: Headers): Observable>; public createUsersWithArrayInput(body: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -97,7 +97,7 @@ export class UserService { public createUsersWithListInput(body: Array, observe?: 'body', headers?: Headers): Observable; public createUsersWithListInput(body: Array, observe?: 'response', headers?: Headers): Observable>; public createUsersWithListInput(body: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -123,7 +123,7 @@ export class UserService { public deleteUser(username: string, observe?: 'body', headers?: Headers): Observable; public deleteUser(username: string, observe?: 'response', headers?: Headers): Observable>; public deleteUser(username: string, observe: any = 'body', headers: Headers = {}): Observable { - if (!username){ + if (username === null || username === undefined){ throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -148,11 +148,11 @@ export class UserService { public getUserByName(username: string, observe?: 'body', headers?: Headers): Observable; public getUserByName(username: string, observe?: 'response', headers?: Headers): Observable>; public getUserByName(username: string, observe: any = 'body', headers: Headers = {}): Observable { - if (!username){ + if (username === null || username === undefined){ throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); if (observe == 'body') { @@ -174,11 +174,11 @@ export class UserService { public loginUser(username: string, password: string, observe?: 'body', headers?: Headers): Observable; public loginUser(username: string, password: string, observe?: 'response', headers?: Headers): Observable>; public loginUser(username: string, password: string, observe: any = 'body', headers: Headers = {}): Observable { - if (!username){ + if (username === null || username === undefined){ throw new Error('Required parameter username was null or undefined when calling loginUser.'); } - if (!password){ + if (password === null || password === undefined){ throw new Error('Required parameter password was null or undefined when calling loginUser.'); } @@ -190,7 +190,7 @@ export class UserService { queryParameters.push("password="+encodeURIComponent(String(password))); } - headers['Accept'] = 'application/xml'; + headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/login?${queryParameters.join('&')}`, headers); if (observe == 'body') { @@ -232,11 +232,11 @@ export class UserService { public updateUser(username: string, body: User, observe?: 'body', headers?: Headers): Observable; public updateUser(username: string, body: User, observe?: 'response', headers?: Headers): Observable>; public updateUser(username: string, body: User, observe: any = 'body', headers: Headers = {}): Observable { - if (!username){ + if (username === null || username === undefined){ throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (!body){ + if (body === null || body === undefined){ throw new Error('Required parameter body was null or undefined when calling updateUser.'); } diff --git a/samples/client/petstore/typescript-inversify/model/inlineObject.ts b/samples/client/petstore/typescript-inversify/model/inlineObject.ts index 7ebc2ff49162..0b51164ddb6e 100644 --- a/samples/client/petstore/typescript-inversify/model/inlineObject.ts +++ b/samples/client/petstore/typescript-inversify/model/inlineObject.ts @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-inversify/model/inlineObject1.ts b/samples/client/petstore/typescript-inversify/model/inlineObject1.ts index 3f35ccedd9be..de83a67ccc31 100644 --- a/samples/client/petstore/typescript-inversify/model/inlineObject1.ts +++ b/samples/client/petstore/typescript-inversify/model/inlineObject1.ts @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.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/client/petstore/typescript-jquery/default/git_push.sh b/samples/client/petstore/typescript-jquery/default/git_push.sh index d90bf7f1e1e0..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-jquery/default/git_push.sh +++ b/samples/client/petstore/typescript-jquery/default/git_push.sh @@ -1,11 +1,17 @@ #!/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-petstore-typescript-jquery "minor update" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.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/client/petstore/typescript-jquery/npm/git_push.sh b/samples/client/petstore/typescript-jquery/npm/git_push.sh index d90bf7f1e1e0..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-jquery/npm/git_push.sh +++ b/samples/client/petstore/typescript-jquery/npm/git_push.sh @@ -1,11 +1,17 @@ #!/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-petstore-typescript-jquery "minor update" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.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/client/petstore/typescript-node/default/api/apis.ts b/samples/client/petstore/typescript-node/default/api/apis.ts index 2bbfc445eaf0..d3fb76d4a5ab 100644 --- a/samples/client/petstore/typescript-node/default/api/apis.ts +++ b/samples/client/petstore/typescript-node/default/api/apis.ts @@ -4,4 +4,11 @@ export * from './storeApi'; import { StoreApi } from './storeApi'; export * from './userApi'; import { UserApi } from './userApi'; +import http = require('http'); +export class HttpError extends Error { + constructor (public response: http.ClientResponse, public body: any, public statusCode?: number) { + super('HTTP request failed'); + this.name = 'HttpError'; + } +} export const APIS = [PetApi, StoreApi, UserApi]; diff --git a/samples/client/petstore/typescript-node/default/api/petApi.ts b/samples/client/petstore/typescript-node/default/api/petApi.ts index 2566d2b93533..c8b43c5a7621 100644 --- a/samples/client/petstore/typescript-node/default/api/petApi.ts +++ b/samples/client/petstore/typescript-node/default/api/petApi.ts @@ -18,8 +18,9 @@ import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; -import { OAuth } from '../model/models'; -import { ApiKeyAuth } from '../model/models'; +import { HttpBasicAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError } from './apis'; let defaultBasePath = 'http://petstore.swagger.io/v2'; @@ -129,7 +130,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -188,7 +189,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -249,7 +250,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -310,7 +311,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -368,7 +369,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -425,7 +426,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -492,7 +493,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -561,7 +562,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/samples/client/petstore/typescript-node/default/api/storeApi.ts b/samples/client/petstore/typescript-node/default/api/storeApi.ts index cf3b545a3d04..d8f6013e7c26 100644 --- a/samples/client/petstore/typescript-node/default/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/default/api/storeApi.ts @@ -17,7 +17,9 @@ import http = require('http'); import { Order } from '../model/order'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; -import { ApiKeyAuth } from '../model/models'; +import { HttpBasicAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError } from './apis'; let defaultBasePath = 'http://petstore.swagger.io/v2'; @@ -120,7 +122,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -171,7 +173,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -227,7 +229,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -283,7 +285,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/samples/client/petstore/typescript-node/default/api/userApi.ts b/samples/client/petstore/typescript-node/default/api/userApi.ts index 374daf1f1bdf..eab57a38e453 100644 --- a/samples/client/petstore/typescript-node/default/api/userApi.ts +++ b/samples/client/petstore/typescript-node/default/api/userApi.ts @@ -18,6 +18,8 @@ import { User } from '../model/user'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; +import { HttpError } from './apis'; + let defaultBasePath = 'http://petstore.swagger.io/v2'; // =============================================== @@ -117,7 +119,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -172,7 +174,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -227,7 +229,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -282,7 +284,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -338,7 +340,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -407,7 +409,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -455,7 +457,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -517,7 +519,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/samples/client/petstore/typescript-node/default/git_push.sh b/samples/client/petstore/typescript-node/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-node/default/git_push.sh +++ b/samples/client/petstore/typescript-node/default/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-node/default/model/inlineObject.ts b/samples/client/petstore/typescript-node/default/model/inlineObject.ts index ceaabe7df489..b9396dae34fa 100644 --- a/samples/client/petstore/typescript-node/default/model/inlineObject.ts +++ b/samples/client/petstore/typescript-node/default/model/inlineObject.ts @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-node/default/model/inlineObject1.ts b/samples/client/petstore/typescript-node/default/model/inlineObject1.ts index b3e23fb84381..a9c57cdab63e 100644 --- a/samples/client/petstore/typescript-node/default/model/inlineObject1.ts +++ b/samples/client/petstore/typescript-node/default/model/inlineObject1.ts @@ -2,7 +2,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 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-node/default/model/models.ts b/samples/client/petstore/typescript-node/default/model/models.ts index 73d5122442a0..7aea0f15444c 100644 --- a/samples/client/petstore/typescript-node/default/model/models.ts +++ b/samples/client/petstore/typescript-node/default/model/models.ts @@ -25,7 +25,7 @@ let primitives = [ "number", "any" ]; - + let enumsMap: {[index: string]: any} = { "Order.StatusEnum": Order.StatusEnum, "Pet.StatusEnum": Pet.StatusEnum, @@ -99,7 +99,7 @@ export class ObjectSerializer { if (!typeMap[type]) { // in case we dont know the type return data; } - + // Get the actual type of this object type = this.findCorrectType(data, type); @@ -180,6 +180,13 @@ export class ApiKeyAuth implements Authentication { (requestOptions.qs)[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { requestOptions.headers[this.paramName] = this.apiKey; + } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { + if (requestOptions.headers['Cookie']) { + requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey); + } + else { + requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey); + } } } } diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.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/client/petstore/typescript-node/npm/api/apis.ts b/samples/client/petstore/typescript-node/npm/api/apis.ts index 2bbfc445eaf0..d3fb76d4a5ab 100644 --- a/samples/client/petstore/typescript-node/npm/api/apis.ts +++ b/samples/client/petstore/typescript-node/npm/api/apis.ts @@ -4,4 +4,11 @@ export * from './storeApi'; import { StoreApi } from './storeApi'; export * from './userApi'; import { UserApi } from './userApi'; +import http = require('http'); +export class HttpError extends Error { + constructor (public response: http.ClientResponse, public body: any, public statusCode?: number) { + super('HTTP request failed'); + this.name = 'HttpError'; + } +} export const APIS = [PetApi, StoreApi, UserApi]; diff --git a/samples/client/petstore/typescript-node/npm/api/petApi.ts b/samples/client/petstore/typescript-node/npm/api/petApi.ts index 2566d2b93533..c8b43c5a7621 100644 --- a/samples/client/petstore/typescript-node/npm/api/petApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/petApi.ts @@ -18,8 +18,9 @@ import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; -import { OAuth } from '../model/models'; -import { ApiKeyAuth } from '../model/models'; +import { HttpBasicAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError } from './apis'; let defaultBasePath = 'http://petstore.swagger.io/v2'; @@ -129,7 +130,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -188,7 +189,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -249,7 +250,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -310,7 +311,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -368,7 +369,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -425,7 +426,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -492,7 +493,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -561,7 +562,7 @@ export class PetApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/samples/client/petstore/typescript-node/npm/api/storeApi.ts b/samples/client/petstore/typescript-node/npm/api/storeApi.ts index cf3b545a3d04..d8f6013e7c26 100644 --- a/samples/client/petstore/typescript-node/npm/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/storeApi.ts @@ -17,7 +17,9 @@ import http = require('http'); import { Order } from '../model/order'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; -import { ApiKeyAuth } from '../model/models'; +import { HttpBasicAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError } from './apis'; let defaultBasePath = 'http://petstore.swagger.io/v2'; @@ -120,7 +122,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -171,7 +173,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -227,7 +229,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -283,7 +285,7 @@ export class StoreApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/samples/client/petstore/typescript-node/npm/api/userApi.ts b/samples/client/petstore/typescript-node/npm/api/userApi.ts index 374daf1f1bdf..eab57a38e453 100644 --- a/samples/client/petstore/typescript-node/npm/api/userApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/userApi.ts @@ -18,6 +18,8 @@ import { User } from '../model/user'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; +import { HttpError } from './apis'; + let defaultBasePath = 'http://petstore.swagger.io/v2'; // =============================================== @@ -117,7 +119,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -172,7 +174,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -227,7 +229,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -282,7 +284,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -338,7 +340,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -407,7 +409,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -455,7 +457,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); @@ -517,7 +519,7 @@ export class UserApi { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { - reject({ response: response, body: body }); + reject(new HttpError(response, body, response.statusCode)); } } }); diff --git a/samples/client/petstore/typescript-node/npm/client.ts b/samples/client/petstore/typescript-node/npm/client.ts index 1dc7593c31c3..9bd1d10f7c42 100644 --- a/samples/client/petstore/typescript-node/npm/client.ts +++ b/samples/client/petstore/typescript-node/npm/client.ts @@ -155,5 +155,16 @@ petApi.addPet(pet) }) .then((res) => { console.log('Deleted pet'); - process.exit(exitCode); + // process.exit(exitCode); + petApi.deletePet(petId).then((res) => { + throw new Error('Unexpected success'); + }).catch((e) => { + if (e instanceof Error && e.name === 'HttpError' && e.message === 'HTTP request failed') { + console.log('Throws Http Errors correctly'); + process.exit(exitCode); + } else { + throw new Error(`Throws unexpected error:\n ${e}`); + } + }); + // process.exit(exitCode); }); diff --git a/samples/client/petstore/typescript-node/npm/git_push.sh b/samples/client/petstore/typescript-node/npm/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/typescript-node/npm/git_push.sh +++ b/samples/client/petstore/typescript-node/npm/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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-node/npm/model/models.ts b/samples/client/petstore/typescript-node/npm/model/models.ts index 73d5122442a0..7aea0f15444c 100644 --- a/samples/client/petstore/typescript-node/npm/model/models.ts +++ b/samples/client/petstore/typescript-node/npm/model/models.ts @@ -25,7 +25,7 @@ let primitives = [ "number", "any" ]; - + let enumsMap: {[index: string]: any} = { "Order.StatusEnum": Order.StatusEnum, "Pet.StatusEnum": Pet.StatusEnum, @@ -99,7 +99,7 @@ export class ObjectSerializer { if (!typeMap[type]) { // in case we dont know the type return data; } - + // Get the actual type of this object type = this.findCorrectType(data, type); @@ -180,6 +180,13 @@ export class ApiKeyAuth implements Authentication { (requestOptions.qs)[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { requestOptions.headers[this.paramName] = this.apiKey; + } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { + if (requestOptions.headers['Cookie']) { + requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey); + } + else { + requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey); + } } } } 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts index 1d8a5f001102..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts @@ -82,7 +82,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Deletes a pet @@ -105,7 +105,7 @@ export class PetApi extends BaseAPI { method: 'DELETE', headers, }); - } + }; /** * Multiple status values can be provided with comma separated strings @@ -133,7 +133,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -161,7 +161,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Returns a single pet @@ -179,7 +179,7 @@ export class PetApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * Update an existing pet @@ -203,7 +203,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Updates a pet in the store with form data @@ -235,7 +235,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; /** * uploads an image @@ -267,7 +267,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts index b3e038e89481..623b48bdede8 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts @@ -45,7 +45,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'DELETE', }); - } + }; /** * Returns a map of status codes to quantities @@ -61,7 +61,7 @@ export class StoreApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -74,7 +74,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'GET', }); - } + }; /** * Place an order for a pet @@ -92,6 +92,6 @@ export class StoreApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts index c356d96e91cd..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts @@ -69,7 +69,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -87,7 +87,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -105,7 +105,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * This can only be done by the logged in user. @@ -118,7 +118,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'DELETE', }); - } + }; /** * Get user by user name @@ -130,7 +130,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'GET', }); - } + }; /** * Logs user into the system @@ -149,7 +149,7 @@ export class UserApi extends BaseAPI { method: 'GET', query, }); - } + }; /** * Logs out current logged in user session @@ -159,7 +159,7 @@ export class UserApi extends BaseAPI { path: '/user/logout', method: 'GET', }); - } + }; /** * This can only be done by the logged in user. @@ -179,6 +179,6 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts index 01e3bb106fe4..1bbd8633b299 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts @@ -76,7 +76,7 @@ export class BaseAPI { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; - } + }; withPreMiddleware = (preMiddlewares: Array) => this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); @@ -84,7 +84,7 @@ export class BaseAPI { withPostMiddleware = (postMiddlewares: Array) => this.withMiddleware(postMiddlewares.map((post) => ({ post }))); - protected request = (requestOpts: RequestOpts): Observable => + protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { if (res.status >= 200 && res.status < 300) { @@ -102,17 +102,17 @@ export class BaseAPI { // do not handle correctly sometimes. url += '?' + queryString(requestOpts.query); } - + return { url, method: requestOpts.method, headers: requestOpts.headers, body: requestOpts.body instanceof FormData ? requestOpts.body : JSON.stringify(requestOpts.body), - responseType: requestOpts.responseType || 'json' + responseType: requestOpts.responseType || 'json', }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: RequestArgs): Observable => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); @@ -133,7 +133,7 @@ export class BaseAPI { * and then shallow cloning data members. */ private clone = (): T => - Object.assign(Object.create(Object.getPrototypeOf(this)), this) + Object.assign(Object.create(Object.getPrototypeOf(this)), this); } // export for not being a breaking change @@ -149,7 +149,7 @@ export const COLLECTION_FORMATS = { }; export type Json = any; -export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; export type HttpBody = Json | FormData; @@ -164,7 +164,7 @@ export interface RequestOpts { responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } -export const encodeURI = (value: any) => encodeURIComponent(String(value)) +export const encodeURI = (value: any) => encodeURIComponent(String(value)); const queryString = (params: HttpQuery): string => Object.keys(params) .map((key) => { @@ -182,7 +182,7 @@ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickn if (!params || params[key] === null || params[key] === undefined) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } -} +}; // alias for easier importing export interface RequestArgs extends AjaxRequest {} 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts index 1d8a5f001102..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts @@ -82,7 +82,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Deletes a pet @@ -105,7 +105,7 @@ export class PetApi extends BaseAPI { method: 'DELETE', headers, }); - } + }; /** * Multiple status values can be provided with comma separated strings @@ -133,7 +133,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -161,7 +161,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Returns a single pet @@ -179,7 +179,7 @@ export class PetApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * Update an existing pet @@ -203,7 +203,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Updates a pet in the store with form data @@ -235,7 +235,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; /** * uploads an image @@ -267,7 +267,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts index b3e038e89481..623b48bdede8 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts @@ -45,7 +45,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'DELETE', }); - } + }; /** * Returns a map of status codes to quantities @@ -61,7 +61,7 @@ export class StoreApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -74,7 +74,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'GET', }); - } + }; /** * Place an order for a pet @@ -92,6 +92,6 @@ export class StoreApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts index c356d96e91cd..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts @@ -69,7 +69,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -87,7 +87,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -105,7 +105,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * This can only be done by the logged in user. @@ -118,7 +118,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'DELETE', }); - } + }; /** * Get user by user name @@ -130,7 +130,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'GET', }); - } + }; /** * Logs user into the system @@ -149,7 +149,7 @@ export class UserApi extends BaseAPI { method: 'GET', query, }); - } + }; /** * Logs out current logged in user session @@ -159,7 +159,7 @@ export class UserApi extends BaseAPI { path: '/user/logout', method: 'GET', }); - } + }; /** * This can only be done by the logged in user. @@ -179,6 +179,6 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts index 01e3bb106fe4..1bbd8633b299 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts @@ -76,7 +76,7 @@ export class BaseAPI { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; - } + }; withPreMiddleware = (preMiddlewares: Array) => this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); @@ -84,7 +84,7 @@ export class BaseAPI { withPostMiddleware = (postMiddlewares: Array) => this.withMiddleware(postMiddlewares.map((post) => ({ post }))); - protected request = (requestOpts: RequestOpts): Observable => + protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { if (res.status >= 200 && res.status < 300) { @@ -102,17 +102,17 @@ export class BaseAPI { // do not handle correctly sometimes. url += '?' + queryString(requestOpts.query); } - + return { url, method: requestOpts.method, headers: requestOpts.headers, body: requestOpts.body instanceof FormData ? requestOpts.body : JSON.stringify(requestOpts.body), - responseType: requestOpts.responseType || 'json' + responseType: requestOpts.responseType || 'json', }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: RequestArgs): Observable => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); @@ -133,7 +133,7 @@ export class BaseAPI { * and then shallow cloning data members. */ private clone = (): T => - Object.assign(Object.create(Object.getPrototypeOf(this)), this) + Object.assign(Object.create(Object.getPrototypeOf(this)), this); } // export for not being a breaking change @@ -149,7 +149,7 @@ export const COLLECTION_FORMATS = { }; export type Json = any; -export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; export type HttpBody = Json | FormData; @@ -164,7 +164,7 @@ export interface RequestOpts { responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } -export const encodeURI = (value: any) => encodeURIComponent(String(value)) +export const encodeURI = (value: any) => encodeURIComponent(String(value)); const queryString = (params: HttpQuery): string => Object.keys(params) .map((key) => { @@ -182,7 +182,7 @@ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickn if (!params || params[key] === null || params[key] === undefined) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } -} +}; // alias for easier importing export interface RequestArgs extends AjaxRequest {} 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts index 1d8a5f001102..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts @@ -82,7 +82,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Deletes a pet @@ -105,7 +105,7 @@ export class PetApi extends BaseAPI { method: 'DELETE', headers, }); - } + }; /** * Multiple status values can be provided with comma separated strings @@ -133,7 +133,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -161,7 +161,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Returns a single pet @@ -179,7 +179,7 @@ export class PetApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * Update an existing pet @@ -203,7 +203,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Updates a pet in the store with form data @@ -235,7 +235,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; /** * uploads an image @@ -267,7 +267,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts index b3e038e89481..623b48bdede8 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts @@ -45,7 +45,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'DELETE', }); - } + }; /** * Returns a map of status codes to quantities @@ -61,7 +61,7 @@ export class StoreApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -74,7 +74,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'GET', }); - } + }; /** * Place an order for a pet @@ -92,6 +92,6 @@ export class StoreApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts index c356d96e91cd..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts @@ -69,7 +69,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -87,7 +87,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -105,7 +105,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * This can only be done by the logged in user. @@ -118,7 +118,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'DELETE', }); - } + }; /** * Get user by user name @@ -130,7 +130,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'GET', }); - } + }; /** * Logs user into the system @@ -149,7 +149,7 @@ export class UserApi extends BaseAPI { method: 'GET', query, }); - } + }; /** * Logs out current logged in user session @@ -159,7 +159,7 @@ export class UserApi extends BaseAPI { path: '/user/logout', method: 'GET', }); - } + }; /** * This can only be done by the logged in user. @@ -179,6 +179,6 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts index 01e3bb106fe4..1bbd8633b299 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts @@ -76,7 +76,7 @@ export class BaseAPI { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; - } + }; withPreMiddleware = (preMiddlewares: Array) => this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); @@ -84,7 +84,7 @@ export class BaseAPI { withPostMiddleware = (postMiddlewares: Array) => this.withMiddleware(postMiddlewares.map((post) => ({ post }))); - protected request = (requestOpts: RequestOpts): Observable => + protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { if (res.status >= 200 && res.status < 300) { @@ -102,17 +102,17 @@ export class BaseAPI { // do not handle correctly sometimes. url += '?' + queryString(requestOpts.query); } - + return { url, method: requestOpts.method, headers: requestOpts.headers, body: requestOpts.body instanceof FormData ? requestOpts.body : JSON.stringify(requestOpts.body), - responseType: requestOpts.responseType || 'json' + responseType: requestOpts.responseType || 'json', }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: RequestArgs): Observable => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); @@ -133,7 +133,7 @@ export class BaseAPI { * and then shallow cloning data members. */ private clone = (): T => - Object.assign(Object.create(Object.getPrototypeOf(this)), this) + Object.assign(Object.create(Object.getPrototypeOf(this)), this); } // export for not being a breaking change @@ -149,7 +149,7 @@ export const COLLECTION_FORMATS = { }; export type Json = any; -export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; export type HttpBody = Json | FormData; @@ -164,7 +164,7 @@ export interface RequestOpts { responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } -export const encodeURI = (value: any) => encodeURIComponent(String(value)) +export const encodeURI = (value: any) => encodeURIComponent(String(value)); const queryString = (params: HttpQuery): string => Object.keys(params) .map((key) => { @@ -182,7 +182,7 @@ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickn if (!params || params[key] === null || params[key] === undefined) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } -} +}; // alias for easier importing export interface RequestArgs extends AjaxRequest {} 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts index 1d8a5f001102..a5328a8c7285 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts @@ -82,7 +82,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Deletes a pet @@ -105,7 +105,7 @@ export class PetApi extends BaseAPI { method: 'DELETE', headers, }); - } + }; /** * Multiple status values can be provided with comma separated strings @@ -133,7 +133,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -161,7 +161,7 @@ export class PetApi extends BaseAPI { headers, query, }); - } + }; /** * Returns a single pet @@ -179,7 +179,7 @@ export class PetApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * Update an existing pet @@ -203,7 +203,7 @@ export class PetApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Updates a pet in the store with form data @@ -235,7 +235,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; /** * uploads an image @@ -267,7 +267,7 @@ export class PetApi extends BaseAPI { headers, body: formData, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts index b3e038e89481..623b48bdede8 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts @@ -45,7 +45,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'DELETE', }); - } + }; /** * Returns a map of status codes to quantities @@ -61,7 +61,7 @@ export class StoreApi extends BaseAPI { method: 'GET', headers, }); - } + }; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -74,7 +74,7 @@ export class StoreApi extends BaseAPI { path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), method: 'GET', }); - } + }; /** * Place an order for a pet @@ -92,6 +92,6 @@ export class StoreApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts index c356d96e91cd..2194fdfe9f68 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts @@ -69,7 +69,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -87,7 +87,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * Creates list of users with given input array @@ -105,7 +105,7 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; /** * This can only be done by the logged in user. @@ -118,7 +118,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'DELETE', }); - } + }; /** * Get user by user name @@ -130,7 +130,7 @@ export class UserApi extends BaseAPI { path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), method: 'GET', }); - } + }; /** * Logs user into the system @@ -149,7 +149,7 @@ export class UserApi extends BaseAPI { method: 'GET', query, }); - } + }; /** * Logs out current logged in user session @@ -159,7 +159,7 @@ export class UserApi extends BaseAPI { path: '/user/logout', method: 'GET', }); - } + }; /** * This can only be done by the logged in user. @@ -179,6 +179,6 @@ export class UserApi extends BaseAPI { headers, body: requestParameters.body, }); - } + }; } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts index 01e3bb106fe4..1bbd8633b299 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts @@ -76,7 +76,7 @@ export class BaseAPI { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; - } + }; withPreMiddleware = (preMiddlewares: Array) => this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); @@ -84,7 +84,7 @@ export class BaseAPI { withPostMiddleware = (postMiddlewares: Array) => this.withMiddleware(postMiddlewares.map((post) => ({ post }))); - protected request = (requestOpts: RequestOpts): Observable => + protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( map((res) => { if (res.status >= 200 && res.status < 300) { @@ -102,17 +102,17 @@ export class BaseAPI { // do not handle correctly sometimes. url += '?' + queryString(requestOpts.query); } - + return { url, method: requestOpts.method, headers: requestOpts.headers, body: requestOpts.body instanceof FormData ? requestOpts.body : JSON.stringify(requestOpts.body), - responseType: requestOpts.responseType || 'json' + responseType: requestOpts.responseType || 'json', }; } - private rxjsRequest = (params: RequestArgs): Observable => + private rxjsRequest = (params: RequestArgs): Observable => of(params).pipe( map((request) => { this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); @@ -133,7 +133,7 @@ export class BaseAPI { * and then shallow cloning data members. */ private clone = (): T => - Object.assign(Object.create(Object.getPrototypeOf(this)), this) + Object.assign(Object.create(Object.getPrototypeOf(this)), this); } // export for not being a breaking change @@ -149,7 +149,7 @@ export const COLLECTION_FORMATS = { }; export type Json = any; -export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpHeaders = { [key: string]: string }; export type HttpQuery = { [key: string]: string | number | null | boolean | Array }; export type HttpBody = Json | FormData; @@ -164,7 +164,7 @@ export interface RequestOpts { responseType?: 'json' | 'blob' | 'arraybuffer' | 'text'; } -export const encodeURI = (value: any) => encodeURIComponent(String(value)) +export const encodeURI = (value: any) => encodeURIComponent(String(value)); const queryString = (params: HttpQuery): string => Object.keys(params) .map((key) => { @@ -182,7 +182,7 @@ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickn if (!params || params[key] === null || params[key] === undefined) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } -} +}; // alias for easier importing export interface RequestArgs extends AjaxRequest {} diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator-ignore b/samples/config/petstore/protobuf-schema/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/.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/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION new file mode 100644 index 000000000000..d1a8f58b3884 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/README.md b/samples/config/petstore/protobuf-schema/README.md new file mode 100644 index 000000000000..5e6b62f76b48 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/README.md @@ -0,0 +1,31 @@ +# gPRC for petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Go +``` +# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` +mkdir /var/tmp/go/ +protoc --go_out=/var/tmp/go/ services/* +protoc --go_out=/var/tmp/go/ models/* +``` + +### Ruby +``` +# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` +RUBY_OUTPUT_DIR="/var/tmp/ruby/petstore" +mkdir $RUBY_OUTPUT_DIR +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* +``` diff --git a/samples/config/petstore/protobuf-schema/models/api_response.proto b/samples/config/petstore/protobuf-schema/models/api_response.proto new file mode 100644 index 000000000000..bb08ca19e497 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/models/api_response.proto @@ -0,0 +1,24 @@ +/* + 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 OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + + +message ApiResponse { + + int32 code = 1; + + string type = 2; + + string message = 3; + +} diff --git a/samples/config/petstore/protobuf-schema/models/category.proto b/samples/config/petstore/protobuf-schema/models/category.proto new file mode 100644 index 000000000000..474cf59efb1c --- /dev/null +++ b/samples/config/petstore/protobuf-schema/models/category.proto @@ -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 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + + +message Category { + + int64 id = 1; + + string name = 2; + +} diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto new file mode 100644 index 000000000000..58f1458c63ac --- /dev/null +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -0,0 +1,35 @@ +/* + 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 OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + + +message Order { + + int64 id = 1; + + int64 petId = 2; + + int32 quantity = 3; + + string shipDate = 4; + + // Order Status + enum status { + PLACED = 0; + APPROVED = 1; + DELIVERED = 2; + } + + bool complete = 6; + +} diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto new file mode 100644 index 000000000000..8cff62e9f5a2 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -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 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + +import public "models/category.proto"; +import public "models/tag.proto"; + +message Pet { + + int64 id = 1; + + Category category = 2; + + string name = 3; + + repeated string photoUrls = 4; + + repeated Tag tags = 5; + + // pet status in the store + enum status { + AVAILABLE = 0; + PENDING = 1; + SOLD = 2; + } + +} diff --git a/samples/config/petstore/protobuf-schema/models/tag.proto b/samples/config/petstore/protobuf-schema/models/tag.proto new file mode 100644 index 000000000000..f9a80eac5412 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/models/tag.proto @@ -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 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + + +message Tag { + + int64 id = 1; + + string name = 2; + +} diff --git a/samples/config/petstore/protobuf-schema/models/user.proto b/samples/config/petstore/protobuf-schema/models/user.proto new file mode 100644 index 000000000000..1a30b008131b --- /dev/null +++ b/samples/config/petstore/protobuf-schema/models/user.proto @@ -0,0 +1,35 @@ +/* + 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 OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + + +message User { + + int64 id = 1; + + string username = 2; + + string firstName = 3; + + string lastName = 4; + + string email = 5; + + string password = 6; + + string phone = 7; + + // User Status + int32 userStatus = 8; + +} diff --git a/samples/config/petstore/protobuf-schema/services/pet_service.proto b/samples/config/petstore/protobuf-schema/services/pet_service.proto new file mode 100644 index 000000000000..2b7ae553ad4e --- /dev/null +++ b/samples/config/petstore/protobuf-schema/services/pet_service.proto @@ -0,0 +1,102 @@ +/* + 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 OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + +import "google/protobuf/empty.proto"; +import public "models/api_response.proto"; +import public "models/pet.proto"; + +service PetService { + rpc AddPet (AddPetRequest) returns (google.protobuf.Empty); + + rpc DeletePet (DeletePetRequest) returns (google.protobuf.Empty); + + rpc FindPetsByStatus (FindPetsByStatusRequest) returns (FindPetsByStatusResponse); + + rpc FindPetsByTags (FindPetsByTagsRequest) returns (FindPetsByTagsResponse); + + rpc GetPetById (GetPetByIdRequest) returns (Pet); + + rpc UpdatePet (UpdatePetRequest) returns (google.protobuf.Empty); + + rpc UpdatePetWithForm (UpdatePetWithFormRequest) returns (google.protobuf.Empty); + + rpc UploadFile (UploadFileRequest) returns (ApiResponse); + +} + +message AddPetRequest { + // Pet object that needs to be added to the store + Pet body = 1; + +} + +message DeletePetRequest { + // Pet id to delete + int64 petId = 1; + string apiKey = 2; + +} + +message FindPetsByStatusRequest { + // Status values that need to be considered for filter + repeated string status = 1; + +} + +message FindPetsByStatusResponse { + repeated Pet data = 1; +} + +message FindPetsByTagsRequest { + // Tags to filter by + repeated string tags = 1; + +} + +message FindPetsByTagsResponse { + repeated Pet data = 1; +} + +message GetPetByIdRequest { + // ID of pet to return + int64 petId = 1; + +} + +message UpdatePetRequest { + // Pet object that needs to be added to the store + Pet body = 1; + +} + +message UpdatePetWithFormRequest { + // ID of pet that needs to be updated + int64 petId = 1; + // Updated name of the pet + string name = 2; + // Updated status of the pet + string status = 3; + +} + +message UploadFileRequest { + // ID of pet to update + int64 petId = 1; + // Additional data to pass to server + string additionalMetadata = 2; + // file to upload + string file = 3; + +} + diff --git a/samples/config/petstore/protobuf-schema/services/store_service.proto b/samples/config/petstore/protobuf-schema/services/store_service.proto new file mode 100644 index 000000000000..8adea52f7547 --- /dev/null +++ b/samples/config/petstore/protobuf-schema/services/store_service.proto @@ -0,0 +1,50 @@ +/* + 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 OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + +import "google/protobuf/empty.proto"; +import public "models/order.proto"; + +service StoreService { + rpc DeleteOrder (DeleteOrderRequest) returns (google.protobuf.Empty); + + rpc GetInventory (google.protobuf.Empty) returns (GetInventoryResponse); + + rpc GetOrderById (GetOrderByIdRequest) returns (Order); + + rpc PlaceOrder (PlaceOrderRequest) returns (Order); + +} + +message DeleteOrderRequest { + // ID of the order that needs to be deleted + string orderId = 1; + +} + +message GetInventoryResponse { + int32 data = 1; +} + +message GetOrderByIdRequest { + // ID of pet that needs to be fetched + int64 orderId = 1; + +} + +message PlaceOrderRequest { + // order placed for purchasing the pet + Order body = 1; + +} + diff --git a/samples/config/petstore/protobuf-schema/services/user_service.proto b/samples/config/petstore/protobuf-schema/services/user_service.proto new file mode 100644 index 000000000000..8f3f762bd4ce --- /dev/null +++ b/samples/config/petstore/protobuf-schema/services/user_service.proto @@ -0,0 +1,86 @@ +/* + 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 OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package petstore; + +import "google/protobuf/empty.proto"; +import public "models/user.proto"; + +service UserService { + rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty); + + rpc CreateUsersWithArrayInput (CreateUsersWithArrayInputRequest) returns (google.protobuf.Empty); + + rpc CreateUsersWithListInput (CreateUsersWithListInputRequest) returns (google.protobuf.Empty); + + rpc DeleteUser (DeleteUserRequest) returns (google.protobuf.Empty); + + rpc GetUserByName (GetUserByNameRequest) returns (User); + + rpc LoginUser (LoginUserRequest) returns (LoginUserResponse); + + rpc LogoutUser (google.protobuf.Empty) returns (google.protobuf.Empty); + + rpc UpdateUser (UpdateUserRequest) returns (google.protobuf.Empty); + +} + +message CreateUserRequest { + // Created user object + User body = 1; + +} + +message CreateUsersWithArrayInputRequest { + // List of user object + repeated User body = 1; + +} + +message CreateUsersWithListInputRequest { + // List of user object + repeated User body = 1; + +} + +message DeleteUserRequest { + // The name that needs to be deleted + string username = 1; + +} + +message GetUserByNameRequest { + // The name that needs to be fetched. Use user1 for testing. + string username = 1; + +} + +message LoginUserRequest { + // The user name for login + string username = 1; + // The password for login in clear text + string password = 2; + +} + +message LoginUserResponse { + string data = 1; +} + +message UpdateUserRequest { + // name that need to be deleted + string username = 1; + // Updated user object + User body = 2; + +} + diff --git a/samples/documentation/asciidoc/.openapi-generator-ignore b/samples/documentation/asciidoc/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/documentation/asciidoc/.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/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/documentation/asciidoc/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/index.adoc b/samples/documentation/asciidoc/index.adoc new file mode 100644 index 000000000000..148466dd320d --- /dev/null +++ b/samples/documentation/asciidoc/index.adoc @@ -0,0 +1,1969 @@ += OpenAPI Petstore +team@openapitools.org +1.0.0 +:toc: left +:numbered: +:toclevels: 3 +:source-highlighter: highlightjs +:keywords: openapi, rest, OpenAPI Petstore +:specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation +:snippetDir: . +:generator-template: v1 2019-09-03 +:info-url: https://openapi-generator.tech +:app-name: OpenAPI Petstore + +[abstract] +.Abstract +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[] + + +== Endpoints + + +[.Pet] +=== Pet + + +[.addPet] +==== addPet + +`POST /pet` + +Add a new pet to the store + +===== Description + + + + +// markup not found, no include ::pet/POST/spec.adoc[] + + + +===== Parameters + + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| Pet object that needs to be added to the store <> +| X +| +| + +|=== + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 405 +| Invalid input +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/POST/http-request.adoc[] + + +// markup not found, no include ::pet/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.deletePet] +==== deletePet + +`DELETE /pet/{petId}` + +Deletes a pet + +===== Description + + + + +// markup not found, no include ::pet/{petId}/DELETE/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| petId +| Pet id to delete +| X +| null +| + +|=== + + +====== Header Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| apiKey +| +| - +| null +| + +|=== + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 400 +| Invalid pet value +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/{petId}/DELETE/http-request.adoc[] + + +// markup not found, no include ::pet/{petId}/DELETE/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/{petId}/DELETE/DELETE.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/{petId}/DELETE/implementation.adoc[] + + +endif::internal-generation[] + + +[.findPetsByStatus] +==== findPetsByStatus + +`GET /pet/findByStatus` + +Finds Pets by status + +===== Description + +Multiple status values can be provided with comma separated strings + + +// markup not found, no include ::pet/findByStatus/GET/spec.adoc[] + + + +===== Parameters + + + + +====== Query Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| status +| Status values that need to be considered for filter <> +| X +| null +| + +|=== + + +===== Return Type + +array[<>] + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| List[<>] + + +| 400 +| Invalid status value +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/findByStatus/GET/http-request.adoc[] + + +// markup not found, no include ::pet/findByStatus/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/findByStatus/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/findByStatus/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.findPetsByTags] +==== findPetsByTags + +`GET /pet/findByTags` + +Finds Pets by tags + +===== Description + +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[] + + + +===== Parameters + + + + +====== Query Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| tags +| Tags to filter by <> +| X +| null +| + +|=== + + +===== Return Type + +array[<>] + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| List[<>] + + +| 400 +| Invalid tag value +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/findByTags/GET/http-request.adoc[] + + +// markup not found, no include ::pet/findByTags/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/findByTags/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/findByTags/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.getPetById] +==== getPetById + +`GET /pet/{petId}` + +Find pet by ID + +===== Description + +Returns a single pet + + +// markup not found, no include ::pet/{petId}/GET/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| petId +| ID of pet to return +| X +| null +| + +|=== + + + + + +===== Return Type + +<> + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| <> + + +| 400 +| Invalid ID supplied +| <<>> + + +| 404 +| Pet not found +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/{petId}/GET/http-request.adoc[] + + +// markup not found, no include ::pet/{petId}/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/{petId}/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/{petId}/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.updatePet] +==== updatePet + +`PUT /pet` + +Update an existing pet + +===== Description + + + + +// markup not found, no include ::pet/PUT/spec.adoc[] + + + +===== Parameters + + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| Pet object that needs to be added to the store <> +| X +| +| + +|=== + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 400 +| Invalid ID supplied +| <<>> + + +| 404 +| Pet not found +| <<>> + + +| 405 +| Validation exception +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/PUT/http-request.adoc[] + + +// markup not found, no include ::pet/PUT/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/PUT/PUT.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/PUT/implementation.adoc[] + + +endif::internal-generation[] + + +[.updatePetWithForm] +==== updatePetWithForm + +`POST /pet/{petId}` + +Updates a pet in the store with form data + +===== Description + + + + +// markup not found, no include ::pet/{petId}/POST/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| petId +| ID of pet that needs to be updated +| X +| null +| + +|=== + + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 405 +| Invalid input +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::pet/{petId}/POST/http-request.adoc[] + + +// markup not found, no include ::pet/{petId}/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/{petId}/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/{petId}/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.uploadFile] +==== uploadFile + +`POST /pet/{petId}/uploadImage` + +uploads an image + +===== Description + + + + +// markup not found, no include ::pet/{petId}/uploadImage/POST/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| petId +| ID of pet to update +| X +| null +| + +|=== + + + + + +===== Return Type + +<> + + +===== Content Type + +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| <> + +|=== + +===== Samples + + +// markup not found, no include ::pet/{petId}/uploadImage/POST/http-request.adoc[] + + +// markup not found, no include ::pet/{petId}/uploadImage/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :pet/{petId}/uploadImage/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::pet/{petId}/uploadImage/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.Store] +=== Store + + +[.deleteOrder] +==== deleteOrder + +`DELETE /store/order/{orderId}` + +Delete purchase order by ID + +===== Description + +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[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| orderId +| ID of the order that needs to be deleted +| X +| null +| + +|=== + + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 400 +| Invalid ID supplied +| <<>> + + +| 404 +| Order not found +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::store/order/{orderId}/DELETE/http-request.adoc[] + + +// markup not found, no include ::store/order/{orderId}/DELETE/http-response.adoc[] + + + +// file not found, no * wiremock data link :store/order/{orderId}/DELETE/DELETE.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::store/order/{orderId}/DELETE/implementation.adoc[] + + +endif::internal-generation[] + + +[.getInventory] +==== getInventory + +`GET /store/inventory` + +Returns pet inventories by status + +===== Description + +Returns a map of status codes to quantities + + +// markup not found, no include ::store/inventory/GET/spec.adoc[] + + + +===== Parameters + + + + + + +===== Return Type + + +<> + + +===== Content Type + +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| Map[<>] + +|=== + +===== Samples + + +// markup not found, no include ::store/inventory/GET/http-request.adoc[] + + +// markup not found, no include ::store/inventory/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :store/inventory/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::store/inventory/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.getOrderById] +==== getOrderById + +`GET /store/order/{orderId}` + +Find purchase order by ID + +===== Description + +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[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| orderId +| ID of pet that needs to be fetched +| X +| null +| + +|=== + + + + + +===== Return Type + +<> + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| <> + + +| 400 +| Invalid ID supplied +| <<>> + + +| 404 +| Order not found +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::store/order/{orderId}/GET/http-request.adoc[] + + +// markup not found, no include ::store/order/{orderId}/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :store/order/{orderId}/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::store/order/{orderId}/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.placeOrder] +==== placeOrder + +`POST /store/order` + +Place an order for a pet + +===== Description + + + + +// markup not found, no include ::store/order/POST/spec.adoc[] + + + +===== Parameters + + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| order placed for purchasing the pet <> +| X +| +| + +|=== + + + + +===== Return Type + +<> + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| <> + + +| 400 +| Invalid Order +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::store/order/POST/http-request.adoc[] + + +// markup not found, no include ::store/order/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :store/order/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::store/order/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.User] +=== User + + +[.createUser] +==== createUser + +`POST /user` + +Create user + +===== Description + +This can only be done by the logged in user. + + +// markup not found, no include ::user/POST/spec.adoc[] + + + +===== Parameters + + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| Created user object <> +| X +| +| + +|=== + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 0 +| successful operation +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/POST/http-request.adoc[] + + +// markup not found, no include ::user/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.createUsersWithArrayInput] +==== createUsersWithArrayInput + +`POST /user/createWithArray` + +Creates list of users with given input array + +===== Description + + + + +// markup not found, no include ::user/createWithArray/POST/spec.adoc[] + + + +===== Parameters + + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| List of user object <> +| X +| +| + +|=== + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 0 +| successful operation +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/createWithArray/POST/http-request.adoc[] + + +// markup not found, no include ::user/createWithArray/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/createWithArray/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/createWithArray/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.createUsersWithListInput] +==== createUsersWithListInput + +`POST /user/createWithList` + +Creates list of users with given input array + +===== Description + + + + +// markup not found, no include ::user/createWithList/POST/spec.adoc[] + + + +===== Parameters + + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| List of user object <> +| X +| +| + +|=== + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 0 +| successful operation +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/createWithList/POST/http-request.adoc[] + + +// markup not found, no include ::user/createWithList/POST/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/createWithList/POST/POST.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/createWithList/POST/implementation.adoc[] + + +endif::internal-generation[] + + +[.deleteUser] +==== deleteUser + +`DELETE /user/{username}` + +Delete user + +===== Description + +This can only be done by the logged in user. + + +// markup not found, no include ::user/{username}/DELETE/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| username +| The name that needs to be deleted +| X +| null +| + +|=== + + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 400 +| Invalid username supplied +| <<>> + + +| 404 +| User not found +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/{username}/DELETE/http-request.adoc[] + + +// markup not found, no include ::user/{username}/DELETE/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/{username}/DELETE/DELETE.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/{username}/DELETE/implementation.adoc[] + + +endif::internal-generation[] + + +[.getUserByName] +==== getUserByName + +`GET /user/{username}` + +Get user by user name + +===== Description + + + + +// markup not found, no include ::user/{username}/GET/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| username +| The name that needs to be fetched. Use user1 for testing. +| X +| null +| + +|=== + + + + + +===== Return Type + +<> + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| <> + + +| 400 +| Invalid username supplied +| <<>> + + +| 404 +| User not found +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/{username}/GET/http-request.adoc[] + + +// markup not found, no include ::user/{username}/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/{username}/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/{username}/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.loginUser] +==== loginUser + +`GET /user/login` + +Logs user into the system + +===== Description + + + + +// markup not found, no include ::user/login/GET/spec.adoc[] + + + +===== Parameters + + + + +====== Query Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| username +| The user name for login +| X +| null +| + +| password +| The password for login in clear text +| X +| null +| + +|=== + + +===== Return Type + + +<> + + +===== Content Type + +* application/xml +* application/json + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| successful operation +| <> + + +| 400 +| Invalid username/password supplied +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/login/GET/http-request.adoc[] + + +// markup not found, no include ::user/login/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/login/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/login/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.logoutUser] +==== logoutUser + +`GET /user/logout` + +Logs out current logged in user session + +===== Description + + + + +// markup not found, no include ::user/logout/GET/spec.adoc[] + + + +===== Parameters + + + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 0 +| successful operation +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/logout/GET/http-request.adoc[] + + +// markup not found, no include ::user/logout/GET/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/logout/GET/GET.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/logout/GET/implementation.adoc[] + + +endif::internal-generation[] + + +[.updateUser] +==== updateUser + +`PUT /user/{username}` + +Updated user + +===== Description + +This can only be done by the logged in user. + + +// markup not found, no include ::user/{username}/PUT/spec.adoc[] + + + +===== Parameters + +====== Path Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| username +| name that need to be deleted +| X +| null +| + +|=== + +===== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| body +| Updated user object <> +| X +| +| + +|=== + + + + +===== Return Type + + + +- + + +===== Responses + +.http response codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 400 +| Invalid user supplied +| <<>> + + +| 404 +| User not found +| <<>> + +|=== + +===== Samples + + +// markup not found, no include ::user/{username}/PUT/http-request.adoc[] + + +// markup not found, no include ::user/{username}/PUT/http-response.adoc[] + + + +// file not found, no * wiremock data link :user/{username}/PUT/PUT.json[] + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include ::user/{username}/PUT/implementation.adoc[] + + +endif::internal-generation[] + + +[#models] +== Models + + +[#ApiResponse] +==== _ApiResponse_ An uploaded response + +Describes the result of uploading an image resource + +[.fields-ApiResponse] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +| code +| +| Integer +| +| int32 _ + +| type +| +| String +| +| _ + +| message +| +| String +| +| _ + +|=== + + +[#Category] +==== _Category_ Pet category + +A category for a pet + +[.fields-Category] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +| id +| +| Long +| +| int64 _ + +| name +| +| String +| +| _ + +|=== + + +[#Order] +==== _Order_ Pet Order + +An order for a pets from the pet store + +[.fields-Order] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +| id +| +| Long +| +| int64 _ + +| petId +| +| Long +| +| int64 _ + +| quantity +| +| Integer +| +| int32 _ + +| shipDate +| +| Date +| +| date-time _ + +| status +| +| String +| Order Status +| Enum: _ placed, approved, delivered, _ + +| complete +| +| Boolean +| +| _ + +|=== + + +[#Pet] +==== _Pet_ a Pet + +A pet for sale in the pet store + +[.fields-Pet] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +| id +| +| Long +| +| int64 _ + +| category +| +| Category +| +| _ + +| name +| X +| String +| +| _ + +| photoUrls +| X +| List of <> +| +| _ + +| tags +| +| List of <> +| +| _ + +| status +| +| String +| pet status in the store +| Enum: _ available, pending, sold, _ + +|=== + + +[#Tag] +==== _Tag_ Pet Tag + +A tag for a pet + +[.fields-Tag] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +| id +| +| Long +| +| int64 _ + +| name +| +| String +| +| _ + +|=== + + +[#User] +==== _User_ a User + +A User who is purchasing from the pet store + +[.fields-User] +[cols="2,1,2,4,1"] +|=== +| Field Name| Required| Type| Description| Format + +| id +| +| Long +| +| int64 _ + +| username +| +| String +| +| _ + +| firstName +| +| String +| +| _ + +| lastName +| +| String +| +| _ + +| email +| +| String +| +| _ + +| password +| +| String +| +| _ + +| phone +| +| String +| +| _ + +| userStatus +| +| Integer +| User Status +| int32 _ + +|=== + + diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 38d08719b849..f909dc88efb6 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 4.1.1-SNAPSHOT + 4.1.3-SNAPSHOT 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 2f81801b7943..0e97bd19efbf 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.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/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 479c313e87b9..0e97bd19efbf 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 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 82f28d6e2655..a50a23f7d4ae 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -47,6 +47,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 260820910aff..c5e930efc566 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1059,6 +1059,61 @@ paths: description: Success tags: - fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1682,6 +1737,7 @@ components: - placed - approved - delivered + nullable: true type: string OuterEnumInteger: enum: diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 1c5c50d2e53c..ea8783779c65 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -10,29 +10,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service /* -AnotherFakeApiService To test special tags +Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param client client model @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,70 +45,70 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, clie localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index 1642ea1d22c9..f3b325dbd4c2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -10,27 +10,28 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// DefaultApiService DefaultApi service type DefaultApiService service /* -DefaultApiService - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +FooGet Method for FooGet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return InlineResponseDefault */ -func (a *DefaultApiService) FooGet(ctx context.Context) (InlineResponseDefault, *http.Response, error) { +func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -42,68 +43,68 @@ func (a *DefaultApiService) FooGet(ctx context.Context) (InlineResponseDefault, localVarPath := a.client.cfg.BasePath + "/foo" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 0 { + if localVarHTTPResponse.StatusCode == 0 { var v InlineResponseDefault - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index a2438b1a4295..7035339127ba 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -10,29 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "github.com/antihax/optional" "os" + "reflect" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeApiService FakeApi service type FakeApiService service /* -FakeApiService Health check endpoint - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +FakeHealthGet Health check endpoint + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return HealthCheckResult */ -func (a *FakeApiService) FakeHealthGet(ctx context.Context) (HealthCheckResult, *http.Response, error) { +func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,88 +46,88 @@ func (a *FakeApiService) FakeHealthGet(ctx context.Context) (HealthCheckResult, localVarPath := a.client.cfg.BasePath + "/fake/health" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v HealthCheckResult - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' +type FakeOuterBooleanSerializeOpts struct { + Body optional.Bool } /* -FakeApiService +FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: * @param "Body" (optional.Bool) - Input boolean as post body @return bool */ - -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool -} - -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -137,93 +139,93 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v bool - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' +type FakeOuterCompositeSerializeOpts struct { + OuterComposite optional.Interface } /* -FakeApiService +FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: * @param "OuterComposite" (optional.Interface of OuterComposite) - Input composite as post body @return OuterComposite */ - -type FakeOuterCompositeSerializeOpts struct { - OuterComposite optional.Interface -} - -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -235,25 +237,25 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.OuterComposite.IsSet() { @@ -264,68 +266,68 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPostBody = &localVarOptionalOuterComposite } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v OuterComposite - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' +type FakeOuterNumberSerializeOpts struct { + Body optional.Float32 } /* -FakeApiService +FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: * @param "Body" (optional.Float32) - Input number as post body @return float32 */ - -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 -} - -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -337,93 +339,93 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/number" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v float32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' +type FakeOuterStringSerializeOpts struct { + Body optional.String } /* -FakeApiService +FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: * @param "Body" (optional.String) - Input string as post body @return string */ - -type FakeOuterStringSerializeOpts struct { - Body optional.String -} - -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -435,86 +437,86 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarPath := a.client.cfg.BasePath + "/fake/outer/string" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"*/*"} + localVarHTTPHeaderAccepts := []string{"*/*"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params if localVarOptionals != nil && localVarOptionals.Body.IsSet() { localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -FakeApiService +TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param fileSchemaTestClass */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchemaTestClass FileSchemaTestClass) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -525,64 +527,64 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaT localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &fileSchemaTestClass - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param query * @param user */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, user User) (*http.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, user User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -593,66 +595,66 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("query", parameterToString(query, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService To test \"client\" model +TestClientModel To test \"client\" model To test \"client\" model - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param client client model @return Client */ -func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error) { +func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -664,78 +666,92 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' +type TestEndpointParametersOpts struct { + Integer optional.Int32 + Int32_ optional.Int32 + Int64_ optional.Int64 + Float optional.Float32 + String_ optional.String + Binary optional.Interface + Date optional.String + DateTime optional.Time + Password optional.String + Callback optional.String } /* -FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param number None * @param double None * @param patternWithoutDelimiter None @@ -752,23 +768,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * @param "Password" (optional.String) - None * @param "Callback" (optional.String) - None */ - -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String -} - -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -779,8 +781,8 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if number < 32.1 { return nil, reportError("number must be greater than 32.1") } @@ -795,21 +797,21 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) @@ -840,7 +842,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -849,11 +851,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) } if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { - paramJson, err := parameterToJson(localVarOptionals.DateTime.Value()) - if err != nil { - return nil, err - } - localVarFormParams.Add("dateTime", paramJson) + localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Password.IsSet() { localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) @@ -861,37 +859,49 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' +type TestEnumParametersOpts struct { + EnumHeaderStringArray optional.Interface + EnumHeaderString optional.String + EnumQueryStringArray optional.Interface + EnumQueryString optional.String + EnumQueryInteger optional.Int32 + EnumQueryDouble optional.Float64 + EnumFormStringArray optional.Interface + EnumFormString optional.String } /* -FakeApiService To test enum parameters +TestEnumParameters To test enum parameters To test enum parameters - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *TestEnumParametersOpts - Optional Parameters: * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) @@ -902,21 +912,9 @@ To test enum parameters * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) */ - -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String -} - -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -927,11 +925,19 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { - localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "multi")) + t:=localVarOptionals.EnumQueryStringArray.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("enum_query_string_array", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("enum_query_string_array", parameterToString(t, "multi")) + } } if localVarOptionals != nil && localVarOptionals.EnumQueryString.IsSet() { localVarQueryParams.Add("enum_query_string", parameterToString(localVarOptionals.EnumQueryString.Value(), "")) @@ -943,21 +949,21 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") @@ -971,37 +977,44 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' +type TestGroupParametersOpts struct { + StringGroup optional.Int32 + BooleanGroup optional.Bool + Int64Group optional.Int64 } /* -FakeApiService Fake endpoint to test group parameters (optional) +TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requiredStringGroup Required String in group parameters * @param requiredBooleanGroup Required Boolean in group parameters * @param requiredInt64Group Required Integer in group parameters @@ -1010,16 +1023,9 @@ Fake endpoint to test group parameters (optional) * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters * @param "Int64Group" (optional.Int64) - Integer in group parameters */ - -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 -} - -func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1030,8 +1036,8 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarPath := a.client.cfg.BasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) @@ -1042,61 +1048,61 @@ func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredString localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test inline additionalProperties - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param requestBody request body */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error) { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, requestBody map[string]string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1107,64 +1113,64 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &requestBody - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -FakeApiService test json serialization of form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +TestJsonFormData test json serialization of form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param param field1 * @param param2 field2 */ -func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1175,51 +1181,142 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarFormParams.Add("param", parameterToString(param, "")) localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + t:=pipe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("pipe", parameterToString(t, "multi")) + } + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index c58af2fc260b..d98adc297295 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -10,29 +10,30 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service /* -FakeClassnameTags123ApiService To test class name in snake case +TestClassname To test class name in snake case To test class name in snake case - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param client client model @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPatch + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,25 +45,25 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie localVarPath := a.client.cfg.BasePath + "/fake_classname_test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &client @@ -78,48 +79,48 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie localVarQueryParams.Add("api_key_query", key) } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Client - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index 564ca6cf47c3..d32003b6c422 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -10,10 +10,10 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" "github.com/antihax/optional" @@ -22,19 +22,20 @@ import ( // Linger please var ( - _ context.Context + _ _context.Context ) +// PetApiService PetApi service type PetApiService service /* -PetApiService Add a new pet to the store - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +AddPet Add a new pet to the store + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pet Pet object that needs to be added to the store */ -func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error) { +func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -45,70 +46,70 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// DeletePetOpts Optional parameters for the method 'DeletePet' +type DeletePetOpts struct { + ApiKey optional.String } /* -PetApiService Deletes a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +DeletePet Deletes a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete * @param optional nil or *DeletePetOpts - Optional Parameters: * @param "ApiKey" (optional.String) - */ - -type DeletePetOpts struct { - ApiKey optional.String -} - -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -117,69 +118,69 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -PetApiService Finds Pets by status +FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param status Status values that need to be considered for filter @return []Pet */ -func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -191,83 +192,83 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("status", parameterToString(status, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Finds Pets by tags +FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param tags Tags to filter by @return []Pet */ -func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { +func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -279,83 +280,83 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe localVarPath := a.client.cfg.BasePath + "/pet/findByTags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("tags", parameterToString(tags, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v []Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Find pet by ID +GetPetById Find pet by ID Returns a single pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to return @return Pet */ -func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -365,28 +366,28 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -400,60 +401,60 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Pet - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -PetApiService Update an existing pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pet Pet object that needs to be added to the store */ -func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error) { +func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -464,72 +465,72 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, localVarPath := a.client.cfg.BasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json", "application/xml"} + localVarHTTPContentTypes := []string{"application/json", "application/xml"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' +type UpdatePetWithFormOpts struct { + Name optional.String + Status optional.String } /* -PetApiService Updates a pet in the store with form data - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UpdatePetWithForm Updates a pet in the store with form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: * @param "Name" (optional.String) - Updated name of the pet * @param "Status" (optional.String) - Updated status of the pet */ - -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String -} - -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -538,28 +539,28 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.Name.IsSet() { localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) @@ -567,51 +568,51 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca if localVarOptionals != nil && localVarOptionals.Status.IsSet() { localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil +} + +// UploadFileOpts Optional parameters for the method 'UploadFile' +type UploadFileOpts struct { + AdditionalMetadata optional.String + File optional.Interface } /* -PetApiService uploads an image - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFile uploads an image + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param optional nil or *UploadFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server * @param "File" (optional.Interface of *os.File) - file to upload @return ApiResponse */ - -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface -} - -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -621,28 +622,28 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt // create path and map variables localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -657,74 +658,74 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt } } if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String } /* -PetApiService uploads an image (required) - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +UploadFileWithRequiredFile uploads an image (required) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update * @param requiredFile file to upload * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server @return ApiResponse */ - -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String -} - -func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -734,28 +735,28 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in // create path and map variables localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"multipart/form-data"} + localVarHTTPContentTypes := []string{"multipart/form-data"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) @@ -763,53 +764,53 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in localVarFormFileName = "requiredFile" localVarFile := requiredFile if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v ApiResponse - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 39411cc6f676..654f5e89aa3d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -10,30 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// StoreApiService StoreApi service type StoreApiService service /* -StoreApiService Delete purchase order by ID +DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of the order that needs to be deleted */ -func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -42,65 +43,65 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -StoreApiService Returns pet inventories by status +GetInventory Returns pet inventories by status Returns a map of status codes to quantities - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return map[string]int32 */ -func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { +func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -112,25 +113,25 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarPath := a.client.cfg.BasePath + "/store/inventory" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if ctx != nil { // API Key Authentication @@ -144,62 +145,62 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v map[string]int32 - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Find purchase order by ID +GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of pet that needs to be fetched @return Order */ -func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -209,11 +210,11 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde // create path and map variables localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} if orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -222,77 +223,77 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde } // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -StoreApiService Place an order for a pet - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +PlaceOrder Place an order for a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param order order placed for purchasing the pet @return Order */ -func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error) { +func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -304,70 +305,70 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, * localVarPath := a.client.cfg.BasePath + "/store/order" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &order - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v Order - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index da7b38d1dfa5..270cc5844469 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -10,30 +10,31 @@ package petstore import ( - "context" - "io/ioutil" - "net/http" - "net/url" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" "fmt" "strings" ) // Linger please var ( - _ context.Context + _ _context.Context ) +// UserApiService UserApi service type UserApiService service /* -UserApiService Create user +CreateUser Create user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user Created user object */ -func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error) { +func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -44,63 +45,63 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo localVarPath := a.client.cfg.BasePath + "/user" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithArrayInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user List of user object */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -111,63 +112,63 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U localVarPath := a.client.cfg.BasePath + "/user/createWithArray" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Creates list of users with given input array - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +CreateUsersWithListInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param user List of user object */ -func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error) { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPost + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -178,64 +179,64 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us localVarPath := a.client.cfg.BasePath + "/user/createWithList" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Delete user +DeleteUser Delete user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be deleted */ -func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodDelete + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -244,65 +245,65 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Get user by user name - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +GetUserByName Get user by user name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. @return User */ -func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -312,85 +313,85 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v User - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs user into the system - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LoginUser Logs user into the system + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The user name for login * @param password The password for login in clear text @return string */ -func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { +func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -402,81 +403,81 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor localVarPath := a.client.cfg.BasePath + "/user/login" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} localVarQueryParams.Add("username", parameterToString(username, "")) localVarQueryParams.Add("password", parameterToString(password, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarReturnValue, localVarHttpResponse, err + return localVarReturnValue, localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - if localVarHttpResponse.StatusCode == 200 { + if localVarHTTPResponse.StatusCode == 200 { var v string - err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr := GenericOpenAPIError{ body: localVarBody, error: err.Error(), } - return localVarReturnValue, localVarHttpResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHttpResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } /* -UserApiService Logs out current logged in user session - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +LogoutUser Logs out current logged in user session + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). */ -func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { +func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodGet + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -487,63 +488,63 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) localVarPath := a.client.cfg.BasePath + "/user/logout" localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{} + localVarHTTPContentTypes := []string{} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } /* -UserApiService Updated user +UpdateUser Updated user This can only be done by the logged in user. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username name that need to be deleted * @param user Updated user object */ -func (a *UserApiService) UpdateUser(ctx context.Context, username string, user User) (*http.Response, error) { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string, user User) (*_nethttp.Response, error) { var ( - localVarHttpMethod = http.MethodPut + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -552,54 +553,54 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, user U // create path and map variables localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } // to determine the Accept header - localVarHttpHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{} // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() if err != nil { - return localVarHttpResponse, err + return localVarHTTPResponse, err } - if localVarHttpResponse.StatusCode >= 300 { + if localVarHTTPResponse.StatusCode >= 300 { newErr := GenericOpenAPIError{ body: localVarBody, - error: localVarHttpResponse.Status, + error: localVarHTTPResponse.Status, } - return localVarHttpResponse, newErr + return localVarHTTPResponse, newErr } - return localVarHttpResponse, nil + return localVarHTTPResponse, nil } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 3f2edef8d79c..a7ec7b01c64e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -178,7 +178,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } -// Change base path to allow switching to mocks +// ChangeBasePath changes base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } diff --git a/samples/openapi3/client/petstore/go/go-petstore/configuration.go b/samples/openapi3/client/petstore/go/go-petstore/configuration.go index 19ccc325fa92..b3b81ad08246 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go/go-petstore/configuration.go @@ -49,6 +49,7 @@ type APIKey struct { Prefix string } +// Configuration stores the configuration of the API client type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` @@ -58,6 +59,7 @@ type Configuration struct { HTTPClient *http.Client } +// NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "http://petstore.swagger.io:80/v2", @@ -67,6 +69,7 @@ func NewConfiguration() *Configuration { return cfg } +// AddDefaultHeader adds a new HTTP header to the default header in the request func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md index 1fe92c432dc9..1a9a600a18a4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **EnumStringRequired** | **string** | | **EnumInteger** | **int32** | | [optional] **EnumNumber** | **float64** | | [optional] -**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] **OuterEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **OuterEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] **OuterEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md index 5695233a26c9..0c11da8d7728 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | @@ -533,3 +534,40 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/openapi3/client/petstore/go/go-petstore/git_push.sh b/samples/openapi3/client/petstore/go/go-petstore/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/git_push.sh +++ b/samples/openapi3/client/petstore/go/go-petstore/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/openapi3/client/petstore/go/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go index f918cabaaae2..8ae5118c9fdc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing model name starting with number +// Model200Response Model for testing model name starting with number type Model200Response struct { Name int32 `json:"name,omitempty"` Class string `json:"class,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go index f906e91987dc..e36ceb38e5fe 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go @@ -8,7 +8,7 @@ */ package petstore - +// SpecialModelName struct for SpecialModelName type SpecialModelName struct { SpecialPropertyName int64 `json:"$special[property.name],omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go index 1d06dde3d04d..3401a3fb2663 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -8,7 +8,7 @@ */ package petstore - +// AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { MapProperty map[string]string `json:"map_property,omitempty"` MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go index 39d0d2d1ec32..1c09a9ddb7f7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go @@ -8,7 +8,7 @@ */ package petstore - +// Animal struct for Animal type Animal struct { ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go index 12732fa32c6b..de022a0afac1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go @@ -8,7 +8,7 @@ */ package petstore - +// ApiResponse struct for ApiResponse type ApiResponse struct { Code int32 `json:"code,omitempty"` Type string `json:"type,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index 8bf700c7eb30..a0818c181471 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -8,7 +8,7 @@ */ package petstore - +// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go index ccb473355caa..521dd4a778ce 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -8,7 +8,7 @@ */ package petstore - +// ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { ArrayNumber []float32 `json:"ArrayNumber,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go index f8819800934b..2ea7b84212bb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go @@ -8,7 +8,7 @@ */ package petstore - +// ArrayTest struct for ArrayTest type ArrayTest struct { ArrayOfString []string `json:"array_of_string,omitempty"` ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go index 8284ba9c7658..97d5a4733f24 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go @@ -8,7 +8,7 @@ */ package petstore - +// Capitalization struct for Capitalization type Capitalization struct { SmallCamel string `json:"smallCamel,omitempty"` CapitalCamel string `json:"CapitalCamel,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go index 58b3deeb938d..54374bcfebbc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go @@ -8,7 +8,7 @@ */ package petstore - +// Cat struct for Cat type Cat struct { ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go index 3c1d802bd411..b7550adb91a5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go @@ -8,7 +8,7 @@ */ package petstore - +// CatAllOf struct for CatAllOf type CatAllOf struct { Declawed bool `json:"declawed,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_category.go b/samples/openapi3/client/petstore/go/go-petstore/model_category.go index 2f971417ac10..104410a316ae 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_category.go @@ -8,7 +8,7 @@ */ package petstore - +// Category struct for Category type Category struct { Id int64 `json:"id,omitempty"` Name string `json:"name"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go index 09c7e891968a..c87910e3dc6e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing model with \"_class\" property +// ClassModel Model for testing model with \"_class\" property type ClassModel struct { Class string `json:"_class,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_client.go b/samples/openapi3/client/petstore/go/go-petstore/model_client.go index 3aa61112c4da..f7c449d2bc65 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_client.go @@ -8,7 +8,7 @@ */ package petstore - +// Client struct for Client type Client struct { Client string `json:"client,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go index 3f791ca1947d..6bc685afe291 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go @@ -8,7 +8,7 @@ */ package petstore - +// Dog struct for Dog type Dog struct { ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go index a0db0aba4b53..758c5cc45f78 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go @@ -8,7 +8,7 @@ */ package petstore - +// DogAllOf struct for DogAllOf type DogAllOf struct { Breed string `json:"breed,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go index ab4dce92ebbc..64df54568b4b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go @@ -8,7 +8,7 @@ */ package petstore - +// EnumArrays struct for EnumArrays type EnumArrays struct { JustSymbol string `json:"just_symbol,omitempty"` ArrayEnum []string `json:"array_enum,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go index 534ce4328817..8b7e1ee89598 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go @@ -8,6 +8,7 @@ */ package petstore +// EnumClass the model 'EnumClass' type EnumClass string // List of EnumClass @@ -15,4 +16,4 @@ const ( ABC EnumClass = "_abc" EFG EnumClass = "-efg" XYZ EnumClass = "(xyz)" -) \ No newline at end of file +) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go index 04a822aa6c88..2ade64ebee95 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go @@ -8,13 +8,13 @@ */ package petstore - +// EnumTest struct for EnumTest type EnumTest struct { EnumString string `json:"enum_string,omitempty"` EnumStringRequired string `json:"enum_string_required"` EnumInteger int32 `json:"enum_integer,omitempty"` EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file.go b/samples/openapi3/client/petstore/go/go-petstore/model_file.go index 2782ccc9a2aa..b07c65dcc42b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file.go @@ -8,8 +8,7 @@ */ package petstore - -// Must be named `File` for test. +// File Must be named `File` for test. type File struct { // Test capitalization SourceURI string `json:"sourceURI,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go index 487f766c6492..29b051e77a86 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -8,7 +8,7 @@ */ package petstore - +// FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { File File `json:"file,omitempty"` Files []File `json:"files,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go/go-petstore/model_foo.go index c379a263487d..e4e448f3b3ac 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_foo.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_foo.go @@ -8,7 +8,7 @@ */ package petstore - +// Foo struct for Foo type Foo struct { Bar string `json:"bar,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go index a8c778d7f545..52f04657bcb1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go @@ -12,7 +12,7 @@ import ( "os" "time" ) - +// FormatTest struct for FormatTest type FormatTest struct { Integer int32 `json:"integer,omitempty"` Int32 int32 `json:"int32,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go index 1cf0e4f530d4..c0b9818dcdd5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go @@ -8,7 +8,7 @@ */ package petstore - +// HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { Bar string `json:"bar,omitempty"` Foo string `json:"foo,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go index 9f9947a9adcb..30e012281b5b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go @@ -8,8 +8,7 @@ */ package petstore - -// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +// HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. type HealthCheckResult struct { NullableMessage *string `json:"NullableMessage,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go index ff6bac3057ef..20659467b710 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go @@ -8,7 +8,7 @@ */ package petstore - +// InlineObject struct for InlineObject type InlineObject struct { // Updated name of the pet Name string `json:"name,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go index 81b7bc9db21a..4692ea8053e6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go @@ -11,7 +11,7 @@ package petstore import ( "os" ) - +// InlineObject1 struct for InlineObject1 type InlineObject1 struct { // Additional data to pass to server AdditionalMetadata string `json:"additionalMetadata,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go index d8aa3dae4fdc..52452faf7506 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go @@ -8,7 +8,7 @@ */ package petstore - +// InlineObject2 struct for InlineObject2 type InlineObject2 struct { // Form parameter enum test (string array) EnumFormStringArray []string `json:"enum_form_string_array,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go index caa108f0fdbe..d3e143340350 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go @@ -12,7 +12,7 @@ import ( "os" "time" ) - +// InlineObject3 struct for InlineObject3 type InlineObject3 struct { // None Integer int32 `json:"integer,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go index eadc31c7176b..e3f9974e637a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go @@ -8,7 +8,7 @@ */ package petstore - +// InlineObject4 struct for InlineObject4 type InlineObject4 struct { // field1 Param string `json:"param"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go index 606b522bb1f0..800d2287bb7e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go @@ -11,7 +11,7 @@ package petstore import ( "os" ) - +// InlineObject5 struct for InlineObject5 type InlineObject5 struct { // Additional data to pass to server AdditionalMetadata string `json:"additionalMetadata,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go index d72677acdabd..c5be6dcae7dc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go @@ -8,7 +8,7 @@ */ package petstore - +// InlineResponseDefault struct for InlineResponseDefault type InlineResponseDefault struct { String Foo `json:"string,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_list.go b/samples/openapi3/client/petstore/go/go-petstore/model_list.go index 12f3bd3f6600..891ded476a4d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_list.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_list.go @@ -8,7 +8,7 @@ */ package petstore - +// List struct for List type List struct { Var123List string `json:"123-list,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go index 830e760fe314..5c03afe831c1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go @@ -8,7 +8,7 @@ */ package petstore - +// MapTest struct for MapTest type MapTest struct { MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go index 0ad92e96f8ec..fcd0bc9bbddf 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -11,7 +11,7 @@ package petstore import ( "time" ) - +// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass type MixedPropertiesAndAdditionalPropertiesClass struct { Uuid string `json:"uuid,omitempty"` DateTime time.Time `json:"dateTime,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_name.go b/samples/openapi3/client/petstore/go/go-petstore/model_name.go index dde1b92eb6ab..0043908483df 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_name.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing model name same as property name +// Name Model for testing model name same as property name type Name struct { Name int32 `json:"name"` SnakeCase int32 `json:"snake_case,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go index b0c0b536e065..952129120f9a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go @@ -11,7 +11,7 @@ package petstore import ( "time" ) - +// NullableClass struct for NullableClass type NullableClass struct { IntegerProp *int32 `json:"integer_prop,omitempty"` NumberProp *float32 `json:"number_prop,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go index 7a2fd5fd8f6d..7a3eccc11746 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go @@ -8,7 +8,7 @@ */ package petstore - +// NumberOnly struct for NumberOnly type NumberOnly struct { JustNumber float32 `json:"JustNumber,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_order.go b/samples/openapi3/client/petstore/go/go-petstore/model_order.go index c81d67ae0fa4..f8bae432ae7d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_order.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_order.go @@ -11,7 +11,7 @@ package petstore import ( "time" ) - +// Order struct for Order type Order struct { Id int64 `json:"id,omitempty"` PetId int64 `json:"petId,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go index 0ebb526267e8..78ce40e67349 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go @@ -8,7 +8,7 @@ */ package petstore - +// OuterComposite struct for OuterComposite type OuterComposite struct { MyNumber float32 `json:"my_number,omitempty"` MyString string `json:"my_string,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go index 903d31e82690..efefaf1b784a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go @@ -8,6 +8,7 @@ */ package petstore +// OuterEnum the model 'OuterEnum' type OuterEnum string // List of OuterEnum @@ -15,4 +16,4 @@ const ( PLACED OuterEnum = "placed" APPROVED OuterEnum = "approved" DELIVERED OuterEnum = "delivered" -) \ No newline at end of file +) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go index 37571ae20c27..e150f03864fd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go @@ -8,6 +8,7 @@ */ package petstore +// OuterEnumDefaultValue the model 'OuterEnumDefaultValue' type OuterEnumDefaultValue string // List of OuterEnumDefaultValue @@ -15,4 +16,4 @@ const ( PLACED OuterEnumDefaultValue = "placed" APPROVED OuterEnumDefaultValue = "approved" DELIVERED OuterEnumDefaultValue = "delivered" -) \ No newline at end of file +) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go index 63cb71ec39b1..406d2aa670d4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go @@ -8,6 +8,7 @@ */ package petstore +// OuterEnumInteger the model 'OuterEnumInteger' type OuterEnumInteger int32 // List of OuterEnumInteger @@ -15,4 +16,4 @@ const ( _0 OuterEnumInteger = "0" _1 OuterEnumInteger = "1" _2 OuterEnumInteger = "2" -) \ No newline at end of file +) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go index 39521330508a..3a6b54a261b7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go @@ -8,6 +8,7 @@ */ package petstore +// OuterEnumIntegerDefaultValue the model 'OuterEnumIntegerDefaultValue' type OuterEnumIntegerDefaultValue int32 // List of OuterEnumIntegerDefaultValue @@ -15,4 +16,4 @@ const ( _0 OuterEnumIntegerDefaultValue = "0" _1 OuterEnumIntegerDefaultValue = "1" _2 OuterEnumIntegerDefaultValue = "2" -) \ No newline at end of file +) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go index 4930dbb92e8e..2979b06b3eca 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go @@ -8,7 +8,7 @@ */ package petstore - +// Pet struct for Pet type Pet struct { Id int64 `json:"id,omitempty"` Category Category `json:"category,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go index 6b22163900b0..7d1e521f4a48 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go @@ -8,7 +8,7 @@ */ package petstore - +// ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { Bar string `json:"bar,omitempty"` Baz string `json:"baz,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_return.go b/samples/openapi3/client/petstore/go/go-petstore/model_return.go index 7851dd851d31..9a029c4f8c04 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_return.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_return.go @@ -8,8 +8,7 @@ */ package petstore - -// Model for testing reserved words +// Return Model for testing reserved words type Return struct { Return int32 `json:"return,omitempty"` } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go/go-petstore/model_tag.go index 37a2b63d4451..968bd8798a32 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_tag.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_tag.go @@ -8,7 +8,7 @@ */ package petstore - +// Tag struct for Tag type Tag struct { Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_user.go b/samples/openapi3/client/petstore/go/go-petstore/model_user.go index caff75ebc2c5..a6da6f9a87f2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_user.go @@ -8,7 +8,7 @@ */ package petstore - +// User struct for User type User struct { Id int64 `json:"id,omitempty"` Username string `json:"username,omitempty"` diff --git a/samples/openapi3/client/petstore/go/go-petstore/response.go b/samples/openapi3/client/petstore/go/go-petstore/response.go index 38f373df75ee..c16f181f4e94 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/response.go @@ -13,6 +13,7 @@ import ( "net/http" ) +// APIResponse stores the API response returned by the server. type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` @@ -30,12 +31,14 @@ type APIResponse struct { Payload []byte `json:"-"` } +// NewAPIResponse returns a new APIResonse object. func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} diff --git a/samples/openapi3/client/petstore/javascript-es6/.babelrc b/samples/openapi3/client/petstore/javascript-es6/.babelrc index 67b369ed370c..c73df9d50b49 100644 --- a/samples/openapi3/client/petstore/javascript-es6/.babelrc +++ b/samples/openapi3/client/petstore/javascript-es6/.babelrc @@ -1,3 +1,33 @@ { - "presets": ["env", "stage-0"] + "presets": [ + "@babel/preset-env" + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" + ] } diff --git a/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/javascript-es6/package.json b/samples/openapi3/client/petstore/javascript-es6/package.json index 94455e4a69a7..6a738bcf3385 100644 --- a/samples/openapi3/client/petstore/javascript-es6/package.json +++ b/samples/openapi3/client/petstore/javascript-es6/package.json @@ -7,19 +7,35 @@ "scripts": { "build": "babel src -d dist", "prepack": "npm run build", - "test": "mocha --compilers js:babel-core/register --recursive" + "test": "mocha --compilers js:@babel/register --recursive" }, "browser": { "fs": false }, "dependencies": { - "babel-cli": "^6.26.0", + "@babel/cli": "^7.0.0", "superagent": "3.7.0" }, "devDependencies": { - "babel-core": "6.26.0", - "babel-preset-env": "^1.6.1", - "babel-preset-stage-0": "^6.24.1", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", "expect.js": "^0.3.1", "mocha": "^5.2.0", "sinon": "^7.2.0" diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/.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/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md new file mode 100644 index 000000000000..36d277710128 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md @@ -0,0 +1,158 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.50 + +## Build + +``` +./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. + + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*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 +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | 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/{order_id} | 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.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.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 + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### bearer_test + +- **Type**: HTTP basic authentication + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### 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/openapi3/client/petstore/kotlin-multiplatform/build.gradle b/samples/openapi3/client/petstore/kotlin-multiplatform/build.gradle new file mode 100644 index 000000000000..c976992112f3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/build.gradle @@ -0,0 +1,138 @@ +apply plugin: 'kotlin-multiplatform' +apply plugin: 'kotlinx-serialization' + +group 'org.openapitools' +version '1.0.0' + +ext { + kotlin_version = '1.3.50' + kotlinx_version = '1.1.0' + coroutines_version = '1.3.1' + serialization_version = '0.12.0' + ktor_version = '1.2.4' +} + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50" // $kotlin_version + classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.50" // $kotlin_version + } +} + +repositories { + jcenter() +} + +kotlin { + jvm() + iosArm64() { binaries { framework { freeCompilerArgs.add("-Xobjc-generics") } } } + iosX64() { binaries { framework { freeCompilerArgs.add("-Xobjc-generics") } } } + + sourceSets { + commonMain { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version" + implementation "io.ktor:ktor-client-core:$ktor_version" + implementation "io.ktor:ktor-client-json:$ktor_version" + implementation "io.ktor:ktor-client-serialization:$ktor_version" + } + } + + commonTest { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-test-common" + implementation "org.jetbrains.kotlin:kotlin-test-annotations-common" + implementation "io.ktor:ktor-client-mock:$ktor_version" + } + } + + jvmMain { + dependsOn commonMain + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version" + implementation "io.ktor:ktor-client-core-jvm:$ktor_version" + implementation "io.ktor:ktor-client-json-jvm:$ktor_version" + implementation "io.ktor:ktor-client-serialization-jvm:$ktor_version" + } + } + + jvmTest { + dependsOn commonTest + dependencies { + implementation "org.jetbrains.kotlin:kotlin-test" + implementation "org.jetbrains.kotlin:kotlin-test-junit" + implementation "io.ktor:ktor-client-mock-jvm:$ktor_version" + } + } + + iosMain { + dependsOn commonMain + dependencies { + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version" + implementation "io.ktor:ktor-client-ios:$ktor_version" + } + } + + iosTest { + dependsOn commonTest + dependencies { + implementation "io.ktor:ktor-client-mock-native:$ktor_version" + } + } + + iosArm64().compilations.main.defaultSourceSet { + dependsOn iosMain + dependencies { + implementation "io.ktor:ktor-client-ios-iosarm64:$ktor_version" + implementation "io.ktor:ktor-client-json-iosarm64:$ktor_version" + implementation "io.ktor:ktor-client-serialization-iosarm64:$ktor_version" + } + } + + iosArm64().compilations.test.defaultSourceSet { + dependsOn iosTest + } + + iosX64().compilations.main.defaultSourceSet { + dependsOn iosMain + dependencies { + implementation "io.ktor:ktor-client-ios-iosx64:$ktor_version" + implementation "io.ktor:ktor-client-json-iosx64:$ktor_version" + implementation "io.ktor:ktor-client-serialization-iosx64:$ktor_version" + } + } + + iosX64().compilations.test.defaultSourceSet { + dependsOn iosTest + } + + all { + languageSettings { + useExperimentalAnnotation('kotlin.Experimental') + } + } + } +} + +task iosTest { + def device = project.findProperty("device")?.toString() ?: "iPhone 8" + dependsOn 'linkDebugTestIosX64' + group = JavaBasePlugin.VERIFICATION_GROUP + description = "Execute unit tests on ${device} simulator" + doLast { + def binary = kotlin.targets.iosX64.binaries.getTest('DEBUG') + exec { commandLine 'xcrun', 'simctl', 'spawn', device, binary.outputFile } + } +} + +configurations { // workaround for https://youtrack.jetbrains.com/issue/KT-27170 + compileClasspath +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1025301ce946 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Animal.md new file mode 100644 index 000000000000..5ce5a4972c8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..55d482238db4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ApiResponse.md new file mode 100644 index 000000000000..6b4c6bf27795 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/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/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..7d57b3c840f5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<kotlin.Double>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5259bbe3e59 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **kotlin.Array<kotlin.Double>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayTest.md new file mode 100644 index 000000000000..aa0bbbe936c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Capitalization.md new file mode 100644 index 000000000000..9d44a82fb7ff --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Cat.md new file mode 100644 index 000000000000..b6da7c47cedd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md new file mode 100644 index 000000000000..92c9e2243d65 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ClassModel.md new file mode 100644 index 000000000000..50ad61b51a56 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Client.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Client.md new file mode 100644 index 000000000000..11afbcf0c9f5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/DefaultApi.md new file mode 100644 index 000000000000..784be537594d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Dog.md new file mode 100644 index 000000000000..41d9c6ba0d17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumArrays.md new file mode 100644 index 000000000000..719084e5f949 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumClass.md new file mode 100644 index 000000000000..5ddb262871f9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md new file mode 100644 index 000000000000..bdef500a433d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md new file mode 100644 index 000000000000..883944420153 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md @@ -0,0 +1,727 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterNumberSerialize** +> kotlin.Double fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Double = 8.14 // kotlin.Double | Input number as post body +try { + val result : kotlin.Double = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Double**| Input number as post body | [optional] + +### Return type + +**kotlin.Double** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **testEndpointParameters** +> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : kotlin.Double = 8.14 // kotlin.Double | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | None +val date : kotlin.String = 2013-10-20 // kotlin.String | None +val dateTime : kotlin.String = 2013-10-20T19:20:30+01:00 // kotlin.String | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **kotlin.Double**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **io.ktor.client.request.forms.InputProvider**| None | [optional] + **date** | **kotlin.String**| None | [optional] + **dateTime** | **kotlin.String**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..962dfd4d2dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..86b89d253d69 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**io.ktor.client.request.forms.InputProvider**](io.ktor.client.request.forms.InputProvider.md) | | [optional] +**files** | [**kotlin.Array<io.ktor.client.request.forms.InputProvider>**](io.ktor.client.request.forms.InputProvider.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Foo.md new file mode 100644 index 000000000000..e3e9918872b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md new file mode 100644 index 000000000000..f973a49e0958 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**number** | **kotlin.Double** | | +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**byte** | **kotlin.ByteArray** | | +**binary** | [**io.ktor.client.request.forms.InputProvider**](io.ktor.client.request.forms.InputProvider.md) | | [optional] +**date** | **kotlin.String** | | +**dateTime** | **kotlin.String** | | [optional] +**uuid** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..22f5ebf51708 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] +**foo** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/HealthCheckResult.md new file mode 100644 index 000000000000..472dc3104571 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject.md new file mode 100644 index 000000000000..2156c70addfe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject1.md new file mode 100644 index 000000000000..43c5b5f742c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**io.ktor.client.request.forms.InputProvider**](io.ktor.client.request.forms.InputProvider.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject2.md new file mode 100644 index 000000000000..0720925918bf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md new file mode 100644 index 000000000000..82bf6d182b6e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**number** | **kotlin.Double** | None | +**float** | **kotlin.Float** | None | [optional] +**double** | **kotlin.Double** | None | +**string** | **kotlin.String** | None | [optional] +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**binary** | [**io.ktor.client.request.forms.InputProvider**](io.ktor.client.request.forms.InputProvider.md) | None | [optional] +**date** | **kotlin.String** | None | [optional] +**dateTime** | **kotlin.String** | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject4.md new file mode 100644 index 000000000000..03c4daa76318 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md new file mode 100644 index 000000000000..9e7765c3aa6a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**requiredFile** | [**io.ktor.client.request.forms.InputProvider**](io.ktor.client.request.forms.InputProvider.md) | file to upload | + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..afdd81b1383e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md new file mode 100644 index 000000000000..13a09a4c4141 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md new file mode 100644 index 000000000000..36a1d460467c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, `inner`Enum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..f597e44437bc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **kotlin.String** | | [optional] +**dateTime** | **kotlin.String** | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Name.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Name.md new file mode 100644 index 000000000000..7eb6f21121e5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/NullableClass.md new file mode 100644 index 000000000000..7461cacac88f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | **kotlin.Double** | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | **kotlin.String** | | [optional] +**datetimeProp** | **kotlin.String** | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/NumberOnly.md new file mode 100644 index 000000000000..c70c4304fbf4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **kotlin.Double** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Order.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Order.md new file mode 100644 index 000000000000..4683c14c1cbe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/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** | **kotlin.String** | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterComposite.md new file mode 100644 index 000000000000..6da2c5e7fb95 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **kotlin.Double** | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnum.md new file mode 100644 index 000000000000..9e7ecb9499a4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..821d297a001b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b40f6e4b7ef9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..c2fb3ee41d7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md new file mode 100644 index 000000000000..ec7756007379 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/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/openapi3/client/petstore/kotlin-multiplatform/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/PetApi.md new file mode 100644 index 000000000000..a07ff10e9376 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/PetApi.md @@ -0,0 +1,457 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/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 +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(pet) + +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 pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} 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 +------------- | ------------- | ------------- | ------------- + **pet** | [**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(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} 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 +------------- | ------------- | ------------- | ------------- + **pet** | [**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 : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | 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** | **io.ktor.client.request.forms.InputProvider**| 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 + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### 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 requiredFile : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **io.ktor.client.request.forms.InputProvider**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [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/openapi3/client/petstore/kotlin-multiplatform/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..26aa9f3ac4d7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Return.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Return.md new file mode 100644 index 000000000000..a5437240dc32 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md new file mode 100644 index 000000000000..282649449d96 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/StoreApi.md new file mode 100644 index 000000000000..55bd8afdbc09 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | 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(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + 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 +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/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/openapi3/client/petstore/kotlin-multiplatform/docs/User.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/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/openapi3/client/petstore/kotlin-multiplatform/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/UserApi.md new file mode 100644 index 000000000000..dbf78e81eb22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/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(user) + +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 user : User = // User | Created user object +try { + apiInstance.createUser(user) +} 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 +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +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 user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} 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 +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +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 user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} 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 +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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, user) + +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 user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} 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 | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000000..2c6137b87896 Binary files /dev/null and b/samples/openapi3/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..ce3ca77db54b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue May 17 23:08:05 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/gradlew b/samples/openapi3/client/petstore/kotlin-multiplatform/gradlew new file mode 100644 index 000000000000..9d82f7891513 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# 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 + +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" ] ; 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, switch paths to Windows format before running java +if $cygwin ; 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=$((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 + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/gradlew.bat b/samples/openapi3/client/petstore/kotlin-multiplatform/gradlew.bat new file mode 100644 index 000000000000..5f192121eb4f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/gradlew.bat @@ -0,0 +1,90 @@ +@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 + +@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= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@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 +if "%@eval[2+2]" == "4" goto 4NT_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=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +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/openapi3/client/petstore/kotlin-multiplatform/settings.gradle b/samples/openapi3/client/petstore/kotlin-multiplatform/settings.gradle new file mode 100644 index 000000000000..b000833f485c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/settings.gradle @@ -0,0 +1,2 @@ +enableFeaturePreview('GRADLE_METADATA') +rootProject.name = 'kotlin-client-petstore-multiplatform' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 000000000000..7d72ccb712ba --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,76 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Client + +import org.openapitools.client.infrastructure.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class AnotherFakeApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model + * @return Client + */ + @Suppress("UNCHECKED_CAST") + suspend fun call123testSpecialTags(client: Client) : HttpResponse { + + val localVariableBody = client + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PATCH, + "/another-fake/dummy", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 000000000000..49da05cc1e56 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,74 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.InlineResponseDefault + +import org.openapitools.client.infrastructure.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class DefaultApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * + * + * @return InlineResponseDefault + */ + @Suppress("UNCHECKED_CAST") + suspend fun fooGet() : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/foo", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 000000000000..e7a28b7e2919 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,547 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class FakeApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * Health check endpoint + * + * @return HealthCheckResult + */ + @Suppress("UNCHECKED_CAST") + suspend fun fakeHealthGet() : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/health", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return kotlin.Boolean + */ + @Suppress("UNCHECKED_CAST") + suspend fun fakeOuterBooleanSerialize(body: kotlin.Boolean?) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/boolean", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return OuterComposite + */ + @Suppress("UNCHECKED_CAST") + suspend fun fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : HttpResponse { + + val localVariableBody = outerComposite + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/composite", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return kotlin.Double + */ + @Suppress("UNCHECKED_CAST") + suspend fun fakeOuterNumberSerialize(body: kotlin.Double?) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/number", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return kotlin.String + */ + @Suppress("UNCHECKED_CAST") + suspend fun fakeOuterStringSerialize(body: kotlin.String?) : HttpResponse { + + val localVariableBody = body + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/string", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass + * @return void + */ + suspend fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : HttpResponse { + + val localVariableBody = fileSchemaTestClass + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/body-with-file-schema", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * + * + * @param query + * @param user + * @return void + */ + suspend fun testBodyWithQueryParams(query: kotlin.String, user: User) : HttpResponse { + + val localVariableBody = user + + val localVariableQuery = mutableMapOf>() + query?.apply { localVariableQuery["query"] = listOf("$query") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/body-with-query-params", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model + * @return Client + */ + @Suppress("UNCHECKED_CAST") + suspend fun testClientModel(client: Client) : HttpResponse { + + val localVariableBody = client + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PATCH, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return void + */ + suspend fun testEndpointParameters(number: kotlin.Double, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: io.ktor.client.request.forms.InputProvider?, date: kotlin.String?, dateTime: kotlin.String?, password: kotlin.String?, paramCallback: kotlin.String?) : HttpResponse { + + val localVariableBody = + ParametersBuilder().also { + integer?.apply { it.append("integer", integer.toString()) } + int32?.apply { it.append("int32", int32.toString()) } + int64?.apply { it.append("int64", int64.toString()) } + number?.apply { it.append("number", number.toString()) } + float?.apply { it.append("float", float.toString()) } + double?.apply { it.append("double", double.toString()) } + string?.apply { it.append("string", string.toString()) } + patternWithoutDelimiter?.apply { it.append("pattern_without_delimiter", patternWithoutDelimiter.toString()) } + byte?.apply { it.append("byte", byte.toString()) } + binary?.apply { it.append("binary", binary.toString()) } + date?.apply { it.append("date", date.toString()) } + dateTime?.apply { it.append("dateTime", dateTime.toString()) } + password?.apply { it.append("password", password.toString()) } + paramCallback?.apply { it.append("callback", paramCallback.toString()) } + }.build() + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return urlEncodedFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to '-efg') + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to '-efg') + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to '$') + * @param enumFormString Form parameter enum test (string) (optional, default to '-efg') + * @return void + */ + suspend fun testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : HttpResponse { + + val localVariableBody = + ParametersBuilder().also { + enumFormStringArray?.apply { it.append("enum_form_string_array", enumFormStringArray.toString()) } + enumFormString?.apply { it.append("enum_form_string", enumFormString.toString()) } + }.build() + + val localVariableQuery = mutableMapOf>() + enumQueryStringArray?.apply { localVariableQuery["enum_query_string_array"] = toMultiValue(this, "multi") } + enumQueryString?.apply { localVariableQuery["enum_query_string"] = listOf("$enumQueryString") } + enumQueryInteger?.apply { localVariableQuery["enum_query_integer"] = listOf("$enumQueryInteger") } + enumQueryDouble?.apply { localVariableQuery["enum_query_double"] = listOf("$enumQueryDouble") } + + val localVariableHeaders = mutableMapOf() + enumHeaderStringArray?.apply { localVariableHeaders["enum_header_string_array"] = this.joinToString(separator = collectionDelimiter("csv")) } + enumHeaderString?.apply { localVariableHeaders["enum_header_string"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return urlEncodedFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return void + */ + suspend fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + requiredStringGroup?.apply { localVariableQuery["required_string_group"] = listOf("$requiredStringGroup") } + requiredInt64Group?.apply { localVariableQuery["required_int64_group"] = listOf("$requiredInt64Group") } + stringGroup?.apply { localVariableQuery["string_group"] = listOf("$stringGroup") } + int64Group?.apply { localVariableQuery["int64_group"] = listOf("$int64Group") } + + val localVariableHeaders = mutableMapOf() + requiredBooleanGroup?.apply { localVariableHeaders["required_boolean_group"] = this.toString() } + booleanGroup?.apply { localVariableHeaders["boolean_group"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * test inline additionalProperties + * + * @param requestBody request body + * @return void + */ + suspend fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : HttpResponse { + + val localVariableBody = TestInlineAdditionalPropertiesRequest(requestBody) + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/inline-additionalProperties", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + @Serializable +private class TestInlineAdditionalPropertiesRequest(val value: Map) { + @Serializer(TestInlineAdditionalPropertiesRequest::class) + companion object : KSerializer { + private val serializer: KSerializer> = (kotlin.String.serializer() to kotlin.String.serializer()).map + override val descriptor = StringDescriptor.withName("TestInlineAdditionalPropertiesRequest") + override fun serialize(encoder: Encoder, obj: TestInlineAdditionalPropertiesRequest) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = TestInlineAdditionalPropertiesRequest(serializer.deserialize(decoder)) + } +} + + /** + * test json serialization of form data + * + * @param param field1 + * @param param2 field2 + * @return void + */ + suspend fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : HttpResponse { + + val localVariableBody = + ParametersBuilder().also { + param?.apply { it.append("param", param.toString()) } + param2?.apply { it.append("param2", param2.toString()) } + }.build() + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/jsonFormData", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return urlEncodedFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * + * To test the collection format in query parameters + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context + * @return void + */ + suspend fun testQueryParameterCollectionFormat(pipe: kotlin.Array, ioutil: kotlin.Array, http: kotlin.Array, url: kotlin.Array, context: kotlin.Array) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + pipe?.apply { localVariableQuery["pipe"] = toMultiValue(this, "multi") } + ioutil?.apply { localVariableQuery["ioutil"] = toMultiValue(this, "csv") } + http?.apply { localVariableQuery["http"] = toMultiValue(this, "space") } + url?.apply { localVariableQuery["url"] = toMultiValue(this, "csv") } + context?.apply { localVariableQuery["context"] = toMultiValue(this, "multi") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/test-query-paramters", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + + + + + + + serializer.setMapper(TestInlineAdditionalPropertiesRequest::class, TestInlineAdditionalPropertiesRequest.serializer()) + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 000000000000..f90f98786ef6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,76 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Client + +import org.openapitools.client.infrastructure.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class FakeClassnameTags123Api @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model + * @return Client + */ + @Suppress("UNCHECKED_CAST") + suspend fun testClassname(client: Client) : HttpResponse { + + val localVariableBody = client + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PATCH, + "/fake_classname_test", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..dd85a10282c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,355 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class PetApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return void + */ + suspend fun addPet(pet: Pet) : HttpResponse { + + val localVariableBody = pet + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + */ + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun findPetsByStatus(status: kotlin.Array) : HttpResponse> { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + status?.apply { localVariableQuery["status"] = toMultiValue(this, "csv") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap().map { value.toTypedArray() } + } + + @Serializable +private class FindPetsByStatusResponse(val value: List) { + @Serializer(FindPetsByStatusResponse::class) + companion object : KSerializer { + private val serializer: KSerializer> = Pet.serializer().list + override val descriptor = StringDescriptor.withName("FindPetsByStatusResponse") + override fun serialize(encoder: Encoder, obj: FindPetsByStatusResponse) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = FindPetsByStatusResponse(serializer.deserialize(decoder)) + } +} + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun findPetsByTags(tags: kotlin.Array) : HttpResponse> { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + tags?.apply { localVariableQuery["tags"] = toMultiValue(this, "csv") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap().map { value.toTypedArray() } + } + + @Serializable +private class FindPetsByTagsResponse(val value: List) { + @Serializer(FindPetsByTagsResponse::class) + companion object : KSerializer { + private val serializer: KSerializer> = Pet.serializer().list + override val descriptor = StringDescriptor.withName("FindPetsByTagsResponse") + override fun serialize(encoder: Encoder, obj: FindPetsByTagsResponse) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = FindPetsByTagsResponse(serializer.deserialize(decoder)) + } +} + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + @Suppress("UNCHECKED_CAST") + suspend fun getPetById(petId: kotlin.Long) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return void + */ + suspend fun updatePet(pet: Pet) : HttpResponse { + + val localVariableBody = pet + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * 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 + */ + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : HttpResponse { + + val localVariableBody = + ParametersBuilder().also { + name?.apply { it.append("name", name.toString()) } + status?.apply { it.append("status", status.toString()) } + }.build() + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return urlEncodedFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?) : HttpResponse { + + val localVariableBody = + formData { + additionalMetadata?.apply { append("additionalMetadata", additionalMetadata) } + file?.apply { append("file", file) } + } + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return multipartFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * uploads an image (required) + * + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse + */ + @Suppress("UNCHECKED_CAST") + suspend fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: io.ktor.client.request.forms.InputProvider, additionalMetadata: kotlin.String?) : HttpResponse { + + val localVariableBody = + formData { + additionalMetadata?.apply { append("additionalMetadata", additionalMetadata) } + requiredFile?.apply { append("requiredFile", requiredFile) } + } + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return multipartFormRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + serializer.setMapper(FindPetsByStatusResponse::class, FindPetsByStatusResponse.serializer()) + serializer.setMapper(FindPetsByTagsResponse::class, FindPetsByTagsResponse.serializer()) + + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..734883da99dc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,175 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class StoreApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * 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 + */ + suspend fun deleteOrder(orderId: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + @Suppress("UNCHECKED_CAST") + suspend fun getInventory() : HttpResponse> { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap().map { value } + } + + @Serializable +private class GetInventoryResponse(val value: Map) { + @Serializer(GetInventoryResponse::class) + companion object : KSerializer { + private val serializer: KSerializer> = (kotlin.String.serializer() to kotlin.Int.serializer()).map + override val descriptor = StringDescriptor.withName("GetInventoryResponse") + override fun serialize(encoder: Encoder, obj: GetInventoryResponse) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = GetInventoryResponse(serializer.deserialize(decoder)) + } +} + + /** + * 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 + */ + @Suppress("UNCHECKED_CAST") + suspend fun getOrderById(orderId: kotlin.Long) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return Order + */ + @Suppress("UNCHECKED_CAST") + suspend fun placeOrder(order: Order) : HttpResponse { + + val localVariableBody = order + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + serializer.setMapper(GetInventoryResponse::class, GetInventoryResponse.serializer()) + + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..266689874c93 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,304 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.* +import io.ktor.client.request.forms.formData +import kotlinx.serialization.UnstableDefault +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.serializer.KotlinxSerializer +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.internal.StringDescriptor + +class UserApi @UseExperimental(UnstableDefault::class) constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + serializer: KotlinxSerializer) + : ApiClient(baseUrl, httpClientEngine, serializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: kotlin.String = "http://petstore.swagger.io:80/v2", + httpClientEngine: HttpClientEngine? = null, + jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) + : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return void + */ + suspend fun createUser(user: User) : HttpResponse { + + val localVariableBody = user + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + */ + suspend fun createUsersWithArrayInput(user: kotlin.Array) : HttpResponse { + + val localVariableBody = CreateUsersWithArrayInputRequest(user.asList()) + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + @Serializable +private class CreateUsersWithArrayInputRequest(val value: List) { + @Serializer(CreateUsersWithArrayInputRequest::class) + companion object : KSerializer { + private val serializer: KSerializer> = User.serializer().list + override val descriptor = StringDescriptor.withName("CreateUsersWithArrayInputRequest") + override fun serialize(encoder: Encoder, obj: CreateUsersWithArrayInputRequest) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = CreateUsersWithArrayInputRequest(serializer.deserialize(decoder)) + } +} + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + */ + suspend fun createUsersWithListInput(user: kotlin.Array) : HttpResponse { + + val localVariableBody = CreateUsersWithListInputRequest(user.asList()) + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + @Serializable +private class CreateUsersWithListInputRequest(val value: List) { + @Serializer(CreateUsersWithListInputRequest::class) + companion object : KSerializer { + private val serializer: KSerializer> = User.serializer().list + override val descriptor = StringDescriptor.withName("CreateUsersWithListInputRequest") + override fun serialize(encoder: Encoder, obj: CreateUsersWithListInputRequest) = serializer.serialize(encoder, obj.value) + override fun deserialize(decoder: Decoder) = CreateUsersWithListInputRequest(serializer.deserialize(decoder)) + } +} + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + suspend fun deleteUser(username: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + @Suppress("UNCHECKED_CAST") + suspend fun getUserByName(username: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + @Suppress("UNCHECKED_CAST") + suspend fun loginUser(username: kotlin.String, password: kotlin.String) : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + username?.apply { localVariableQuery["username"] = listOf("$username") } + password?.apply { localVariableQuery["password"] = listOf("$password") } + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Logs out current logged in user session + * + * @return void + */ + suspend fun logoutUser() : HttpResponse { + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return request( + localVariableConfig, + localVariableBody + ).wrap() + } + + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return void + */ + suspend fun updateUser(username: kotlin.String, user: User) : HttpResponse { + + val localVariableBody = user + + val localVariableQuery = mutableMapOf>() + + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody + ).wrap() + } + + + + + companion object { + internal fun setMappers(serializer: KotlinxSerializer) { + + serializer.setMapper(CreateUsersWithArrayInputRequest::class, CreateUsersWithArrayInputRequest.serializer()) + serializer.setMapper(CreateUsersWithListInputRequest::class, CreateUsersWithListInputRequest.serializer()) + + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..f97cb88d2338 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = Map> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipes" -> "|" + "ssv" -> " " + 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/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..e87eecb1b88f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,179 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.call.call +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.features.json.JsonFeature +import io.ktor.client.features.json.JsonSerializer +import io.ktor.client.features.json.serializer.KotlinxSerializer +import io.ktor.client.request.accept +import io.ktor.client.request.forms.FormDataContent +import io.ktor.client.request.forms.MultiPartFormDataContent +import io.ktor.client.request.header +import io.ktor.client.request.parameter +import io.ktor.client.response.HttpResponse +import io.ktor.client.utils.EmptyContent +import io.ktor.http.* +import io.ktor.http.content.OutgoingContent +import io.ktor.http.content.PartData +import kotlinx.serialization.UnstableDefault +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration + +import org.openapitools.client.apis.* +import org.openapitools.client.models.* + +open class ApiClient( + private val baseUrl: String, + httpClientEngine: HttpClientEngine?, + serializer: KotlinxSerializer) { + + @UseExperimental(UnstableDefault::class) + constructor( + baseUrl: String, + httpClientEngine: HttpClientEngine?, + jsonConfiguration: JsonConfiguration) : + this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) + + private val serializer: JsonSerializer by lazy { + serializer.apply { setMappers(this) }.ignoreOutgoingContent() + } + + private val client: HttpClient by lazy { + val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } + val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } + httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) + } + + companion object { + protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) + + private fun setMappers(serializer: KotlinxSerializer) { + + AnotherFakeApi.setMappers(serializer) + + DefaultApi.setMappers(serializer) + + FakeApi.setMappers(serializer) + + FakeClassnameTags123Api.setMappers(serializer) + + PetApi.setMappers(serializer) + + StoreApi.setMappers(serializer) + + UserApi.setMappers(serializer) + + serializer.setMapper(AdditionalPropertiesClass::class, AdditionalPropertiesClass.serializer()) + serializer.setMapper(Animal::class, Animal.serializer()) + serializer.setMapper(ApiResponse::class, ApiResponse.serializer()) + serializer.setMapper(ArrayOfArrayOfNumberOnly::class, ArrayOfArrayOfNumberOnly.serializer()) + serializer.setMapper(ArrayOfNumberOnly::class, ArrayOfNumberOnly.serializer()) + serializer.setMapper(ArrayTest::class, ArrayTest.serializer()) + serializer.setMapper(Capitalization::class, Capitalization.serializer()) + serializer.setMapper(Cat::class, Cat.serializer()) + serializer.setMapper(CatAllOf::class, CatAllOf.serializer()) + serializer.setMapper(Category::class, Category.serializer()) + serializer.setMapper(ClassModel::class, ClassModel.serializer()) + serializer.setMapper(Client::class, Client.serializer()) + serializer.setMapper(Dog::class, Dog.serializer()) + serializer.setMapper(DogAllOf::class, DogAllOf.serializer()) + serializer.setMapper(EnumArrays::class, EnumArrays.serializer()) + serializer.setMapper(EnumClass::class, EnumClass.serializer()) + serializer.setMapper(EnumTest::class, EnumTest.serializer()) + serializer.setMapper(FileSchemaTestClass::class, FileSchemaTestClass.serializer()) + serializer.setMapper(Foo::class, Foo.serializer()) + serializer.setMapper(FormatTest::class, FormatTest.serializer()) + serializer.setMapper(HasOnlyReadOnly::class, HasOnlyReadOnly.serializer()) + serializer.setMapper(HealthCheckResult::class, HealthCheckResult.serializer()) + serializer.setMapper(InlineObject::class, InlineObject.serializer()) + serializer.setMapper(InlineObject1::class, InlineObject1.serializer()) + serializer.setMapper(InlineObject2::class, InlineObject2.serializer()) + serializer.setMapper(InlineObject3::class, InlineObject3.serializer()) + serializer.setMapper(InlineObject4::class, InlineObject4.serializer()) + serializer.setMapper(InlineObject5::class, InlineObject5.serializer()) + serializer.setMapper(InlineResponseDefault::class, InlineResponseDefault.serializer()) + serializer.setMapper(List::class, List.serializer()) + serializer.setMapper(MapTest::class, MapTest.serializer()) + serializer.setMapper(MixedPropertiesAndAdditionalPropertiesClass::class, MixedPropertiesAndAdditionalPropertiesClass.serializer()) + serializer.setMapper(Model200Response::class, Model200Response.serializer()) + serializer.setMapper(Name::class, Name.serializer()) + serializer.setMapper(NullableClass::class, NullableClass.serializer()) + serializer.setMapper(NumberOnly::class, NumberOnly.serializer()) + serializer.setMapper(Order::class, Order.serializer()) + serializer.setMapper(OuterComposite::class, OuterComposite.serializer()) + serializer.setMapper(OuterEnum::class, OuterEnum.serializer()) + serializer.setMapper(OuterEnumDefaultValue::class, OuterEnumDefaultValue.serializer()) + serializer.setMapper(OuterEnumInteger::class, OuterEnumInteger.serializer()) + serializer.setMapper(OuterEnumIntegerDefaultValue::class, OuterEnumIntegerDefaultValue.serializer()) + serializer.setMapper(Pet::class, Pet.serializer()) + serializer.setMapper(ReadOnlyFirst::class, ReadOnlyFirst.serializer()) + serializer.setMapper(Return::class, Return.serializer()) + serializer.setMapper(SpecialModelname::class, SpecialModelname.serializer()) + serializer.setMapper(Tag::class, Tag.serializer()) + serializer.setMapper(User::class, User.serializer()) + } + } + + protected suspend fun multipartFormRequest(requestConfig: RequestConfig, body: List?): HttpResponse { + return request(requestConfig, MultiPartFormDataContent(body ?: listOf())) + } + + protected suspend fun urlEncodedFormRequest(requestConfig: RequestConfig, body: Parameters?): HttpResponse { + return request(requestConfig, FormDataContent(body ?: Parameters.Empty)) + } + + protected suspend fun jsonRequest(requestConfig: RequestConfig, body: Any? = null): HttpResponse { + val contentType = (requestConfig.headers[HttpHeaders.ContentType]?.let { ContentType.parse(it) } + ?: ContentType.Application.Json) + return if (body != null) request(requestConfig, serializer.write(body, contentType)) + else request(requestConfig) + } + + protected suspend fun request(requestConfig: RequestConfig, body: OutgoingContent = EmptyContent): HttpResponse { + val headers = requestConfig.headers + + return client.call { + this.url { + this.takeFrom(URLBuilder(baseUrl)) + appendPath(requestConfig.path.trimStart('/').split('/')) + requestConfig.query.forEach { query -> + query.value.forEach { value -> + parameter(query.key, value) + } + } + } + this.method = requestConfig.method.httpMethod + headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + this.body = body + + }.response + } + + private fun URLBuilder.appendPath(components: List): URLBuilder = apply { + encodedPath = encodedPath.trimEnd('/') + components.joinToString("/", prefix = "/") { it.encodeURLQueryComponent() } + } + + private val RequestMethod.httpMethod: HttpMethod + get() = when (this) { + RequestMethod.DELETE -> HttpMethod.Delete + RequestMethod.GET -> HttpMethod.Get + RequestMethod.HEAD -> HttpMethod.Head + RequestMethod.PATCH -> HttpMethod.Patch + RequestMethod.PUT -> HttpMethod.Put + RequestMethod.POST -> HttpMethod.Post + RequestMethod.OPTIONS -> HttpMethod.Options + } +} + +// https://github.com/ktorio/ktor/issues/851 +private fun JsonSerializer.ignoreOutgoingContent() = IgnoreOutgoingContentJsonSerializer(this) + +private class IgnoreOutgoingContentJsonSerializer(private val delegate: JsonSerializer) : JsonSerializer by delegate { + override fun write(data: Any): OutgoingContent { + if (data is OutgoingContent) return data + return delegate.write(data) + } +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt new file mode 100644 index 000000000000..c457eb4bce0b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt @@ -0,0 +1,51 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.call.TypeInfo +import io.ktor.client.call.typeInfo +import io.ktor.http.Headers +import io.ktor.http.isSuccess + +open class HttpResponse(val response: io.ktor.client.response.HttpResponse, val provider: BodyProvider) { + val status: Int = response.status.value + val success: Boolean = response.status.isSuccess() + val headers: Map> = response.headers.mapEntries() + suspend fun body(): T = provider.body(response) + suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type) + + companion object { + private fun Headers.mapEntries(): Map> { + val result = mutableMapOf>() + entries().forEach { result[it.key] = it.value } + return result + } + } +} + +interface BodyProvider { + suspend fun body(response: io.ktor.client.response.HttpResponse): T + suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V +} + +class TypedBodyProvider(private val type: TypeInfo) : BodyProvider { + @Suppress("UNCHECKED_CAST") + override suspend fun body(response: io.ktor.client.response.HttpResponse): T = + response.call.receive(type) as T + + @Suppress("UNCHECKED_CAST") + override suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V = + response.call.receive(type) as V +} + +class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider { + override suspend fun body(response: io.ktor.client.response.HttpResponse): T = + block(provider.body(response)) + + override suspend fun typedBody(response: io.ktor.client.response.HttpResponse, type: TypeInfo): V = + provider.typedBody(response, type) +} + +inline fun io.ktor.client.response.HttpResponse.wrap(): HttpResponse = + HttpResponse(this, TypedBodyProvider(typeInfo())) + +fun HttpResponse.map(block: T.() -> V): HttpResponse = + HttpResponse(response, MappedBodyProvider(provider, block)) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..53e689237d71 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/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: Map> = mapOf() +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/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/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 000000000000..5aaa7a106de7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ +@Serializable +data class AdditionalPropertiesClass ( + @SerialName(value = "mapProperty") val mapProperty: kotlin.collections.Map? = null, + @SerialName(value = "mapOfMapProperty") val mapOfMapProperty: kotlin.collections.Map>? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 000000000000..5e9cd111633c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param className + * @param color + */ +@Serializable +data class Animal ( + @SerialName(value = "className") @Required val className: kotlin.String, + @SerialName(value = "color") val color: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..805244a3762e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param code + * @param type + * @param message + */ +@Serializable +data class ApiResponse ( + @SerialName(value = "code") val code: kotlin.Int? = null, + @SerialName(value = "type") val type: kotlin.String? = null, + @SerialName(value = "message") val message: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 000000000000..df7774515f41 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param arrayArrayNumber + */ +@Serializable +data class ArrayOfArrayOfNumberOnly ( + @SerialName(value = "arrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 000000000000..36f32d28a2c0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param arrayNumber + */ +@Serializable +data class ArrayOfNumberOnly ( + @SerialName(value = "arrayNumber") val arrayNumber: kotlin.Array? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 000000000000..6c142356cc79 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,30 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.ReadOnlyFirst + +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ +@Serializable +data class ArrayTest ( + @SerialName(value = "arrayOfString") val arrayOfString: kotlin.Array? = null, + @SerialName(value = "arrayArrayOfInteger") val arrayArrayOfInteger: kotlin.Array>? = null, + @SerialName(value = "arrayArrayOfModel") val arrayArrayOfModel: kotlin.Array>? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 000000000000..2f28e4dcabbe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ +@Serializable +data class Capitalization ( + @SerialName(value = "smallCamel") val smallCamel: kotlin.String? = null, + @SerialName(value = "capitalCamel") val capitalCamel: kotlin.String? = null, + @SerialName(value = "smallSnake") val smallSnake: kotlin.String? = null, + @SerialName(value = "capitalSnake") val capitalSnake: kotlin.String? = null, + @SerialName(value = "scAETHFlowPoints") val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerialName(value = "ATT_NAME") val ATT_NAME: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 000000000000..99b024d1ce1e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Animal +import org.openapitools.client.models.CatAllOf + +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param declawed + */ +@Serializable +data class Cat ( + @SerialName(value = "className") @Required val className: kotlin.String, + @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null, + @SerialName(value = "color") val color: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..d7a72badbcdf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param declawed + */ +@Serializable +data class CatAllOf ( + @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..da08e8cca659 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param id + * @param name + */ +@Serializable +data class Category ( + @SerialName(value = "name") @Required val name: kotlin.String, + @SerialName(value = "id") val id: kotlin.Long? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 000000000000..dff4f30ec63a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ +@Serializable +data class ClassModel ( + @SerialName(value = "propertyClass") val propertyClass: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 000000000000..30d316bd7064 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param client + */ +@Serializable +data class Client ( + @SerialName(value = "client") val client: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 000000000000..e7e905cf4349 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Animal +import org.openapitools.client.models.DogAllOf + +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param breed + */ +@Serializable +data class Dog ( + @SerialName(value = "className") @Required val className: kotlin.String, + @SerialName(value = "breed") val breed: kotlin.String? = null, + @SerialName(value = "color") val color: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..6e18a5729e29 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param breed + */ +@Serializable +data class DogAllOf ( + @SerialName(value = "breed") val breed: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 000000000000..b3e8f49905fd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -0,0 +1,60 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param justSymbol + * @param arrayEnum + */ +@Serializable +data class EnumArrays ( + @SerialName(value = "justSymbol") val justSymbol: EnumArrays.JustSymbol? = null, + @SerialName(value = "arrayEnum") val arrayEnum: kotlin.Array? = null +) +{ + + /** + * + * Values: greaterThanEqual,dollar + */ + @Serializable(with = JustSymbol.Serializer::class) + enum class JustSymbol(val value: kotlin.String){ + + greaterThanEqual(">="), + + dollar("$"); + + + object Serializer : CommonEnumSerializer("JustSymbol", values(), values().map { it.value }.toTypedArray()) + } + + /** + * + * Values: fish,crab + */ + @Serializable(with = ArrayEnum.Serializer::class) + enum class ArrayEnum(val value: kotlin.String){ + + fish("fish"), + + crab("crab"); + + + object Serializer : CommonEnumSerializer("ArrayEnum", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 000000000000..ad529883550f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ +@Serializable(with = EnumClass.Serializer::class) +enum class EnumClass(val value: kotlin.String){ + + + abc("_abc"), + + + minusEfg("-efg"), + + + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + object Serializer : CommonEnumSerializer("EnumClass", values(), values().map { it.value }.toTypedArray()) +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 000000000000..9490d63cafcd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,110 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param enumString + * @param enumStringRequired + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ +@Serializable +data class EnumTest ( + @SerialName(value = "enumStringRequired") @Required val enumStringRequired: EnumTest.EnumStringRequired, + @SerialName(value = "enumString") val enumString: EnumTest.EnumString? = null, + @SerialName(value = "enumInteger") val enumInteger: EnumTest.EnumInteger? = null, + @SerialName(value = "enumNumber") val enumNumber: EnumTest.EnumNumber? = null, + @SerialName(value = "outerEnum") val outerEnum: OuterEnum? = null, + @SerialName(value = "outerEnumInteger") val outerEnumInteger: OuterEnumInteger? = null, + @SerialName(value = "outerEnumDefaultValue") val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerialName(value = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) +{ + + /** + * + * Values: uPPER,lower,eMPTY + */ + @Serializable(with = EnumString.Serializer::class) + enum class EnumString(val value: kotlin.String){ + + uPPER("UPPER"), + + lower("lower"), + + eMPTY(""); + + + object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value }.toTypedArray()) + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + @Serializable(with = EnumStringRequired.Serializer::class) + enum class EnumStringRequired(val value: kotlin.String){ + + uPPER("UPPER"), + + lower("lower"), + + eMPTY(""); + + + object Serializer : CommonEnumSerializer("EnumStringRequired", values(), values().map { it.value }.toTypedArray()) + } + + /** + * + * Values: _1,minus1 + */ + @Serializable(with = EnumInteger.Serializer::class) + enum class EnumInteger(val value: kotlin.Int){ + + _1(1), + + minus1(-1); + + + object Serializer : CommonEnumSerializer("EnumInteger", values(), values().map { it.value }.toTypedArray()) + } + + /** + * + * Values: _1period1,minus1Period2 + */ + @Serializable(with = EnumNumber.Serializer::class) + enum class EnumNumber(val value: kotlin.Double){ + + _1period1(1.1), + + minus1Period2(-1.2); + + + object Serializer : CommonEnumSerializer("EnumNumber", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 000000000000..3ec73e7f41b8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param file + * @param files + */ +@Serializable +data class FileSchemaTestClass ( + @SerialName(value = "file") val file: io.ktor.client.request.forms.InputProvider? = null, + @SerialName(value = "files") val files: kotlin.Array? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 000000000000..f208e3add1d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param bar + */ +@Serializable +data class Foo ( + @SerialName(value = "bar") val bar: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 000000000000..8f1d98714aad --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param integer + * @param int32 + * @param int64 + * @param number + * @param float + * @param double + * @param string + * @param byte + * @param binary + * @param date + * @param dateTime + * @param uuid + * @param password + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ +@Serializable +data class FormatTest ( + @SerialName(value = "number") @Required val number: kotlin.Double, + @SerialName(value = "byte") @Required val byte: kotlin.ByteArray, + @SerialName(value = "date") @Required val date: kotlin.String, + @SerialName(value = "password") @Required val password: kotlin.String, + @SerialName(value = "integer") val integer: kotlin.Int? = null, + @SerialName(value = "int32") val int32: kotlin.Int? = null, + @SerialName(value = "int64") val int64: kotlin.Long? = null, + @SerialName(value = "float") val float: kotlin.Float? = null, + @SerialName(value = "double") val double: kotlin.Double? = null, + @SerialName(value = "string") val string: kotlin.String? = null, + @SerialName(value = "binary") val binary: io.ktor.client.request.forms.InputProvider? = null, + @SerialName(value = "dateTime") val dateTime: kotlin.String? = null, + @SerialName(value = "uuid") val uuid: kotlin.String? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerialName(value = "patternWithDigits") val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerialName(value = "patternWithDigitsAndDelimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 000000000000..617c8a98b847 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param bar + * @param foo + */ +@Serializable +data class HasOnlyReadOnly ( + @SerialName(value = "bar") val bar: kotlin.String? = null, + @SerialName(value = "foo") val foo: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 000000000000..9b9298c87a36 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ +@Serializable +data class HealthCheckResult ( + @SerialName(value = "nullableMessage") val nullableMessage: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 000000000000..787f859549fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ +@Serializable +data class InlineObject ( + /* Updated name of the pet */ + @SerialName(value = "name") val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerialName(value = "status") val status: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 000000000000..b56396d37e5e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ +@Serializable +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerialName(value = "additionalMetadata") val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerialName(value = "file") val file: io.ktor.client.request.forms.InputProvider? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 000000000000..887c7456ee58 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ +@Serializable +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerialName(value = "enumFormStringArray") val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerialName(value = "enumFormString") val enumFormString: InlineObject2.EnumFormString? = null +) +{ + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + @Serializable(with = EnumFormStringArray.Serializer::class) + enum class EnumFormStringArray(val value: kotlin.String){ + + greaterThan(">"), + + dollar("$"); + + + object Serializer : CommonEnumSerializer("EnumFormStringArray", values(), values().map { it.value }.toTypedArray()) + } + + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + @Serializable(with = EnumFormString.Serializer::class) + enum class EnumFormString(val value: kotlin.String){ + + abc("_abc"), + + minusEfg("-efg"), + + leftParenthesisXyzRightParenthesis("(xyz)"); + + + object Serializer : CommonEnumSerializer("EnumFormString", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 000000000000..a67b8dc50c06 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -0,0 +1,65 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param integer None + * @param int32 None + * @param int64 None + * @param number None + * @param float None + * @param double None + * @param string None + * @param patternWithoutDelimiter None + * @param byte None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ +@Serializable +data class InlineObject3 ( + /* None */ + @SerialName(value = "number") @Required val number: kotlin.Double, + /* None */ + @SerialName(value = "double") @Required val double: kotlin.Double, + /* None */ + @SerialName(value = "patternWithoutDelimiter") @Required val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerialName(value = "byte") @Required val byte: kotlin.ByteArray, + /* None */ + @SerialName(value = "integer") val integer: kotlin.Int? = null, + /* None */ + @SerialName(value = "int32") val int32: kotlin.Int? = null, + /* None */ + @SerialName(value = "int64") val int64: kotlin.Long? = null, + /* None */ + @SerialName(value = "float") val float: kotlin.Float? = null, + /* None */ + @SerialName(value = "string") val string: kotlin.String? = null, + /* None */ + @SerialName(value = "binary") val binary: io.ktor.client.request.forms.InputProvider? = null, + /* None */ + @SerialName(value = "date") val date: kotlin.String? = null, + /* None */ + @SerialName(value = "dateTime") val dateTime: kotlin.String? = null, + /* None */ + @SerialName(value = "password") val password: kotlin.String? = null, + /* None */ + @SerialName(value = "callback") val callback: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 000000000000..4a1f2f2ecc5e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param param field1 + * @param param2 field2 + */ +@Serializable +data class InlineObject4 ( + /* field1 */ + @SerialName(value = "param") @Required val param: kotlin.String, + /* field2 */ + @SerialName(value = "param2") @Required val param2: kotlin.String +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 000000000000..238d357f26a2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param additionalMetadata Additional data to pass to server + * @param requiredFile file to upload + */ +@Serializable +data class InlineObject5 ( + /* file to upload */ + @SerialName(value = "requiredFile") @Required val requiredFile: io.ktor.client.request.forms.InputProvider, + /* Additional data to pass to server */ + @SerialName(value = "additionalMetadata") val additionalMetadata: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 000000000000..425640579467 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,26 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Foo + +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param string + */ +@Serializable +data class InlineResponseDefault ( + @SerialName(value = "string") val string: Foo? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 000000000000..915b5d25acb6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param ``123minusList`` + */ +@Serializable +data class List ( + @SerialName(value = "`123minusList`") val ``123minusList``: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 000000000000..f66127a71dbb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt @@ -0,0 +1,49 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ +@Serializable +data class MapTest ( + @SerialName(value = "mapMapOfString") val mapMapOfString: kotlin.collections.Map>? = null, + @SerialName(value = "mapOfEnumString") val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerialName(value = "directMap") val directMap: kotlin.collections.Map? = null, + @SerialName(value = "indirectMap") val indirectMap: kotlin.collections.Map? = null +) +{ + + /** + * + * Values: uPPER,lower + */ + @Serializable(with = MapOfEnumString.Serializer::class) + enum class MapOfEnumString(val value: kotlin.collections.Map){ + + uPPER("UPPER"), + + lower("lower"); + + + object Serializer : CommonEnumSerializer("MapOfEnumString", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 000000000000..73b632b52a6a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,30 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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.Animal + +import kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param uuid + * @param dateTime + * @param map + */ +@Serializable +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerialName(value = "uuid") val uuid: kotlin.String? = null, + @SerialName(value = "dateTime") val dateTime: kotlin.String? = null, + @SerialName(value = "map") val map: kotlin.collections.Map? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 000000000000..235b9ddfa15e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ +@Serializable +data class Model200Response ( + @SerialName(value = "name") val name: kotlin.Int? = null, + @SerialName(value = "propertyClass") val propertyClass: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 000000000000..ff47fb3d80b2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param ``123number`` + */ +@Serializable +data class Name ( + @SerialName(value = "name") @Required val name: kotlin.Int, + @SerialName(value = "snakeCase") val snakeCase: kotlin.Int? = null, + @SerialName(value = "property") val property: kotlin.String? = null, + @SerialName(value = "`123number`") val ``123number``: kotlin.Int? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..35c112aad32c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ +@Serializable +data class NullableClass ( + @SerialName(value = "integerProp") val integerProp: kotlin.Int? = null, + @SerialName(value = "numberProp") val numberProp: kotlin.Double? = null, + @SerialName(value = "booleanProp") val booleanProp: kotlin.Boolean? = null, + @SerialName(value = "stringProp") val stringProp: kotlin.String? = null, + @SerialName(value = "dateProp") val dateProp: kotlin.String? = null, + @SerialName(value = "datetimeProp") val datetimeProp: kotlin.String? = null, + @SerialName(value = "arrayNullableProp") val arrayNullableProp: kotlin.Array? = null, + @SerialName(value = "arrayAndItemsNullableProp") val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerialName(value = "arrayItemsNullable") val arrayItemsNullable: kotlin.Array? = null, + @SerialName(value = "objectNullableProp") val objectNullableProp: kotlin.collections.Map? = null, + @SerialName(value = "objectAndItemsNullableProp") val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerialName(value = "objectItemsNullable") val objectItemsNullable: kotlin.collections.Map? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 000000000000..2fea0a41faef --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param justNumber + */ +@Serializable +data class NumberOnly ( + @SerialName(value = "justNumber") val justNumber: kotlin.Double? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..771758217891 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,56 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +@Serializable +data class Order ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "petId") val petId: kotlin.Long? = null, + @SerialName(value = "quantity") val quantity: kotlin.Int? = null, + @SerialName(value = "shipDate") val shipDate: kotlin.String? = null, + /* Order Status */ + @SerialName(value = "status") val status: Order.Status? = null, + @SerialName(value = "complete") val complete: kotlin.Boolean? = null +) +{ + + /** + * Order Status + * Values: placed,approved,delivered + */ + @Serializable(with = Status.Serializer::class) + enum class Status(val value: kotlin.String){ + + placed("placed"), + + approved("approved"), + + delivered("delivered"); + + + object Serializer : CommonEnumSerializer("Status", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 000000000000..ddd95c1837c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ +@Serializable +data class OuterComposite ( + @SerialName(value = "myNumber") val myNumber: kotlin.Double? = null, + @SerialName(value = "myString") val myString: kotlin.String? = null, + @SerialName(value = "myBoolean") val myBoolean: kotlin.Boolean? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 000000000000..51e77cc5ac6a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer + +/** +* +* Values: placed,approved,delivered +*/ +@Serializable(with = OuterEnum.Serializer::class) +enum class OuterEnum(val value: kotlin.String){ + + + placed("placed"), + + + approved("approved"), + + + delivered("delivered"); + + + + object Serializer : CommonEnumSerializer("OuterEnum", values(), values().map { it.value }.toTypedArray()) +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 000000000000..0380a5427384 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer + +/** +* +* Values: placed,approved,delivered +*/ +@Serializable(with = OuterEnumDefaultValue.Serializer::class) +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + placed("placed"), + + + approved("approved"), + + + delivered("delivered"); + + + + object Serializer : CommonEnumSerializer("OuterEnumDefaultValue", values(), values().map { it.value }.toTypedArray()) +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 000000000000..70389422113f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer + +/** +* +* Values: _0,_1,_2 +*/ +@Serializable(with = OuterEnumInteger.Serializer::class) +enum class OuterEnumInteger(val value: kotlin.Int){ + + + _0(0), + + + _1(1), + + + _2(2); + + + + object Serializer : CommonEnumSerializer("OuterEnumInteger", values(), values().map { it.value }.toTypedArray()) +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 000000000000..d80ab91475a2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer + +/** +* +* Values: _0,_1,_2 +*/ +@Serializable(with = OuterEnumIntegerDefaultValue.Serializer::class) +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + _0(0), + + + _1(1), + + + _2(2); + + + + object Serializer : CommonEnumSerializer("OuterEnumIntegerDefaultValue", values(), values().map { it.value }.toTypedArray()) +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..5dc530bb7c4e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,58 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ +@Serializable +data class Pet ( + @SerialName(value = "name") @Required val name: kotlin.String, + @SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array, + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "category") val category: Category? = null, + @SerialName(value = "tags") val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerialName(value = "status") val status: Pet.Status? = null +) +{ + + /** + * pet status in the store + * Values: available,pending,sold + */ + @Serializable(with = Status.Serializer::class) + enum class Status(val value: kotlin.String){ + + available("available"), + + pending("pending"), + + sold("sold"); + + + object Serializer : CommonEnumSerializer("Status", values(), values().map { it.value }.toTypedArray()) + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 000000000000..4d99ea7a9a2c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param bar + * @param baz + */ +@Serializable +data class ReadOnlyFirst ( + @SerialName(value = "bar") val bar: kotlin.String? = null, + @SerialName(value = "baz") val baz: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 000000000000..f1b7a03573cb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * Model for testing reserved words + * @param ``return`` + */ +@Serializable +data class Return ( + @SerialName(value = "`return`") val ``return``: kotlin.Int? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 000000000000..185cc542abf6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ +@Serializable +data class SpecialModelname ( + @SerialName(value = "dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..0b3f202ad517 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,27 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param id + * @param name + */ +@Serializable +data class Tag ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "name") val name: kotlin.String? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..47ad0a9f2829 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 kotlinx.serialization.* +import kotlinx.serialization.internal.CommonEnumSerializer +/** + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +@Serializable +data class User ( + @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "username") val username: kotlin.String? = null, + @SerialName(value = "firstName") val firstName: kotlin.String? = null, + @SerialName(value = "lastName") val lastName: kotlin.String? = null, + @SerialName(value = "email") val email: kotlin.String? = null, + @SerialName(value = "password") val password: kotlin.String? = null, + @SerialName(value = "phone") val phone: kotlin.String? = null, + /* User Status */ + @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null +) + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonTest/kotlin/util/Coroutine.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonTest/kotlin/util/Coroutine.kt new file mode 100644 index 000000000000..5be963e41b8a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonTest/kotlin/util/Coroutine.kt @@ -0,0 +1,23 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 util + +import kotlinx.coroutines.CoroutineScope + +/** +* Block the current thread until execution of the given coroutine is complete. +* +* @param block The coroutine code. +* @return The result of the coroutine. +*/ +internal expect fun runTest(block: suspend CoroutineScope.() -> T): T diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/iosTest/kotlin/util/Coroutine.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/iosTest/kotlin/util/Coroutine.kt new file mode 100644 index 000000000000..ebcc320dbbb0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/iosTest/kotlin/util/Coroutine.kt @@ -0,0 +1,18 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 util + +import kotlinx.coroutines.CoroutineScope +import kotlin.coroutines.EmptyCoroutineContext + +internal actual fun runTest(block: suspend CoroutineScope.() -> T): T = kotlinx.coroutines.runBlocking(EmptyCoroutineContext, block) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/jvmTest/kotlin/util/Coroutine.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/jvmTest/kotlin/util/Coroutine.kt new file mode 100644 index 000000000000..ebcc320dbbb0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/jvmTest/kotlin/util/Coroutine.kt @@ -0,0 +1,18 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 util + +import kotlinx.coroutines.CoroutineScope +import kotlin.coroutines.EmptyCoroutineContext + +internal actual fun runTest(block: suspend CoroutineScope.() -> T): T = kotlinx.coroutines.runBlocking(EmptyCoroutineContext, block) diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index afa636560641..2f81801b7943 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/README.md b/samples/openapi3/client/petstore/kotlin/README.md index d4d33f303f13..cf1793ec2f6f 100644 --- a/samples/openapi3/client/petstore/kotlin/README.md +++ b/samples/openapi3/client/petstore/kotlin/README.md @@ -85,10 +85,12 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) - [org.openapitools.client.models.Category](docs/Category.md) - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) - [org.openapitools.client.models.Client](docs/Client.md) - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) @@ -109,6 +111,7 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) diff --git a/samples/openapi3/client/petstore/kotlin/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index 52d0b1f0fb9c..afacd58744b1 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -324,7 +325,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **kotlin.String**| | [default to null] + **query** | **kotlin.String**| | **user** | [**User**](User.md)| | ### Return type @@ -412,7 +413,7 @@ val int64 : kotlin.Long = 789 // kotlin.Long | None val float : kotlin.Float = 3.4 // kotlin.Float | None val string : kotlin.String = string_example // kotlin.String | None val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None -val date : java.time.LocalDateTime = 2013-10-20 // java.time.LocalDateTime | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None val dateTime : java.time.LocalDateTime = 2013-10-20T19:20:30+01:00 // java.time.LocalDateTime | None val password : kotlin.String = password_example // kotlin.String | None val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None @@ -431,20 +432,20 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **java.math.BigDecimal**| None | [default to null] - **double** | **kotlin.Double**| None | [default to null] - **patternWithoutDelimiter** | **kotlin.String**| None | [default to null] - **byte** | **kotlin.ByteArray**| None | [default to null] - **integer** | **kotlin.Int**| None | [optional] [default to null] - **int32** | **kotlin.Int**| None | [optional] [default to null] - **int64** | **kotlin.Long**| None | [optional] [default to null] - **float** | **kotlin.Float**| None | [optional] [default to null] - **string** | **kotlin.String**| None | [optional] [default to null] - **binary** | **java.io.File**| None | [optional] [default to null] - **date** | **java.time.LocalDateTime**| None | [optional] [default to null] - **dateTime** | **java.time.LocalDateTime**| None | [optional] [default to null] - **password** | **kotlin.String**| None | [optional] [default to null] - **paramCallback** | **kotlin.String**| None | [optional] [default to null] + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.LocalDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] ### Return type @@ -452,7 +453,10 @@ null (empty response body) ### Authorization -[http_basic_test](../README.md#http_basic_test) + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" ### HTTP request headers @@ -497,14 +501,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [default to null] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [default to null] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [default to null] [enum: 1, -2] - **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [default to null] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] ### Return type @@ -555,12 +559,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | [default to null] - **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | [default to null] - **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | [default to null] - **stringGroup** | **kotlin.Int**| String in group parameters | [optional] [default to null] - **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] [default to null] - **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] [default to null] + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] ### Return type @@ -568,7 +572,9 @@ null (empty response body) ### Authorization -[bearer_test](../README.md#bearer_test) + +Configure bearer_test: + ApiClient.accessToken = "" ### HTTP request headers @@ -649,8 +655,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **kotlin.String**| field1 | [default to null] - **param2** | **kotlin.String**| field2 | [default to null] + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | ### Return type @@ -665,3 +671,57 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin/docs/FakeClassnameTags123Api.md index 1569acbee643..962dfd4d2dc2 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeClassnameTags123Api.md @@ -47,7 +47,10 @@ Name | Type | Description | Notes ### Authorization -[api_key_query](../README.md#api_key_query) + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" ### HTTP request headers diff --git a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md index 337ef846e22e..9a339982e00b 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **string** | **kotlin.String** | | [optional] **byte** | **kotlin.ByteArray** | | **binary** | [**java.io.File**](java.io.File.md) | | [optional] -**date** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | **dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] **uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] **password** | **kotlin.String** | | diff --git a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md index f9478db66a41..e709b0e1b89a 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **patternWithoutDelimiter** | **kotlin.String** | None | **byte** | **kotlin.ByteArray** | None | **binary** | [**java.io.File**](java.io.File.md) | None | [optional] -**date** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] **dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional] **password** | **kotlin.String** | None | [optional] **callback** | **kotlin.String** | None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/List.md b/samples/openapi3/client/petstore/kotlin/docs/List.md index f426d541a409..13a09a4c4141 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123list`** | **kotlin.String** | | [optional] +**`123minusList`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md new file mode 100644 index 000000000000..6b15b13fc9b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin/docs/PetApi.md index da2cf27282c5..576d2f04ca85 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/PetApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/PetApi.md @@ -52,7 +52,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -89,8 +91,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | [default to null] - **apiKey** | **kotlin.String**| | [optional] [default to null] + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] ### Return type @@ -98,7 +100,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -137,7 +141,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type @@ -145,7 +149,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -184,7 +190,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | [default to null] + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type @@ -192,7 +198,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -231,7 +239,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | [default to null] + **petId** | **kotlin.Long**| ID of pet to return | ### Return type @@ -239,7 +247,10 @@ Name | Type | Description | Notes ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers @@ -283,7 +294,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -321,9 +334,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | [default to null] - **name** | **kotlin.String**| Updated name of the pet | [optional] [default to null] - **status** | **kotlin.String**| Updated status of the pet | [optional] [default to null] + **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 @@ -331,7 +344,9 @@ null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -370,9 +385,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | [default to null] - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] [default to null] - **file** | **java.io.File**| file to upload | [optional] [default to null] + **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 @@ -380,7 +395,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers @@ -419,9 +436,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | [default to null] - **requiredFile** | **java.io.File**| file to upload | [default to null] - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] [default to null] + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] ### Return type @@ -429,7 +446,9 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) + +Configure petstore_auth: + ApiClient.accessToken = "" ### HTTP request headers diff --git a/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md index 03cfa9b444b8..282649449d96 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`$specialPropertyName`** | **kotlin.Long** | | [optional] +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md index 4735a7dc3dca..55bd8afdbc09 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md @@ -41,7 +41,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | [default to null] + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | ### Return type @@ -92,7 +92,10 @@ This endpoint does not need any parameter. ### Authorization -[api_key](../README.md#api_key) + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" ### HTTP request headers @@ -131,7 +134,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | [default to null] + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin/docs/UserApi.md index 9451997ed630..dbf78e81eb22 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/UserApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/UserApi.md @@ -89,7 +89,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object | + **user** | [**kotlin.Array<User>**](User.md)| List of user object | ### Return type @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object | + **user** | [**kotlin.Array<User>**](User.md)| List of user object | ### Return type @@ -179,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | [default to null] + **username** | **kotlin.String**| The name that needs to be deleted | ### Return type @@ -224,7 +224,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -270,8 +270,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | [default to null] - **password** | **kotlin.String**| The password for login in clear text | [default to null] + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | ### Return type @@ -358,7 +358,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | [default to null] + **username** | **kotlin.String**| name that need to be deleted | **user** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index 0b2a7ce3c071..ae9aed9232ad 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.Client -import org.openapitools.client.infrastructure.* +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 AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -27,7 +37,7 @@ class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2 fun call123testSpecialTags(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PATCH, "/another-fake/dummy", @@ -41,11 +51,10 @@ class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2 return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Client - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 932f57beca8e..457573efef8a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.InlineResponseDefault -import org.openapitools.client.infrastructure.* +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 DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -26,7 +36,7 @@ class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : fun fooGet() : InlineResponseDefault { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/foo", @@ -40,11 +50,10 @@ class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as InlineResponseDefault - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 89785dfbbee4..49c4f77616f2 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,7 +17,17 @@ import org.openapitools.client.models.HealthCheckResult import org.openapitools.client.models.OuterComposite import org.openapitools.client.models.User -import org.openapitools.client.infrastructure.* +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 FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -30,7 +40,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun fakeHealthGet() : HealthCheckResult { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/health", @@ -44,11 +54,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as HealthCheckResult - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -59,10 +68,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return kotlin.Boolean */ @Suppress("UNCHECKED_CAST") - fun fakeOuterBooleanSerialize(body: kotlin.Boolean) : kotlin.Boolean { + fun fakeOuterBooleanSerialize(body: kotlin.Boolean?) : kotlin.Boolean { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/boolean", @@ -76,11 +85,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Boolean - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -91,10 +99,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return OuterComposite */ @Suppress("UNCHECKED_CAST") - fun fakeOuterCompositeSerialize(outerComposite: OuterComposite) : OuterComposite { + fun fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : OuterComposite { val localVariableBody: kotlin.Any? = outerComposite val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/composite", @@ -108,11 +116,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as OuterComposite - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -123,10 +130,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return java.math.BigDecimal */ @Suppress("UNCHECKED_CAST") - fun fakeOuterNumberSerialize(body: java.math.BigDecimal) : java.math.BigDecimal { + fun fakeOuterNumberSerialize(body: java.math.BigDecimal?) : java.math.BigDecimal { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/number", @@ -140,11 +147,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as java.math.BigDecimal - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -155,10 +161,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return kotlin.String */ @Suppress("UNCHECKED_CAST") - fun fakeOuterStringSerialize(body: kotlin.String) : kotlin.String { + fun fakeOuterStringSerialize(body: kotlin.String?) : kotlin.String { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/string", @@ -172,11 +178,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.String - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -189,7 +194,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit { val localVariableBody: kotlin.Any? = fileSchemaTestClass val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/fake/body-with-file-schema", @@ -203,11 +208,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -221,7 +225,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testBodyWithQueryParams(query: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf("query" to listOf("$query")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/fake/body-with-query-params", @@ -235,11 +239,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -253,7 +256,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testClientModel(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PATCH, "/fake", @@ -267,11 +270,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Client - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -282,22 +284,22 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param double None * @param patternWithoutDelimiter None * @param byte None - * @param integer None (optional, default to null) - * @param int32 None (optional, default to null) - * @param int64 None (optional, default to null) - * @param float None (optional, default to null) - * @param string None (optional, default to null) - * @param binary None (optional, default to null) - * @param date None (optional, default to null) - * @param dateTime None (optional, default to null) - * @param password None (optional, default to null) - * @param paramCallback None (optional, default to null) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) * @return void */ - fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int, int32: kotlin.Int, int64: kotlin.Long, float: kotlin.Float, string: kotlin.String, binary: java.io.File, date: java.time.LocalDateTime, dateTime: java.time.LocalDateTime, password: kotlin.String, paramCallback: kotlin.String) : Unit { + fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.LocalDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = mapOf("integer" to "$integer", "int32" to "$int32", "int64" to "$int64", "number" to "$number", "float" to "$float", "double" to "$double", "string" to "$string", "pattern_without_delimiter" to "$patternWithoutDelimiter", "byte" to "$byte", "binary" to "$binary", "date" to "$date", "dateTime" to "$dateTime", "password" to "$password", "callback" to "$paramCallback") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake", @@ -311,31 +313,30 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } /** * To test enum parameters * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to null) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to null) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional, default to null) - * @param enumQueryDouble Query parameter enum test (double) (optional, default to null) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to '-efg') + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to '-efg') + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to '$') + * @param enumFormString Form parameter enum test (string) (optional, default to '-efg') * @return void */ - fun testEnumParameters(enumHeaderStringArray: kotlin.Array, enumHeaderString: kotlin.String, enumQueryStringArray: kotlin.Array, enumQueryString: kotlin.String, enumQueryInteger: kotlin.Int, enumQueryDouble: kotlin.Double, enumFormStringArray: kotlin.Array, enumFormString: kotlin.String) : Unit { + fun testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to "$enumFormStringArray", "enum_form_string" to "$enumFormString") - val localVariableQuery: MultiValueMap = mapOf("enum_query_string_array" to toMultiValue(enumQueryStringArray.toList(), "multi"), "enum_query_string" to listOf("$enumQueryString"), "enum_query_integer" to listOf("$enumQueryInteger"), "enum_query_double" to listOf("$enumQueryDouble")) - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) + val localVariableQuery: MultiValueMap = mapOf("enumQueryStringArray" to toMultiValue(enumQueryStringArray.toList(), "multi"), "enumQueryString" to listOf("$enumQueryString"), "enumQueryInteger" to listOf("$enumQueryInteger"), "enumQueryDouble" to listOf("$enumQueryDouble")) + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake", @@ -349,11 +350,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -363,15 +363,15 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param requiredStringGroup Required String in group parameters * @param requiredBooleanGroup Required Boolean in group parameters * @param requiredInt64Group Required Integer in group parameters - * @param stringGroup String in group parameters (optional, default to null) - * @param booleanGroup Boolean in group parameters (optional, default to null) - * @param int64Group Integer in group parameters (optional, default to null) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) * @return void */ - fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int, booleanGroup: kotlin.Boolean, int64Group: kotlin.Long) : Unit { + fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : Unit { val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf("required_string_group" to listOf("$requiredStringGroup"), "required_int64_group" to listOf("$requiredInt64Group"), "string_group" to listOf("$stringGroup"), "int64_group" to listOf("$int64Group")) - val localVariableHeaders: kotlin.collections.Map = mapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) + val localVariableQuery: MultiValueMap = mapOf("requiredStringGroup" to listOf("$requiredStringGroup"), "requiredInt64Group" to listOf("$requiredInt64Group"), "stringGroup" to listOf("$stringGroup"), "int64Group" to listOf("$int64Group")) + val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/fake", @@ -385,11 +385,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -402,7 +401,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : Unit { val localVariableBody: kotlin.Any? = requestBody val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/inline-additionalProperties", @@ -416,11 +415,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -434,7 +432,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = mapOf("param" to "$param", "param2" to "$param2") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/jsonFormData", @@ -448,11 +446,44 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") + } + } + + /** + * + * To test the collection format in query parameters + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context + * @return void + */ + fun testQueryParameterCollectionFormat(pipe: kotlin.Array, ioutil: kotlin.Array, http: kotlin.Array, url: kotlin.Array, context: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("pipe" to toMultiValue(pipe.toList(), "multi"), "ioutil" to toMultiValue(ioutil.toList(), "csv"), "http" to toMultiValue(http.toList(), "space"), "url" to toMultiValue(url.toList(), "csv"), "context" to toMultiValue(context.toList(), "multi")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/test-query-paramters", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index f2cdcae77dfc..1d9dcaef2203 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.Client -import org.openapitools.client.infrastructure.* +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 FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -27,7 +37,7 @@ class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger fun testClassname(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PATCH, "/fake_classname_test", @@ -41,11 +51,10 @@ class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Client - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 129807a602fa..041c54baad8a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,7 +14,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet -import org.openapitools.client.infrastructure.* +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:80/v2") : ApiClient(basePath) { @@ -27,7 +37,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun addPet(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet", @@ -41,11 +51,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -53,13 +62,13 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Deletes a pet * * @param petId Pet id to delete - * @param apiKey (optional, default to null) + * @param apiKey (optional) * @return void */ - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String) : Unit { + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("api_key" to apiKey.toString()) + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -73,11 +82,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -91,7 +99,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/pet/findByStatus", @@ -105,11 +113,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -123,7 +130,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/pet/findByTags", @@ -137,11 +144,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -155,7 +161,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun getPetById(petId: kotlin.Long) : Pet { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -169,11 +175,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Pet - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -186,7 +191,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun updatePet(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/pet", @@ -200,11 +205,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -212,14 +216,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * 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, default to null) - * @param status Updated status of the pet (optional, default to null) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) * @return void */ - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String, status: kotlin.String) : Unit { + 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 = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -233,11 +237,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -245,15 +248,15 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * uploads an image * * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional, default to null) - * @param file file to upload (optional, default to null) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) * @return ApiResponse */ @Suppress("UNCHECKED_CAST") - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String, file: java.io.File) : ApiResponse { + 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 = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), @@ -267,11 +270,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as ApiResponse - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -280,14 +282,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * * @param petId ID of pet to update * @param requiredFile file to upload - * @param additionalMetadata Additional data to pass to server (optional, default to null) + * @param additionalMetadata Additional data to pass to server (optional) * @return ApiResponse */ @Suppress("UNCHECKED_CAST") - fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String) : ApiResponse { + fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String?) : ApiResponse { val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "requiredFile" to "$requiredFile") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), @@ -301,11 +303,10 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as ApiResponse - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index cee8ac6865a7..413cfbb07289 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order -import org.openapitools.client.infrastructure.* +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:80/v2") : ApiClient(basePath) { @@ -26,7 +36,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun deleteOrder(orderId: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), @@ -40,11 +50,10 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -57,7 +66,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun getInventory() : kotlin.collections.Map { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/store/inventory", @@ -71,11 +80,10 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -89,7 +97,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun getOrderById(orderId: kotlin.Long) : Order { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), @@ -103,11 +111,10 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -121,7 +128,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun placeOrder(order: Order) : Order { val localVariableBody: kotlin.Any? = order val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/store/order", @@ -135,11 +142,10 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index ef9fd3880f9b..bb4d53269c2c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.User -import org.openapitools.client.infrastructure.* +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:80/v2") : ApiClient(basePath) { @@ -26,7 +36,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun createUser(user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/user", @@ -40,11 +50,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -57,7 +66,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun createUsersWithArrayInput(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/user/createWithArray", @@ -71,11 +80,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -88,7 +96,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun createUsersWithListInput(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/user/createWithList", @@ -102,11 +110,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -119,7 +126,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun deleteUser(username: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -133,11 +140,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -151,7 +157,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun getUserByName(username: kotlin.String) : User { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -165,11 +171,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as User - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -184,7 +189,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/user/login", @@ -198,11 +203,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> (response as Success<*>).data as kotlin.String - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -214,7 +218,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun logoutUser() : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/user/logout", @@ -228,11 +232,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -246,7 +249,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun updateUser(username: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -260,11 +263,10 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap return when (response.responseType) { ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() + 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") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9e79028a90b1..8db022446f2b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,86 +1,131 @@ package org.openapitools.client.infrastructure -import com.squareup.moshi.FromJson -import com.squareup.moshi.Moshi -import com.squareup.moshi.ToJson -import okhttp3.* +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 -import java.util.* 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 by lazy { + val client: OkHttpClient by lazy { builder.build() } @JvmStatic val builder: OkHttpClient.Builder = OkHttpClient.Builder() - - @JvmStatic - var defaultHeaders: Map by ApplicationDelegates.setOnce(mapOf(ContentType to JsonMediaType, Accept to JsonMediaType)) - - @JvmStatic - val jsonHeaders: Map = mapOf(ContentType to JsonMediaType, Accept to JsonMediaType) } protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> RequestBody.create( - MediaType.parse(mediaType), content - ) - mediaType == FormDataMediaType -> { - var builder = FormBody.Builder() - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { key, value -> - builder = builder.add(key, value) - } - builder.build() - } - mediaType == JsonMediaType -> RequestBody.create( - MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String = JsonMediaType): T? { - if(body == null) return null + 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 -> Moshi.Builder().add(object { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - @FromJson - fun fromJson(s: String) = UUID.fromString(s) - }) - .add(ByteArrayAdapter()) - .build().adapter(T::class.java).fromJson(body.source()) - else -> TODO() + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - - var urlBuilder = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - urlBuilder = urlBuilder.addQueryParameter(query.key, queryValue) + 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.query["api_key_query"].isNullOrEmpty()) { + if (apiKey["api_key_query"] != null) { + if (apiKeyPrefix["api_key_query"] != null) { + requestConfig.query["api_key_query"] = apiKeyPrefix["api_key_query"]!! + " " + apiKey["api_key_query"]!! + } else { + requestConfig.query["api_key_query"] = apiKey["api_key_query"]!! + } } } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + requestConfig.headers[Authorization] = "Bearer " + accessToken + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + requestConfig.headers[Authorization] = Credentials.basic(username, password) + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + requestConfig.headers[Authorization] = "Bearer " + accessToken + } + } - val url = urlBuilder.build() - val headers = requestConfig.headers + defaultHeaders + 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.") @@ -90,11 +135,10 @@ open class ApiClient(val baseUrl: String) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } - // TODO: support multiple contentType,accept options here. + // TODO: support multiple contentType options here. val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - val accept = (headers[Accept] as String).substringBefore(";").toLowerCase() - var request : Request.Builder = when (requestConfig.method) { + val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete() RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() @@ -102,40 +146,40 @@ open class ApiClient(val baseUrl: String) { 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) - } - - headers.forEach { header -> request = request.addHeader(header.key, header.value) } + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() - val realRequest = request.build() - val response = client.newCall(realRequest).execute() + 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.code, + response.headers.toMultimap() ) response.isInformational -> return Informational( - response.message(), - response.code(), - response.headers().toMultimap() + response.message, + response.code, + response.headers.toMultimap() ) response.isSuccessful -> return Success( - responseBody(response.body(), accept), - response.code(), - response.headers().toMultimap() + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() ) response.isClientError -> return ClientError( - response.body()?.string(), - response.code(), - response.headers().toMultimap() + response.body?.string(), + response.code, + response.headers.toMultimap() ) else -> return ServerError( null, - response.body()?.string(), - response.code(), - response.headers().toMultimap() + response.body?.string(), + response.code, + response.headers.toMultimap() ) } } -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..b2e1654479a0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/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/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..e082db94811d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/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/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 86e2dadf9a81..53e689237d71 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -11,6 +11,6 @@ package org.openapitools.client.infrastructure data class RequestConfig( val method: RequestMethod, val path: String, - val headers: Map = mapOf(), + val headers: MutableMap = mutableMapOf(), val query: Map> = mapOf() ) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt index f50104a6f352..934962ec6b50 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -5,19 +5,19 @@ 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 +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 +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 +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 \ No newline at end of file +val Response.isServerError : Boolean get() = this.code in 500..999 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index cf3fe8203d5b..7c5a353e0f7f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,18 @@ package org.openapitools.client.infrastructure -import com.squareup.moshi.KotlinJsonAdapterFactory import com.squareup.moshi.Moshi -import com.squareup.moshi.Rfc3339DateJsonAdapter -import java.util.* +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(KotlinJsonAdapterFactory()) .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) .build() } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..a4a44cc18b73 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/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/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index f5baace226b2..7d5ee7a1bb7f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param mapProperty * @param mapOfMapProperty */ data class AdditionalPropertiesClass ( + @Json(name = "map_property") val mapProperty: kotlin.collections.Map? = null, + @Json(name = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map>? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt index 7b24a5575cc3..5f4435f56fa4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param className * @param color */ data class Animal ( + @Json(name = "className") val className: kotlin.String, + @Json(name = "color") val color: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index e63d35308de4..0fe4589a5f4f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param code @@ -19,10 +20,12 @@ package org.openapitools.client.models * @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 -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index eeaf6870d43d..7ade7d8cff50 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param arrayArrayNumber */ data class ArrayOfArrayOfNumberOnly ( + @Json(name = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index a936cbfb37aa..263146cfd9cf 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param arrayNumber */ data class ArrayOfNumberOnly ( + @Json(name = "ArrayNumber") val arrayNumber: kotlin.Array? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt index 4f3ac37d99b3..a430c0559325 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,6 +13,7 @@ package org.openapitools.client.models import org.openapitools.client.models.ReadOnlyFirst +import com.squareup.moshi.Json /** * * @param arrayOfString @@ -20,10 +21,12 @@ import org.openapitools.client.models.ReadOnlyFirst * @param arrayArrayOfModel */ data class ArrayTest ( + @Json(name = "array_of_string") val arrayOfString: kotlin.Array? = null, + @Json(name = "array_array_of_integer") val arrayArrayOfInteger: kotlin.Array>? = null, + @Json(name = "array_array_of_model") val arrayArrayOfModel: kotlin.Array>? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt index 2d4717e2f83b..72b27a545076 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param smallCamel @@ -22,14 +23,19 @@ package org.openapitools.client.models * @param ATT_NAME Name of the pet */ data class Capitalization ( + @Json(name = "smallCamel") val smallCamel: kotlin.String? = null, + @Json(name = "CapitalCamel") val capitalCamel: kotlin.String? = null, + @Json(name = "small_Snake") val smallSnake: kotlin.String? = null, + @Json(name = "Capital_Snake") val capitalSnake: kotlin.String? = null, + @Json(name = "SCA_ETH_Flow_Points") val scAETHFlowPoints: kotlin.String? = null, /* Name of the pet */ + @Json(name = "ATT_NAME") val ATT_NAME: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt index 92d95e6ac522..1ce9e6ef4315 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,16 +12,20 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf +import com.squareup.moshi.Json /** * * @param declawed */ data class Cat ( + @Json(name = "className") val className: kotlin.String, + @Json(name = "declawed") val declawed: kotlin.Boolean? = null, + @Json(name = "color") val color: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..ec9862cd1757 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 +/** + * + * @param declawed + */ +data class CatAllOf ( + @Json(name = "declawed") + val declawed: kotlin.Boolean? = null +) + + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 1d8c9699b5dd..059231f463c0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param id * @param name */ data class Category ( + @Json(name = "name") val name: kotlin.String, + @Json(name = "id") val id: kotlin.Long? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt index 556f5db0ee26..06245c42beb4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing model with \"_class\" property * @param propertyClass */ data class ClassModel ( + @Json(name = "_class") val propertyClass: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt index dca68a1d2908..4a0cc69a783c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param client */ data class Client ( + @Json(name = "client") val client: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt index 6da240f947e9..19cb002da7e8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,16 +12,20 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf +import com.squareup.moshi.Json /** * * @param breed */ data class Dog ( + @Json(name = "className") val className: kotlin.String, + @Json(name = "breed") val breed: kotlin.String? = null, + @Json(name = "color") val color: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..71b1b71365af --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,25 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 +/** + * + * @param breed + */ +data class DogAllOf ( + @Json(name = "breed") + val breed: kotlin.String? = null +) + + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt index ee1d36cee63d..862929784c01 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,10 +19,13 @@ import com.squareup.moshi.Json * @param arrayEnum */ data class EnumArrays ( + @Json(name = "just_symbol") val justSymbol: EnumArrays.JustSymbol? = null, - val arrayEnum: EnumArrays.ArrayEnum? = null -) { + @Json(name = "array_enum") + val arrayEnum: kotlin.Array? = null +) +{ /** * * Values: greaterThanEqual,dollar @@ -34,18 +37,20 @@ data class EnumArrays ( @Json(name = "$") dollar("$"); } +} +{ /** * * Values: fish,crab */ - enum class ArrayEnum(val value: kotlin.Array<kotlin.String>){ + enum class ArrayEnum(val value: kotlin.String){ @Json(name = "fish") fish("fish"), @Json(name = "crab") crab("crab"); } - } + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt index 64030e0d5391..c1d5645936e5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,18 @@ import com.squareup.moshi.Json */ enum class EnumClass(val value: kotlin.String){ - @Json(name = "_abc") abc("_abc"), - @Json(name = "-efg") minusEfg("-efg"), + @Json(name = "_abc") + abc("_abc"), + + + @Json(name = "-efg") + minusEfg("-efg"), + + + @Json(name = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); - @Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index a124fce06693..5c4073650378 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,16 +29,25 @@ import com.squareup.moshi.Json * @param outerEnumIntegerDefaultValue */ data class EnumTest ( + @Json(name = "enum_string_required") val enumStringRequired: EnumTest.EnumStringRequired, + @Json(name = "enum_string") val enumString: EnumTest.EnumString? = null, + @Json(name = "enum_integer") val enumInteger: EnumTest.EnumInteger? = null, + @Json(name = "enum_number") val enumNumber: EnumTest.EnumNumber? = null, + @Json(name = "outerEnum") val outerEnum: OuterEnum? = null, + @Json(name = "outerEnumInteger") val outerEnumInteger: OuterEnumInteger? = null, + @Json(name = "outerEnumDefaultValue") val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @Json(name = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) { +) +{ /** * * Values: uPPER,lower,eMPTY @@ -52,7 +61,9 @@ data class EnumTest ( @Json(name = "") eMPTY(""); } +} +{ /** * * Values: uPPER,lower,eMPTY @@ -66,7 +77,9 @@ data class EnumTest ( @Json(name = "") eMPTY(""); } +} +{ /** * * Values: _1,minus1 @@ -78,7 +91,9 @@ data class EnumTest ( @Json(name = -1) minus1(-1); } +} +{ /** * * Values: _1period1,minus1Period2 @@ -90,6 +105,6 @@ data class EnumTest ( @Json(name = -1.2) minus1Period2(-1.2); } - } + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index ecece52046d5..82e56661014b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param file * @param files */ data class FileSchemaTestClass ( + @Json(name = "file") val file: java.io.File? = null, + @Json(name = "files") val files: kotlin.Array? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt index 90a3d1e54081..4ac59867244b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param bar */ data class Foo ( + @Json(name = "bar") val bar: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index 14817038f577..d185226b0dc0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param integer @@ -31,24 +32,38 @@ package org.openapitools.client.models * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ data class FormatTest ( + @Json(name = "number") val number: java.math.BigDecimal, + @Json(name = "byte") val byte: kotlin.ByteArray, - val date: java.time.LocalDateTime, + @Json(name = "date") + val date: java.time.LocalDate, + @Json(name = "password") val password: kotlin.String, + @Json(name = "integer") val integer: kotlin.Int? = null, + @Json(name = "int32") val int32: kotlin.Int? = null, + @Json(name = "int64") val int64: kotlin.Long? = null, + @Json(name = "float") val float: kotlin.Float? = null, + @Json(name = "double") val double: kotlin.Double? = null, + @Json(name = "string") val string: kotlin.String? = null, + @Json(name = "binary") val binary: java.io.File? = null, + @Json(name = "dateTime") val dateTime: java.time.LocalDateTime? = null, + @Json(name = "uuid") val uuid: java.util.UUID? = null, /* A string that is a 10 digit number. Can have leading zeros. */ + @Json(name = "pattern_with_digits") val patternWithDigits: kotlin.String? = null, /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @Json(name = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index fc05361d3ec7..1e649d71f249 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param bar * @param foo */ data class HasOnlyReadOnly ( + @Json(name = "bar") val bar: kotlin.String? = null, + @Json(name = "foo") val foo: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt index d8f7ec1fb8ab..8f53541bd227 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. * @param nullableMessage */ data class HealthCheckResult ( + @Json(name = "NullableMessage") val nullableMessage: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt index c11ccb2405ae..70484e689460 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param name Updated name of the pet @@ -19,10 +20,11 @@ package org.openapitools.client.models */ data class InlineObject ( /* Updated name of the pet */ + @Json(name = "name") val name: kotlin.String? = null, /* Updated status of the pet */ + @Json(name = "status") val status: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt index 645734260b8c..51f2137de920 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param additionalMetadata Additional data to pass to server @@ -19,10 +20,11 @@ package org.openapitools.client.models */ data class InlineObject1 ( /* Additional data to pass to server */ + @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null, /* file to upload */ + @Json(name = "file") val file: java.io.File? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index 1e08e6011720..0f982f05a809 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,23 +20,28 @@ import com.squareup.moshi.Json */ data class InlineObject2 ( /* Form parameter enum test (string array) */ - val enumFormStringArray: InlineObject2.EnumFormStringArray? = null, + @Json(name = "enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, /* Form parameter enum test (string) */ + @Json(name = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null -) { +) +{ /** * Form parameter enum test (string array) * Values: greaterThan,dollar */ - enum class EnumFormStringArray(val value: kotlin.Array<kotlin.String>){ + enum class EnumFormStringArray(val value: kotlin.String){ @Json(name = ">") greaterThan(">"), @Json(name = "$") dollar("$"); } +} +{ /** * Form parameter enum test (string) * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis @@ -50,6 +55,6 @@ data class InlineObject2 ( @Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); } - } + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt index a3a0c0c9465d..35dc49df571f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param integer None @@ -31,34 +32,47 @@ package org.openapitools.client.models */ data class InlineObject3 ( /* None */ + @Json(name = "number") val number: java.math.BigDecimal, /* None */ + @Json(name = "double") val double: kotlin.Double, /* None */ + @Json(name = "pattern_without_delimiter") val patternWithoutDelimiter: kotlin.String, /* None */ + @Json(name = "byte") val byte: kotlin.ByteArray, /* None */ + @Json(name = "integer") val integer: kotlin.Int? = null, /* None */ + @Json(name = "int32") val int32: kotlin.Int? = null, /* None */ + @Json(name = "int64") val int64: kotlin.Long? = null, /* None */ + @Json(name = "float") val float: kotlin.Float? = null, /* None */ + @Json(name = "string") val string: kotlin.String? = null, /* None */ + @Json(name = "binary") val binary: java.io.File? = null, /* None */ - val date: java.time.LocalDateTime? = null, + @Json(name = "date") + val date: java.time.LocalDate? = null, /* None */ + @Json(name = "dateTime") val dateTime: java.time.LocalDateTime? = null, /* None */ + @Json(name = "password") val password: kotlin.String? = null, /* None */ + @Json(name = "callback") val callback: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt index 091288caa5b1..52eef17034ac 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param param field1 @@ -19,10 +20,11 @@ package org.openapitools.client.models */ data class InlineObject4 ( /* field1 */ + @Json(name = "param") val param: kotlin.String, /* field2 */ + @Json(name = "param2") val param2: kotlin.String -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt index 7dd6bf7ae298..ca95c5ee037e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param additionalMetadata Additional data to pass to server @@ -19,10 +20,11 @@ package org.openapitools.client.models */ data class InlineObject5 ( /* file to upload */ + @Json(name = "requiredFile") val requiredFile: java.io.File, /* Additional data to pass to server */ + @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index 5eb84f603fd1..5768639b0b22 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,13 +13,14 @@ package org.openapitools.client.models import org.openapitools.client.models.Foo +import com.squareup.moshi.Json /** * * @param string */ data class InlineResponseDefault ( + @Json(name = "string") val string: Foo? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index 14b0b3615d67..6e2a75355bdc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * - * @param `123list` + * @param `123minusList` */ data class List ( - val `123list`: kotlin.String? = null -) { + @Json(name = "123-list") + val `123minusList`: kotlin.String? = null +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt index 7e6815200183..dc1096dc70b1 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,23 +21,28 @@ import com.squareup.moshi.Json * @param indirectMap */ data class MapTest ( + @Json(name = "map_map_of_string") val mapMapOfString: kotlin.collections.Map>? = null, + @Json(name = "map_of_enum_string") val mapOfEnumString: MapTest.MapOfEnumString? = null, + @Json(name = "direct_map") val directMap: kotlin.collections.Map? = null, + @Json(name = "indirect_map") val indirectMap: kotlin.collections.Map? = null -) { +) +{ /** * * Values: uPPER,lower */ - enum class MapOfEnumString(val value: kotlin.collections.Map<kotlin.String, kotlin.String>){ + enum class MapOfEnumString(val value: kotlin.collections.Map){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"); } - } + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 74559242c8ba..7d835a2af541 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,6 +13,7 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal +import com.squareup.moshi.Json /** * * @param uuid @@ -20,10 +21,12 @@ import org.openapitools.client.models.Animal * @param map */ data class MixedPropertiesAndAdditionalPropertiesClass ( + @Json(name = "uuid") val uuid: java.util.UUID? = null, + @Json(name = "dateTime") val dateTime: java.time.LocalDateTime? = null, + @Json(name = "map") val map: kotlin.collections.Map? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt index 579aa048b059..b2e792c8e8e8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing model name starting with number * @param name * @param propertyClass */ data class Model200Response ( + @Json(name = "name") val name: kotlin.Int? = null, + @Json(name = "class") val propertyClass: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt index b181422f4ce5..72cb9d7ad64b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing model name same as property name * @param name @@ -20,11 +21,14 @@ package org.openapitools.client.models * @param `123number` */ data class Name ( + @Json(name = "name") val name: kotlin.Int, + @Json(name = "snake_case") val snakeCase: kotlin.Int? = null, + @Json(name = "property") val property: kotlin.String? = null, + @Json(name = "123Number") val `123number`: kotlin.Int? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..86bb11c5c1d9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,58 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* 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 +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ +data class NullableClass ( + @Json(name = "integer_prop") + val integerProp: kotlin.Int? = null, + @Json(name = "number_prop") + val numberProp: java.math.BigDecimal? = null, + @Json(name = "boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @Json(name = "string_prop") + val stringProp: kotlin.String? = null, + @Json(name = "date_prop") + val dateProp: java.time.LocalDate? = null, + @Json(name = "datetime_prop") + val datetimeProp: java.time.LocalDateTime? = null, + @Json(name = "array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @Json(name = "array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @Json(name = "array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @Json(name = "object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @Json(name = "object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @Json(name = "object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) + + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt index b49d4f28e6c7..7385bd952314 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param justNumber */ data class NumberOnly ( + @Json(name = "JustNumber") val justNumber: java.math.BigDecimal? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 2950a7445511..d33f3bf23935 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,15 +23,22 @@ import com.squareup.moshi.Json * @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 -) { +) +{ /** * Order Status * Values: placed,approved,delivered @@ -45,6 +52,6 @@ data class Order ( @Json(name = "delivered") delivered("delivered"); } - } + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt index 20b318928773..304f88c52df4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param myNumber @@ -19,10 +20,12 @@ package org.openapitools.client.models * @param myBoolean */ data class OuterComposite ( + @Json(name = "my_number") val myNumber: java.math.BigDecimal? = null, + @Json(name = "my_string") val myString: kotlin.String? = null, + @Json(name = "my_boolean") val myBoolean: kotlin.Boolean? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt index 22f42f500ec5..8d84d2718738 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,18 @@ import com.squareup.moshi.Json */ enum class OuterEnum(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), + @Json(name = "placed") + placed("placed"), + + + @Json(name = "approved") + approved("approved"), + + + @Json(name = "delivered") + delivered("delivered"); - @Json(name = "delivered") delivered("delivered"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index 12a377491392..b3fa7c452428 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,18 @@ import com.squareup.moshi.Json */ enum class OuterEnumDefaultValue(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), + @Json(name = "placed") + placed("placed"), + + + @Json(name = "approved") + approved("approved"), + + + @Json(name = "delivered") + delivered("delivered"); - @Json(name = "delivered") delivered("delivered"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index 0e61152c6d99..9defa9842e48 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,18 @@ import com.squareup.moshi.Json */ enum class OuterEnumInteger(val value: kotlin.Int){ - @Json(name = "0") _0(0), - @Json(name = "1") _1(1), + @Json(name = "0") + _0(0), + + + @Json(name = "1") + _1(1), + + + @Json(name = "2") + _2(2); - @Json(name = "2") _2(2); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index b5592bd85700..8b9a7e71846e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,18 @@ import com.squareup.moshi.Json */ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ - @Json(name = "0") _0(0), - @Json(name = "1") _1(1), + @Json(name = "0") + _0(0), + + + @Json(name = "1") + _1(1), + + + @Json(name = "2") + _2(2); - @Json(name = "2") _2(2); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index 4c3ee418894f..b0c73cfb5144 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,15 +25,22 @@ import com.squareup.moshi.Json * @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 -) { +) +{ /** * pet status in the store * Values: available,pending,sold @@ -47,6 +54,6 @@ data class Pet ( @Json(name = "sold") sold("sold"); } - } + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index b923cebdc882..52bf083649ae 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param bar * @param baz */ data class ReadOnlyFirst ( + @Json(name = "bar") val bar: kotlin.String? = null, + @Json(name = "baz") val baz: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt index f258953c49fb..91c531468436 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing reserved words * @param `return` */ data class Return ( + @Json(name = "return") val `return`: kotlin.Int? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 47688614c787..a4faf3fd57a5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * - * @param `$specialPropertyName` + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket */ data class SpecialModelname ( - val `$specialPropertyName`: kotlin.Long? = null -) { + @Json(name = "$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 8e3bc218e1b1..37e9e0eaef3d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,15 +12,17 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param id * @param name */ data class Tag ( + @Json(name = "id") val id: kotlin.Long? = null, + @Json(name = "name") val name: kotlin.String? = null -) { +) -} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 2c77d12201f7..5301e72d3763 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param id @@ -24,16 +25,23 @@ package org.openapitools.client.models * @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 -) { +) -} 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 2f81801b7943..0e97bd19efbf 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 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md index ddff6397573b..2f2c6d2e0a60 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index ddd809a7014e..c3b5b2f1e279 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -796,3 +797,66 @@ No authorization required [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + + + +To test the collection format in query parameters + +### Example + +```php +testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**string[]**](../Model/string.md)| | + **ioutil** | [**string[]**](../Model/string.md)| | + **http** | [**string[]**](../Model/string.md)| | + **url** | [**string[]**](../Model/string.md)| | + **context** | [**string[]**](../Model/string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### 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) + diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh b/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index d1a2b166a671..c8346899f842 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 543245713015..83032b55304e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 185418cadfbe..fe8f63fab173 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** @@ -3551,6 +3551,297 @@ protected function testJsonFormDataRequest($param, $param2) ); } + /** + * Operation testQueryParameterCollectionFormat + * + * @param string[] $pipe pipe (required) + * @param string[] $ioutil ioutil (required) + * @param string[] $http http (required) + * @param string[] $url url (required) + * @param string[] $context context (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + { + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context); + } + + /** + * Operation testQueryParameterCollectionFormatWithHttpInfo + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context) + { + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testQueryParameterCollectionFormatAsync + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context) + { + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testQueryParameterCollectionFormatAsyncWithHttpInfo + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + { + $returnType = ''; + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testQueryParameterCollectionFormat' + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context) + { + // verify the required parameter 'pipe' is set + if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pipe when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'ioutil' is set + if ($ioutil === null || (is_array($ioutil) && count($ioutil) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'http' is set + if ($http === null || (is_array($http) && count($http) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $http when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'url' is set + if ($url === null || (is_array($url) && count($url) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'context' is set + if ($context === null || (is_array($context) && count($context) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' + ); + } + + $resourcePath = '/fake/test-query-paramters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pipe)) { + $pipe = ObjectSerializer::serializeCollection($pipe, 'multi', true); + } + if ($pipe !== null) { + $queryParams['pipe'] = ObjectSerializer::toQueryValue($pipe); + } + // query params + if (is_array($ioutil)) { + $ioutil = ObjectSerializer::serializeCollection($ioutil, 'csv', true); + } + if ($ioutil !== null) { + $queryParams['ioutil'] = ObjectSerializer::toQueryValue($ioutil); + } + // query params + if (is_array($http)) { + $http = ObjectSerializer::serializeCollection($http, 'space', true); + } + if ($http !== null) { + $queryParams['http'] = ObjectSerializer::toQueryValue($http); + } + // query params + if (is_array($url)) { + $url = ObjectSerializer::serializeCollection($url, 'csv', true); + } + if ($url !== null) { + $queryParams['url'] = ObjectSerializer::toQueryValue($url); + } + // query params + if (is_array($context)) { + $context = ObjectSerializer::serializeCollection($context, 'multi', true); + } + if ($context !== null) { + $queryParams['context'] = ObjectSerializer::toQueryValue($context); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * 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 71e93259e10a..752bd0338db5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 084e7b62874d..94f6c8b0cf2e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f4d241d28a4f..777b39624ab0 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c6104c9f5886..930ae5cbfedb 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 93c6fe56f7f4..333d0a7f2fe6 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6d082d9ecbd5..74f061d1b8ad 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 0448f78fafd7..df285d652bf3 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f315059c99cc..0bd2db1525db 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ddfa967fe315..ac6d9082b733 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 30f673754f9e..c1c82d76cdac 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 70c86d8d19df..e32b6781485e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1015e7480897..a76f5d3acb3e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b9eca45a71c6..f7b3381a8839 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 0cd8bbc0f5e4..774560b79d81 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a4beb8007e54..55fd5cda68be 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 760ad2a81aa0..3bb9a232581e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6a34329d7be7..29c35d5df876 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4834bda03449..a7b2ae94562b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6e7930ab2928..0f025e7227a2 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b7c9762765fb..6a0a37286693 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a7c17fe156b5..7d8024ced11f 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 289f1d86db6e..c28dd01ffada 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 839b4b16754a..61140467fd8c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 bf2c564cc6d6..312b7be653a6 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7654a9107e80..6260508cfd57 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 0c359e2a2404..f89f41deaf48 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1e6b27ee6c45..751796331eca 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 d13a1f134235..27c658fda47a 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 700378d0a22c..08017cad244e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a78add5c5a8a..e0a532a367ee 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 3bb2e1a6ccc0..bbb8e53a6c97 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5dac3e1787eb..5f97ad46602c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 2c55b6e99f49..7d6de50ed245 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 8d57b3a33231..fa36a2bf5944 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 2c99c30605a1..38ebe9f0e95d 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e78018d6d546..901209f5867b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4b17d92d13e0..e36553623461 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c1923d9d2910..8d1b080c9460 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7522a7911788..1b37ce50fc4b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 be08a19c7991..e0dbe01e2c1a 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b5fece9a78d3..7167b7abbd21 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 08fc12f5b08e..5554b691ef41 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 d183cdd53fe6..b8d680ea28d6 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6c29d9067fb2..4af627fd82a9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ad2ff948639b..c7f4f4a12958 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 83efd3332b8d..ebfc25987897 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6e656b15335b..2579c56894af 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 3efa6e1f5ce2..4d0d721e7186 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5f565a4bffd6..c7a8d103733d 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 42a2fcac6734..cca589e5d2a5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ba96a75c33c1..7654abe9f558 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 15846b651219..bbbd1b29d735 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4fcaff7b54fd..040fb6ebaa17 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 652f37b69fcf..4f2a6d0accb5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 862e38991227..443319649538 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 43507bf63de0..3fc3e71f80cc 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6744b9c21f92..75fc5ba92fef 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e2faef5275eb..15f94983bdb3 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7ff12ef96142..404dd3de11cb 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 87bcc51b1c0b..9445a02915aa 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 738ce73466c0..6ac7aa6351b5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** @@ -201,4 +201,14 @@ public function testTestInlineAdditionalProperties() public function testTestJsonFormData() { } + + /** + * Test case for testQueryParameterCollectionFormat + * + * . + * + */ + public function testTestQueryParameterCollectionFormat() + { + } } 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 2697a21342ed..a12926190162 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 2d04e353fe36..70753715c118 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 fe51ce2f3ef1..dad95dc00962 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6ee055793ada..c259663e3677 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7200c186bcbf..025f8cf47a73 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 598ba353ef5a..809a41d34de9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ff127b649011..859e3b46c24b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 a80c4a544373..41a1d726e5e9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7c52127e1ad6..3a2a8f5dc3bd 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 322fdbc15549..e10bc0fa6985 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 02d5965efb02..0b49b85de13c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f5574208ccb2..ab8ff01a4ee4 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1b7bbab78395..a8bcadb2c8fb 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 70be8dbb25e1..f36da9bfb818 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 063847ceb90e..7ee3aff0d2d4 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c4a9eaee088d..366763cc4793 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 17c4ce9e975d..db2ff4704079 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 bbdf71bcb638..1cd276f64b4f 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4c0b5b97fef3..8d80ec35b5bc 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 7f83f3312bfb..fa8eb1e05504 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 128b563d3dba..8a1a6e87553a 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5c042591be14..fd60879723d1 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e67751dd8613..6c1b925b3249 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 cab54545d64c..4ba2e5af95c7 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 4d9b55277bd4..0042169df74a 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 25df1e7911c8..48b43992ad38 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e8e9bc75e3cb..6e9af6383136 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 5984370f0ac3..14de69ea2d7a 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 078bd308ae11..fa2dc69f2b3e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f63c1117365f..fb06e18aa28c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 0a31cf346510..507597c103c5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c1d60bfd93b5..3eaf4391f76c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1069f5757613..c900663662b3 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c4553c0dd82e..d4ca0cefd707 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 14a38f611a13..ad56b4c97f15 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 c59fa9106a46..a67445e0802c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b88485f7f446..4408ec2905c5 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 43843dba2b11..95b170613d3e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e93a5e46d18a..01462779b4c9 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 f3fb739ffada..f7d5f487c011 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 9ead82fa849c..d757586e4718 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 fef2a5102d81..760b03bfc260 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 9536eb775bfb..5c21fd7e6c00 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 137d9c605d12..4a5a5427630d 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 3ea20e311e04..e2e755698d5e 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 e18d0d5db5cb..cc0b0de181b2 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 8950d7f102b2..537640ba94ff 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 b16b2c37a9b6..1674c2c4fac7 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 33b7848030d6..5721f0514853 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 1fce252c5dc0..1820dbcc7a9b 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 ebf93790131b..4f164e3e120c 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 bae67b14a323..2a1251350c40 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** 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 6a8cb63d036c..a2d4e2aad2ae 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,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.1.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.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/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index d10f52f9f630..907737d8b0ec 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -14,7 +14,7 @@ Python 2.7 and 3.4+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git @@ -88,6 +88,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 6e5c94782952..428e61341c35 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **fake_health_get** @@ -765,3 +766,63 @@ No authorization required [[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) +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/openapi3/client/petstore/python/git_push.sh b/samples/openapi3/client/petstore/python/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/python/git_push.sh +++ b/samples/openapi3/client/petstore/python/git_push.sh @@ -1,11 +1,17 @@ #!/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" +# 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" @@ -28,7 +34,7 @@ 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. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 3f95f76d3453..bd4e6f6c3e22 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1586,3 +1586,144 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'multi' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index e4395af66dea..499d3870a570 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -67,6 +67,9 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.api_key_prefix = api_key_prefix """dict to store API prefix (e.g. Bearer) """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ self.username = username """Username for HTTP basic authentication """ @@ -227,11 +230,15 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py index 86988b6d42e0..1d5e7c2915ef 100644 --- a/samples/openapi3/client/petstore/python/setup.py +++ b/samples/openapi3/client/petstore/python/setup.py @@ -31,7 +31,7 @@ url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby-faraday/.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/openapi3/client/petstore/ruby-faraday/README.md b/samples/openapi3/client/petstore/ruby-faraday/README.md index 6be30fc31158..c23142438a52 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/README.md +++ b/samples/openapi3/client/petstore/ruby-faraday/README.md @@ -90,6 +90,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md index ab79170143b9..e29e28ea1a3e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/ruby-faraday/git_push.sh b/samples/openapi3/client/petstore/ruby-faraday/git_push.sh index b9fd6af8e051..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/git_push.sh +++ b/samples/openapi3/client/petstore/ruby-faraday/git_push.sh @@ -1,14 +1,17 @@ #!/bin/sh -# -# Generated by: https://openapi-generator.tech -# # 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" +# 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" @@ -40,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -50,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/openapi3/client/petstore/ruby-faraday/lib/petstore.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb index 50ae5e03d0dc..de89827af2a7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 e828d7208b4f..0678fa0f9410 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 517cd52709f4..b84c53db88cd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9d04817774db..1a8d83f5c187 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -985,5 +985,92 @@ def test_json_form_data_with_http_info(param, param2, opts = {}) end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + if @api_client.config.client_side_validation && context.nil? + fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" + end + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end 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 efc6c0d29c68..d614f6d3ee4e 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 1046df37b6d9..9f7f374a3df6 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -103,7 +103,7 @@ def delete_pet_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -290,7 +290,7 @@ def get_pet_by_id_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -414,7 +414,7 @@ def update_pet_with_form_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -480,7 +480,7 @@ def upload_file_with_http_info(pet_id, opts = {}) fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" end # resource path - local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -552,7 +552,7 @@ def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" end # resource path - local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s)) # query parameters query_params = opts[:query_params] || {} 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 9e577bbf5342..c1a362c43d5c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -43,7 +43,7 @@ def delete_order_with_http_info(order_id, opts = {}) fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -167,7 +167,7 @@ def get_order_by_id_with_http_info(order_id, opts = {}) end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)) # query parameters query_params = opts[:query_params] || {} 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 51cee2bc4e86..1779d60f8170 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -225,7 +225,7 @@ def delete_user_with_http_info(username, opts = {}) fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -283,7 +283,7 @@ def get_user_by_name_with_http_info(username, opts = {}) fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -471,7 +471,7 @@ def update_user_with_http_info(username, user, opts = {}) fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s)) # query parameters query_params = opts[:query_params] || {} 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 da74bafbc6c3..aca9e137ecc1 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -49,7 +49,7 @@ def call_api(http_method, path, opts = {}) ssl_options = { :ca_file => @config.ssl_ca_file, :verify => @config.ssl_verify, - :verify => @config.ssl_verify_mode, + :verify_mode => @config.ssl_verify_mode, :client_cert => @config.ssl_client_cert, :client_key => @config.ssl_client_key } 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 06edcc78dc7e..c2e09163dbc2 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a6f5ceefe472..3896535a8272 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d1e15cc183ae..3e80158616f4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 4bb43b9b3f2b..22534037326f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 b97381b8f3c7..4bf1337db684 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6524faab1bb1..b68b58e37186 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 2cb6117756c3..b93d130d6115 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6e8b6c9c4155..5bda94e622c3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 9e0b353acb07..c12b2df1c0d6 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 0e371fdab380..3283edc0eb74 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 220f108d8cca..c01bcaedd975 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 8089f254d4f4..3de255654fdd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 8aa5d5272f21..68d71b58cfe3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e70206c160d3..f1c127a08020 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 19203ab642c8..3b4e93d3fd9c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e96ac0158024..0bdb0add469b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 5b565597132f..1c1907d66828 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e105ff447a8a..9e5a749ea54f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 00e245e8a709..cfd84aaabb15 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6bce09460dc4..6506ed2ccd5f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 7bb95e34fd20..73996f6e7a78 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 32c01cb0a692..ddaa86607235 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 0b1472d0e008..8d7cfde1ca64 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e916d10b16ce..aab0c27981ad 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 3ec740ccf7f3..f9edacf2b167 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 f7319904db99..71eb9b597dbc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 2b0281d553ec..84560a4b7569 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 5312efc42a09..a3a25ad720d6 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 073e4822d76a..7d2799536a8c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 1048510ded51..d8bc46da1663 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 4782507a78c8..127ceaa8ed1c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 336486e966a3..ab09251ecabf 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 db861f23f77d..4ff3f5da2c2f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 c8465b1823cf..63d962f4deb4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 7e5ed178810a..bc1499d8316c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 552de582c698..63e5d01953b5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 3aaa464c8e37..0c0bc807ef62 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 302506441838..ced17285d4ec 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 92efb7fdaeb3..2a7fcb8f7910 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 553ca99beb38..3d202af689a5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 c790d7027027..a7e2c5f020ef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 dd05f8ade309..45a492d7a8fe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 d24a7b353ffe..f768bab749fc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f6b631e77493..a79cdcededd7 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 92a0b518e32a..ed423af36c2b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a7542f4cac47..84865e2a996b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 59cbcadc5a6a..9bb303c380b3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 beccaccac432..a22c48abf415 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 f16178a214c2..49d28691de5d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 700c27baf17d..0865fc01b416 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 be6a8e9350a4..144f13bd6fdd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 37b31e0899a0..1413eb856a6c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec index 348b1213f447..ca94948460f9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ab755e9edf8e..af28a897b0e5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 61dceb031d79..38ebb67fc9dd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 3c9cce607b82..87f7a5169edc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -204,4 +204,19 @@ end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + 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 7a279d9efa98..a87513eab154 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b47e785aabe6..812016a0b534 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 0792a31a847c..b159b3740314 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 327075b83682..d4f5c34844a2 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f66015c816eb..4a65cbd55a4b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 08a875cffef2..f26dd5d9ea20 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 00a004c2fb07..5f84eb8f66ea 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c6610d36e11b..6689296c03c8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 700bdaa2aec7..7788def0381a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ef282fa6b890..e0af34704312 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ecc5ad52c4e2..8c3c137d6711 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 42c8c8351131..046dfd0b6fef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a2273bae1928..79bdc3700e0a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c27179120c52..55be1ba89dc7 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b0e1093fefb8..3a549f61b0ae 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a437816f7a36..92815daf8713 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 28e126def6c4..1348f4108d9c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 0a2446b6bb05..d9f698219f01 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 45fb6a3c422f..797e3ac4190d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 46da564fab54..b5974e6bc280 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 2ea117c042ec..d8b99761ca2a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 abd0f5511487..ac9f99d1d881 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d26e2693d27e..571e85ff72e4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d8ff3c210069..ce16c64d96fe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 50c1c6c4e152..9ea07d98919b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f7915c8d68e7..712203df4d20 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9f1785bcbe2a..0adbd8ad13fb 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 24392afa873b..f74766f78385 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 2a1aaac7826e..5987de23a013 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6fd340cd5c4e..41877df3a51b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 cedf2d70a106..12e051e2645b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c092d4796784..6be7e134b466 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 50fde4ba0e92..59c469e132fa 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 eab00d67881b..9b430267864c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 15b6e33b8c82..f6deb2753717 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 4433c9e1d480..82734d749a83 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b18296476349..85af1ebc1b83 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 729dc35145c8..db8bcc93c75c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 bd675e88e7fc..f85e4fc0ab35 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 701e9891fb85..48514051cedf 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f4bdd9253ce8..4686c6e58cb5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6f8633c75631..acb40b437610 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f508ba98b4f9..b147cfafbf62 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 093452f46089..622474911e8c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9f7cb8f767e4..b9207c7f8265 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 fb670b2977e5..5e2770aa81b5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 72d3c549667e..09b3b6582e2e 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 310e4ee6fda3..2ae4aa4601fb 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 3e69113a392d..f12a79218d60 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d196aa079e90..76b297bb92f9 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 74ea31c6959a..05d663984167 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 960d289dde74..8c9dc8faa6e8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c8264386763c..c37ebaff67c8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 72cf2dd5115d..8cd9c57394ee 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d64a11e2b485..685280b7adc0 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6b9663ca6643..9d2f01c329f9 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby/.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/openapi3/client/petstore/ruby/README.md b/samples/openapi3/client/petstore/ruby/README.md index 6be30fc31158..c23142438a52 100644 --- a/samples/openapi3/client/petstore/ruby/README.md +++ b/samples/openapi3/client/petstore/ruby/README.md @@ -90,6 +90,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md index ab79170143b9..e29e28ea1a3e 100644 --- a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/ruby/git_push.sh b/samples/openapi3/client/petstore/ruby/git_push.sh index b9fd6af8e051..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/ruby/git_push.sh +++ b/samples/openapi3/client/petstore/ruby/git_push.sh @@ -1,14 +1,17 @@ #!/bin/sh -# -# Generated by: https://openapi-generator.tech -# # 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" +# 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" @@ -40,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -50,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/openapi3/client/petstore/ruby/lib/petstore.rb b/samples/openapi3/client/petstore/ruby/lib/petstore.rb index 50ae5e03d0dc..de89827af2a7 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 e828d7208b4f..0678fa0f9410 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 517cd52709f4..b84c53db88cd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9d04817774db..1a8d83f5c187 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -985,5 +985,92 @@ def test_json_form_data_with_http_info(param, param2, opts = {}) end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + if @api_client.config.client_side_validation && context.nil? + fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" + end + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end 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 efc6c0d29c68..d614f6d3ee4e 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 1046df37b6d9..052c6dd1caaa 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9e577bbf5342..1361ea4975a4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 51cee2bc4e86..007d2ef29573 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6abea99e7ffa..96c12cd174ff 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 06edcc78dc7e..c2e09163dbc2 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb index ead5913764bf..d197f59b7344 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d1e15cc183ae..3e80158616f4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 4bb43b9b3f2b..22534037326f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 b97381b8f3c7..4bf1337db684 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6524faab1bb1..b68b58e37186 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 2cb6117756c3..b93d130d6115 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6e8b6c9c4155..5bda94e622c3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 9e0b353acb07..c12b2df1c0d6 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 0e371fdab380..3283edc0eb74 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 220f108d8cca..c01bcaedd975 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 8089f254d4f4..3de255654fdd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 8aa5d5272f21..68d71b58cfe3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e70206c160d3..f1c127a08020 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 19203ab642c8..3b4e93d3fd9c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e96ac0158024..0bdb0add469b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 5b565597132f..1c1907d66828 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e105ff447a8a..9e5a749ea54f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 00e245e8a709..cfd84aaabb15 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 6bce09460dc4..6506ed2ccd5f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 7bb95e34fd20..73996f6e7a78 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 32c01cb0a692..ddaa86607235 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 0b1472d0e008..8d7cfde1ca64 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 e916d10b16ce..aab0c27981ad 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 3ec740ccf7f3..f9edacf2b167 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 f7319904db99..71eb9b597dbc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 2b0281d553ec..84560a4b7569 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 5312efc42a09..a3a25ad720d6 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 073e4822d76a..7d2799536a8c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 1048510ded51..d8bc46da1663 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 4782507a78c8..127ceaa8ed1c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 336486e966a3..ab09251ecabf 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 db861f23f77d..4ff3f5da2c2f 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 c8465b1823cf..63d962f4deb4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 7e5ed178810a..bc1499d8316c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 552de582c698..63e5d01953b5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 3aaa464c8e37..0c0bc807ef62 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 302506441838..ced17285d4ec 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 92efb7fdaeb3..2a7fcb8f7910 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 553ca99beb38..3d202af689a5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 c790d7027027..a7e2c5f020ef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 dd05f8ade309..45a492d7a8fe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 d24a7b353ffe..f768bab749fc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f6b631e77493..a79cdcededd7 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 92a0b518e32a..ed423af36c2b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a7542f4cac47..84865e2a996b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 59cbcadc5a6a..9bb303c380b3 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 beccaccac432..a22c48abf415 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 f16178a214c2..49d28691de5d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 700c27baf17d..0865fc01b416 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end 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 be6a8e9350a4..144f13bd6fdd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb index 37b31e0899a0..1413eb856a6c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/petstore.gemspec b/samples/openapi3/client/petstore/ruby/petstore.gemspec index e6fe7aa474b7..db2acf77d2df 100644 --- a/samples/openapi3/client/petstore/ruby/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ab755e9edf8e..af28a897b0e5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 61dceb031d79..38ebb67fc9dd 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 3c9cce607b82..87f7a5169edc 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end @@ -204,4 +204,19 @@ end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + 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 7a279d9efa98..a87513eab154 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b47e785aabe6..812016a0b534 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 0792a31a847c..b159b3740314 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 327075b83682..d4f5c34844a2 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 468e5f36afcb..aea4c5f46c9d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb index 08a875cffef2..f26dd5d9ea20 100644 --- a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 00a004c2fb07..5f84eb8f66ea 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c6610d36e11b..6689296c03c8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 700bdaa2aec7..7788def0381a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ef282fa6b890..e0af34704312 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 ecc5ad52c4e2..8c3c137d6711 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 42c8c8351131..046dfd0b6fef 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a2273bae1928..79bdc3700e0a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c27179120c52..55be1ba89dc7 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b0e1093fefb8..3a549f61b0ae 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 a437816f7a36..92815daf8713 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 28e126def6c4..1348f4108d9c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 0a2446b6bb05..d9f698219f01 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 45fb6a3c422f..797e3ac4190d 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 46da564fab54..b5974e6bc280 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 2ea117c042ec..d8b99761ca2a 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 abd0f5511487..ac9f99d1d881 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d26e2693d27e..571e85ff72e4 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d8ff3c210069..ce16c64d96fe 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 50c1c6c4e152..9ea07d98919b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f7915c8d68e7..712203df4d20 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9f1785bcbe2a..0adbd8ad13fb 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 24392afa873b..f74766f78385 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 2a1aaac7826e..5987de23a013 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6fd340cd5c4e..41877df3a51b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 cedf2d70a106..12e051e2645b 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c092d4796784..6be7e134b466 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 50fde4ba0e92..59c469e132fa 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 eab00d67881b..9b430267864c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 15b6e33b8c82..f6deb2753717 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 4433c9e1d480..82734d749a83 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 b18296476349..85af1ebc1b83 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 729dc35145c8..db8bcc93c75c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 bd675e88e7fc..f85e4fc0ab35 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 701e9891fb85..48514051cedf 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f4bdd9253ce8..4686c6e58cb5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 6f8633c75631..acb40b437610 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 f508ba98b4f9..b147cfafbf62 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 093452f46089..622474911e8c 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 9f7cb8f767e4..b9207c7f8265 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 fb670b2977e5..5e2770aa81b5 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 72d3c549667e..09b3b6582e2e 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 310e4ee6fda3..2ae4aa4601fb 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 3e69113a392d..f12a79218d60 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d196aa079e90..76b297bb92f9 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 74ea31c6959a..05d663984167 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 960d289dde74..8c9dc8faa6e8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 c8264386763c..c37ebaff67c8 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 72cf2dd5115d..8cd9c57394ee 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =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 d64a11e2b485..685280b7adc0 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,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb index 6b9663ca6643..9d2f01c329f9 100644 --- a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.1.3-SNAPSHOT =end diff --git a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator-ignore b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/.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/schema/petstore/avro-schema/.openapi-generator/VERSION b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION new file mode 100644 index 000000000000..2f81801b7943 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc b/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc new file mode 100644 index 000000000000..d3ce5cc6aea6 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc @@ -0,0 +1,23 @@ +{ + "namespace": "model", + "type": "record", + "doc": "Describes the result of uploading an image resource", + "name": "ApiResponse", + "fields": [ + { + "name": "code", + "type": ["null", "int"], + "doc": "" + }, + { + "name": "type", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "message", + "type": ["null", "string"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/Category.avsc b/samples/openapi3/schema/petstore/avro-schema/Category.avsc new file mode 100644 index 000000000000..527f2d389cd9 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/Category.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A category for a pet", + "name": "Category", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "name", + "type": ["null", "string"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc b/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc new file mode 100644 index 000000000000..70af82014c93 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "", + "name": "InlineObject", + "fields": [ + { + "name": "name", + "type": ["null", "string"], + "doc": "Updated name of the pet" + }, + { + "name": "status", + "type": ["null", "string"], + "doc": "Updated status of the pet" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc b/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc new file mode 100644 index 000000000000..322dae3751e0 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "", + "name": "InlineObject1", + "fields": [ + { + "name": "additionalMetadata", + "type": ["null", "string"], + "doc": "Additional data to pass to server" + }, + { + "name": "file", + "type": ["null", "model.File"], + "doc": "file to upload" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/Order.avsc b/samples/openapi3/schema/petstore/avro-schema/Order.avsc new file mode 100644 index 000000000000..945f42d579e6 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/Order.avsc @@ -0,0 +1,46 @@ +{ + "namespace": "model", + "type": "record", + "doc": "An order for a pets from the pet store", + "name": "Order", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "petId", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "quantity", + "type": ["null", "int"], + "doc": "" + }, + { + "name": "shipDate", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "status", + "type": ["null", { + "type": "enum", + "name": "Order_status", + "symbols": [ + "placed", + "approved", + "delivered" + ] + }], + "doc": "Order Status" + }, + { + "name": "complete", + "type": ["null", "boolean"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/Pet.avsc b/samples/openapi3/schema/petstore/avro-schema/Pet.avsc new file mode 100644 index 000000000000..46ccf5f3d66c --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/Pet.avsc @@ -0,0 +1,52 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A pet for sale in the pet store", + "name": "Pet", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "category", + "type": ["null", "model.Category"], + "doc": "" + }, + { + "name": "name", + "type": "string", + "doc": "" + }, + { + "name": "photoUrls", + "type": { + "type": "array", + "items": "string" + }, + "doc": "" + }, + { + "name": "tags", + "type": ["null", { + "type": "array", + "items": "model.Tag" + }], + "doc": "" + }, + { + "name": "status", + "type": ["null", { + "type": "enum", + "name": "Pet_status", + "symbols": [ + "available", + "pending", + "sold" + ] + }], + "doc": "pet status in the store" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/Tag.avsc b/samples/openapi3/schema/petstore/avro-schema/Tag.avsc new file mode 100644 index 000000000000..ec31d8fb17ab --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/Tag.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A tag for a pet", + "name": "Tag", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "name", + "type": ["null", "string"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro-schema/User.avsc b/samples/openapi3/schema/petstore/avro-schema/User.avsc new file mode 100644 index 000000000000..2654a8179461 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/User.avsc @@ -0,0 +1,48 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A User who is purchasing from the pet store", + "name": "User", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "username", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "firstName", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "lastName", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "email", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "password", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "phone", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "userStatus", + "type": ["null", "int"], + "doc": "User Status" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/.openapi-generator-ignore b/samples/openapi3/schema/petstore/avro/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/.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/schema/petstore/avro/.openapi-generator/VERSION b/samples/openapi3/schema/petstore/avro/.openapi-generator/VERSION new file mode 100644 index 000000000000..2f81801b7943 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/schema/petstore/avro/ApiResponse.avsc b/samples/openapi3/schema/petstore/avro/ApiResponse.avsc new file mode 100644 index 000000000000..d3ce5cc6aea6 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/ApiResponse.avsc @@ -0,0 +1,23 @@ +{ + "namespace": "model", + "type": "record", + "doc": "Describes the result of uploading an image resource", + "name": "ApiResponse", + "fields": [ + { + "name": "code", + "type": ["null", "int"], + "doc": "" + }, + { + "name": "type", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "message", + "type": ["null", "string"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/Category.avsc b/samples/openapi3/schema/petstore/avro/Category.avsc new file mode 100644 index 000000000000..527f2d389cd9 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/Category.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A category for a pet", + "name": "Category", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "name", + "type": ["null", "string"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/InlineObject.avsc b/samples/openapi3/schema/petstore/avro/InlineObject.avsc new file mode 100644 index 000000000000..70af82014c93 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/InlineObject.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "", + "name": "InlineObject", + "fields": [ + { + "name": "name", + "type": ["null", "string"], + "doc": "Updated name of the pet" + }, + { + "name": "status", + "type": ["null", "string"], + "doc": "Updated status of the pet" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/InlineObject1.avsc b/samples/openapi3/schema/petstore/avro/InlineObject1.avsc new file mode 100644 index 000000000000..322dae3751e0 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/InlineObject1.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "", + "name": "InlineObject1", + "fields": [ + { + "name": "additionalMetadata", + "type": ["null", "string"], + "doc": "Additional data to pass to server" + }, + { + "name": "file", + "type": ["null", "model.File"], + "doc": "file to upload" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/Order.avsc b/samples/openapi3/schema/petstore/avro/Order.avsc new file mode 100644 index 000000000000..945f42d579e6 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/Order.avsc @@ -0,0 +1,46 @@ +{ + "namespace": "model", + "type": "record", + "doc": "An order for a pets from the pet store", + "name": "Order", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "petId", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "quantity", + "type": ["null", "int"], + "doc": "" + }, + { + "name": "shipDate", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "status", + "type": ["null", { + "type": "enum", + "name": "Order_status", + "symbols": [ + "placed", + "approved", + "delivered" + ] + }], + "doc": "Order Status" + }, + { + "name": "complete", + "type": ["null", "boolean"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/Pet.avsc b/samples/openapi3/schema/petstore/avro/Pet.avsc new file mode 100644 index 000000000000..46ccf5f3d66c --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/Pet.avsc @@ -0,0 +1,52 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A pet for sale in the pet store", + "name": "Pet", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "category", + "type": ["null", "model.Category"], + "doc": "" + }, + { + "name": "name", + "type": "string", + "doc": "" + }, + { + "name": "photoUrls", + "type": { + "type": "array", + "items": "string" + }, + "doc": "" + }, + { + "name": "tags", + "type": ["null", { + "type": "array", + "items": "model.Tag" + }], + "doc": "" + }, + { + "name": "status", + "type": ["null", { + "type": "enum", + "name": "Pet_status", + "symbols": [ + "available", + "pending", + "sold" + ] + }], + "doc": "pet status in the store" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/Tag.avsc b/samples/openapi3/schema/petstore/avro/Tag.avsc new file mode 100644 index 000000000000..ec31d8fb17ab --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/Tag.avsc @@ -0,0 +1,18 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A tag for a pet", + "name": "Tag", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "name", + "type": ["null", "string"], + "doc": "" + } + ] +} diff --git a/samples/openapi3/schema/petstore/avro/User.avsc b/samples/openapi3/schema/petstore/avro/User.avsc new file mode 100644 index 000000000000..2654a8179461 --- /dev/null +++ b/samples/openapi3/schema/petstore/avro/User.avsc @@ -0,0 +1,48 @@ +{ + "namespace": "model", + "type": "record", + "doc": "A User who is purchasing from the pet store", + "name": "User", + "fields": [ + { + "name": "id", + "type": ["null", "long"], + "doc": "" + }, + { + "name": "username", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "firstName", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "lastName", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "email", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "password", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "phone", + "type": ["null", "string"], + "doc": "" + }, + { + "name": "userStatus", + "type": ["null", "int"], + "doc": "User Status" + } + ] +} diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/controllers/pet_controller.py b/samples/openapi3/server/petstore/python-flask/openapi_server/controllers/pet_controller.py index 253f3bbfa1c8..125820f00549 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/controllers/pet_controller.py +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/controllers/pet_controller.py @@ -49,15 +49,13 @@ def find_pets_by_status(status): # noqa: E501 return 'do some magic!' -def find_pets_by_tags(tags, max_count=None): # noqa: E501 +def find_pets_by_tags(tags): # noqa: E501 """Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 :param tags: Tags to filter by :type tags: List[str] - :param max_count: Maximum number of items to return - :type max_count: int :rtype: List[Pet] """ diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index 851fb5fb8167..42547ecf8ac9 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -115,15 +115,6 @@ paths: type: string type: array style: form - - description: Maximum number of items to return - explode: true - in: query - name: maxCount - required: false - schema: - format: int32 - type: integer - style: form responses: 200: content: diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_pet_controller.py b/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_pet_controller.py index fc95fab555fd..c756d7bb2ca1 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_pet_controller.py +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_pet_controller.py @@ -89,8 +89,7 @@ def test_find_pets_by_tags(self): Finds Pets by tags """ - query_string = [('tags', 'tags_example'), - ('maxCount', 56)] + query_string = [('tags', 'tags_example')] headers = { 'Accept': 'application/json', 'Authorization': 'Bearer special-key', diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/util.py b/samples/openapi3/server/petstore/python-flask/openapi_server/util.py index 4b0188652ba7..e1185a713ec9 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/util.py +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/util.py @@ -16,7 +16,7 @@ def _deserialize(data, klass): if data is None: return None - if klass in six.integer_types or klass in (float, str, bool): + if klass in six.integer_types or klass in (float, str, bool, bytearray): return _deserialize_primitive(data, klass) elif klass == object: return _deserialize_object(data) diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.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/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index 5d43f6145404..c5b0f75fb074 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -416,6 +416,7 @@ CREATE TABLE IF NOT EXISTS `TypeHolderDefault` ( CREATE TABLE IF NOT EXISTS `TypeHolderExample` ( `string_item` TEXT NOT NULL, `number_item` DECIMAL(20, 9) NOT NULL, + `float_item` DECIMAL(20, 9) NOT NULL, `integer_item` INT NOT NULL, `bool_item` TINYINT(1) NOT NULL, `array_item` JSON NOT NULL diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 83a328a9227e..2f81801b7943 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs index c045601e12e0..a1715221ba26 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs @@ -83,7 +83,7 @@ public enum StatusEnum /// /// Order Status [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum? Status { get; set; } + public StatusEnum Status { get; set; } /// /// Gets or Sets Complete diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs index a5bc9faa07ec..cb8a2001f17f 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs @@ -91,7 +91,7 @@ public enum StatusEnum /// /// pet status in the store [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum? Status { get; set; } + public StatusEnum Status { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 83a328a9227e..0e97bd19efbf 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/main-api-server.cpp b/samples/server/petstore/cpp-pistache/main-api-server.cpp index 191b60b7712f..00799608e73d 100644 --- a/samples/server/petstore/cpp-pistache/main-api-server.cpp +++ b/samples/server/petstore/cpp-pistache/main-api-server.cpp @@ -25,11 +25,12 @@ #include "UserApiImpl.h" #define PISTACHE_SERVER_THREADS 2 -#define PISTACHE_SERVER_MAX_PAYLOAD 32768 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 static Pistache::Http::Endpoint *httpEndpoint; #ifdef __linux__ -static void sigHandler(int sig){ +static void sigHandler [[noreturn]] (int sig){ switch(sig){ case SIGINT: case SIGQUIT: @@ -73,7 +74,8 @@ int main() { auto opts = Pistache::Http::Endpoint::options() .threads(PISTACHE_SERVER_THREADS); opts.flags(Pistache::Tcp::Options::ReuseAddr); - opts.maxPayload(PISTACHE_SERVER_MAX_PAYLOAD); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); httpEndpoint->init(opts); diff --git a/samples/server/petstore/cpp-pistache/model/Pet.cpp b/samples/server/petstore/cpp-pistache/model/Pet.cpp index 1bceb861ad48..0ff016b545f0 100644 --- a/samples/server/petstore/cpp-pistache/model/Pet.cpp +++ b/samples/server/petstore/cpp-pistache/model/Pet.cpp @@ -48,7 +48,7 @@ void to_json(nlohmann::json& j, const Pet& o) j["category"] = o.m_Category; j["name"] = o.m_Name; j["photoUrls"] = o.m_PhotoUrls; - if(o.tagsIsSet()) + if(o.tagsIsSet() || !o.m_Tags.empty()) j["tags"] = o.m_Tags; if(o.statusIsSet()) j["status"] = o.m_Status; @@ -121,16 +121,24 @@ std::string Pet::getName() const void Pet::setName(std::string const& value) { m_Name = value; - } std::vector& Pet::getPhotoUrls() { return m_PhotoUrls; } +void Pet::setPhotoUrls(std::vector const& value) +{ + m_PhotoUrls = value; +} std::vector& Pet::getTags() { return m_Tags; } +void Pet::setTags(std::vector const& value) +{ + m_Tags = value; + m_TagsIsSet = true; +} bool Pet::tagsIsSet() const { return m_TagsIsSet; diff --git a/samples/server/petstore/cpp-pistache/model/Pet.h b/samples/server/petstore/cpp-pistache/model/Pet.h index f23ef47832d2..eddf475f6ee3 100644 --- a/samples/server/petstore/cpp-pistache/model/Pet.h +++ b/samples/server/petstore/cpp-pistache/model/Pet.h @@ -63,14 +63,16 @@ class Pet /// std::string getName() const; void setName(std::string const& value); - /// + /// /// /// std::vector& getPhotoUrls(); - /// + void setPhotoUrls(std::vector const& value); + /// /// /// std::vector& getTags(); + void setTags(std::vector const& value); bool tagsIsSet() const; void unsetTags(); /// diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp index ed0535ee0f3c..b565ee9a74f7 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp @@ -95,7 +95,7 @@ void OAIPetApiHandler::updatePetWithForm(qint64 pet_id, QString name, QString st reqObj->updatePetWithFormResponse(); } } -void OAIPetApiHandler::uploadFile(qint64 pet_id, QString additional_metadata, QIODevice* file) { +void OAIPetApiHandler::uploadFile(qint64 pet_id, QString additional_metadata, OAIHttpFileElement file) { Q_UNUSED(pet_id); Q_UNUSED(additional_metadata); Q_UNUSED(file); diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h index 1b1c50de6e30..cfa39da6d4b6 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h @@ -16,8 +16,8 @@ #include #include "OAIApiResponse.h" +#include "OAIHttpFileElement.h" #include "OAIPet.h" -#include #include namespace OpenAPI { @@ -39,7 +39,7 @@ public slots: virtual void getPetById(qint64 pet_id); virtual void updatePet(OAIPet body); virtual void updatePetWithForm(qint64 pet_id, QString name, QString status); - virtual void uploadFile(qint64 pet_id, QString additional_metadata, QIODevice* file); + virtual void uploadFile(qint64 pet_id, QString additional_metadata, OAIHttpFileElement file); }; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp index 9d4dd1eb8174..233f607a9cfc 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp @@ -13,13 +13,13 @@ #include "OAIApiResponse.h" -#include "OAIHelpers.h" - #include #include #include #include +#include "OAIHelpers.h" + namespace OpenAPI { OAIApiResponse::OAIApiResponse(QString json) { @@ -81,13 +81,13 @@ OAIApiResponse::asJson () const { QJsonObject OAIApiResponse::asJsonObject() const { QJsonObject obj; - if(m_code_isSet){ + if(m_code_isSet){ obj.insert(QString("code"), ::OpenAPI::toJsonValue(code)); } - if(m_type_isSet){ + if(m_type_isSet){ obj.insert(QString("type"), ::OpenAPI::toJsonValue(type)); } - if(m_message_isSet){ + if(m_message_isSet){ obj.insert(QString("message"), ::OpenAPI::toJsonValue(message)); } return obj; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h index 2fe8209ac10a..7e4d74603831 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h @@ -27,6 +27,7 @@ #include "OAIObject.h" #include "OAIEnum.h" + namespace OpenAPI { class OAIApiResponse: public OAIObject { @@ -53,7 +54,7 @@ class OAIApiResponse: public OAIObject { void setMessage(const QString &message); - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp index 752f6bdbba95..571dc37b6fa7 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp @@ -13,13 +13,13 @@ #include "OAICategory.h" -#include "OAIHelpers.h" - #include #include #include #include +#include "OAIHelpers.h" + namespace OpenAPI { OAICategory::OAICategory(QString json) { @@ -75,10 +75,10 @@ OAICategory::asJson () const { QJsonObject OAICategory::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if(m_id_isSet){ obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_name_isSet){ + if(m_name_isSet){ obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); } return obj; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h index 129d97485766..8cfc76f4305c 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h @@ -27,6 +27,7 @@ #include "OAIObject.h" #include "OAIEnum.h" + namespace OpenAPI { class OAICategory: public OAIObject { @@ -49,7 +50,7 @@ class OAICategory: public OAIObject { void setName(const QString &name); - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h index a5e619960fba..66625c43b633 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h @@ -24,7 +24,7 @@ class OAIEnum { OAIEnum() { } - + OAIEnum(QString jsonString) { fromJson(jsonString); } @@ -57,7 +57,7 @@ class OAIEnum { return true; } private : - QString jstr; + QString jstr; }; } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp index bbe372ea8563..e4138649b5a2 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp @@ -64,11 +64,23 @@ toStringValue(const double &value){ return QString::number(value); } +QString +toStringValue(const OAIObject &value){ + return value.asJson(); +} + + QString toStringValue(const OAIEnum &value){ return value.asJson(); } +QString +toStringValue(const OAIHttpFileElement &value){ + return value.asJson(); +} + + QJsonValue toJsonValue(const QString &value){ return QJsonValue(value); @@ -124,6 +136,12 @@ toJsonValue(const OAIEnum &value){ return value.asJsonValue(); } +QJsonValue +toJsonValue(const OAIHttpFileElement &value){ + return value.asJsonValue(); +} + + bool fromStringValue(const QString &inStr, QString &value){ value.clear(); @@ -218,6 +236,11 @@ fromStringValue(const QString &inStr, OAIEnum &value){ return true; } +bool +fromStringValue(const QString &inStr, OAIHttpFileElement &value){ + return value.fromStringValue(inStr); +} + bool fromJsonValue(QString &value, const QJsonValue &jval){ bool ok = true; @@ -229,7 +252,7 @@ fromJsonValue(QString &value, const QJsonValue &jval){ } else if(jval.isDouble()){ value = QString::number(jval.toDouble()); } else { - ok = false; + ok = false; } } else { ok = false; @@ -239,7 +262,7 @@ fromJsonValue(QString &value, const QJsonValue &jval){ bool fromJsonValue(QDateTime &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ value = QDateTime::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); @@ -263,7 +286,7 @@ fromJsonValue(QByteArray &value, const QJsonValue &jval){ bool fromJsonValue(QDate &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ value = QDate::fromString(jval.toString(), Qt::ISODate); ok = value.isValid(); @@ -275,7 +298,7 @@ fromJsonValue(QDate &value, const QJsonValue &jval){ bool fromJsonValue(qint32 &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ value = jval.toInt(); } else { @@ -286,7 +309,7 @@ fromJsonValue(qint32 &value, const QJsonValue &jval){ bool fromJsonValue(qint64 &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ value = jval.toVariant().toLongLong(); } else { @@ -297,7 +320,7 @@ fromJsonValue(qint64 &value, const QJsonValue &jval){ bool fromJsonValue(bool &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isBool()){ value = jval.toBool(); } else { @@ -308,7 +331,7 @@ fromJsonValue(bool &value, const QJsonValue &jval){ bool fromJsonValue(float &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isDouble()){ value = static_cast(jval.toDouble()); } else { @@ -319,7 +342,7 @@ fromJsonValue(float &value, const QJsonValue &jval){ bool fromJsonValue(double &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isDouble()){ value = jval.toDouble(); } else { @@ -330,7 +353,7 @@ fromJsonValue(double &value, const QJsonValue &jval){ bool fromJsonValue(OAIObject &value, const QJsonValue &jval){ - bool ok = true; + bool ok = true; if(jval.isObject()){ value.fromJsonObject(jval.toObject()); ok = value.isValid(); @@ -346,4 +369,9 @@ fromJsonValue(OAIEnum &value, const QJsonValue &jval){ return true; } +bool +fromJsonValue(OAIHttpFileElement &value, const QJsonValue &jval){ + return value.fromJsonValue(jval); +} + } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h index ce7cec3fc710..a2992183298d 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h @@ -22,8 +22,10 @@ #include #include #include + #include "OAIObject.h" #include "OAIEnum.h" +#include "OAIHttpFileElement.h" namespace OpenAPI { @@ -36,7 +38,9 @@ namespace OpenAPI { QString toStringValue(const bool &value); QString toStringValue(const float &value); QString toStringValue(const double &value); - QString toStringValue(const OAIEnum &value); + QString toStringValue(const OAIObject &value); + QString toStringValue(const OAIEnum &value); + QString toStringValue(const OAIHttpFileElement &value); template QString toStringValue(const QList &val) { @@ -61,6 +65,7 @@ namespace OpenAPI { QJsonValue toJsonValue(const double &value); QJsonValue toJsonValue(const OAIObject &value); QJsonValue toJsonValue(const OAIEnum &value); + QJsonValue toJsonValue(const OAIHttpFileElement &value); template QJsonValue toJsonValue(const QList &val) { @@ -89,7 +94,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, OAIEnum &value); + bool fromStringValue(const QString &inStr, OAIObject &value); + bool fromStringValue(const QString &inStr, OAIEnum &value); + bool fromStringValue(const QString &inStr, OAIHttpFileElement &value); template bool fromStringValue(const QList &inStr, QList &val) { @@ -124,6 +131,7 @@ namespace OpenAPI { 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); template bool fromJsonValue(QList &val, const QJsonValue &jval) { @@ -138,7 +146,7 @@ namespace OpenAPI { ok = false; } return ok; - } + } template bool fromJsonValue(QMap &val, const QJsonValue &jval) { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp new file mode 100644 index 000000000000..ef627144b1e5 --- /dev/null +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.cpp @@ -0,0 +1,162 @@ +/** + * 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. + */ + + +#include +#include +#include +#include + +#include "OAIHttpFileElement.h" + +namespace OpenAPI { + +void +OAIHttpFileElement::setMimeType(const QString &mime){ + mime_type = mime; +} + +void +OAIHttpFileElement::setFileName(const QString &name){ + local_filename = name; +} + +void +OAIHttpFileElement::setVariableName(const QString &name){ + variable_name = name; +} + +void +OAIHttpFileElement::setRequestFileName(const QString &name){ + request_filename = name; +} + +bool +OAIHttpFileElement::isSet() const { + return !local_filename.isEmpty() || !request_filename.isEmpty(); +} + +QString +OAIHttpFileElement::asJson() const{ + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return QString(bArray); +} + +QJsonValue +OAIHttpFileElement::asJsonValue() const{ + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return QJsonDocument::fromBinaryData(bArray.data()).object(); +} + +bool +OAIHttpFileElement::fromStringValue(const QString &instr){ + QFile file(local_filename); + bool result = false; + if(file.exists()) { + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(instr.toUtf8()); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +bool +OAIHttpFileElement::fromJsonValue(const QJsonValue &jval) { + QFile file(local_filename); + bool result = false; + if(file.exists()) { + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(QJsonDocument(jval.toObject()).toBinaryData()); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +QByteArray +OAIHttpFileElement::asByteArray() const { + QFile file(local_filename); + QByteArray bArray; + bool result = false; + if(file.exists()) { + result = file.open(QIODevice::ReadOnly); + bArray = file.readAll(); + file.close(); + } + if(!result) { + qDebug() << "Error opening file " << local_filename; + } + return bArray; +} + +bool +OAIHttpFileElement::fromByteArray(const QByteArray& bytes){ + QFile file(local_filename); + bool result = false; + if(file.exists()){ + file.remove(); + } + result = file.open(QIODevice::WriteOnly); + file.write(bytes); + file.close(); + if(!result) { + qDebug() << "Error creating file " << local_filename; + } + return result; +} + +bool +OAIHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ + setMimeType(mime); + setFileName(localFName); + setVariableName(varName); + setRequestFileName(reqFname); + return fromByteArray(bytes); +} + +QByteArray +OAIHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ + setMimeType(mime); + setFileName(localFName); + setVariableName(varName); + setRequestFileName(reqFname); + return asByteArray(); +} + +} diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h new file mode 100644 index 000000000000..b5d189b3440c --- /dev/null +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHttpFileElement.h @@ -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. + */ + +#ifndef OAI_HTTP_FILE_ELEMENT_H +#define OAI_HTTP_FILE_ELEMENT_H + +#include +#include +#include + + +namespace OpenAPI { + +class OAIHttpFileElement { + +public: + QString variable_name; + QString local_filename; + QString request_filename; + QString mime_type; + void setMimeType(const QString &mime); + void setFileName(const QString &name); + void setVariableName(const QString &name); + void setRequestFileName(const QString &name); + bool isSet() const; + bool fromStringValue(const QString &instr); + bool fromJsonValue(const QJsonValue &jval); + bool fromByteArray(const QByteArray& bytes); + bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); + QString asJson() const; + QJsonValue asJsonValue() const; + QByteArray asByteArray() const; + QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime); +}; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIHttpFileElement) + +#endif // OAI_HTTP_FILE_ELEMENT_H diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h index babc1e64fbbf..83757b567175 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h @@ -24,7 +24,7 @@ class OAIObject { OAIObject() { } - + OAIObject(QString jsonString) { fromJson(jsonString); } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp index 1ea3fba155de..a6f0fb92d97b 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp @@ -13,13 +13,13 @@ #include "OAIOrder.h" -#include "OAIHelpers.h" - #include #include #include #include +#include "OAIHelpers.h" + namespace OpenAPI { OAIOrder::OAIOrder(QString json) { @@ -99,22 +99,22 @@ OAIOrder::asJson () const { QJsonObject OAIOrder::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if(m_id_isSet){ obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_pet_id_isSet){ + if(m_pet_id_isSet){ obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id)); } - if(m_quantity_isSet){ + if(m_quantity_isSet){ obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity)); } - if(m_ship_date_isSet){ + if(m_ship_date_isSet){ obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date)); } - if(m_status_isSet){ + if(m_status_isSet){ obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); } - if(m_complete_isSet){ + if(m_complete_isSet){ obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete)); } return obj; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h index c9b006d36320..7acf2ab0a32d 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h @@ -28,6 +28,7 @@ #include "OAIObject.h" #include "OAIEnum.h" + namespace OpenAPI { class OAIOrder: public OAIObject { @@ -66,7 +67,7 @@ class OAIOrder: public OAIObject { void setComplete(const bool &complete); - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp index c611d2d82ab2..8a6cfec0319d 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp @@ -13,13 +13,13 @@ #include "OAIPet.h" -#include "OAIHelpers.h" - #include #include #include #include +#include "OAIHelpers.h" + namespace OpenAPI { OAIPet::OAIPet(QString json) { @@ -99,24 +99,24 @@ OAIPet::asJson () const { QJsonObject OAIPet::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if(m_id_isSet){ obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(category.isSet()){ + if(category.isSet()){ obj.insert(QString("category"), ::OpenAPI::toJsonValue(category)); } - if(m_name_isSet){ + if(m_name_isSet){ obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); } - + if(photo_urls.size() > 0){ obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls)); } - + if(tags.size() > 0){ obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags)); } - if(m_status_isSet){ + if(m_status_isSet){ obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); } return obj; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h index 6bec604d216c..c2577bfc5a25 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h @@ -30,6 +30,7 @@ #include "OAIObject.h" #include "OAIEnum.h" + namespace OpenAPI { class OAIPet: public OAIObject { @@ -68,7 +69,7 @@ class OAIPet: public OAIObject { void setStatus(const QString &status); - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp index 4cf8d349b452..d986ce63b144 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp @@ -13,13 +13,13 @@ #include "OAITag.h" -#include "OAIHelpers.h" - #include #include #include #include +#include "OAIHelpers.h" + namespace OpenAPI { OAITag::OAITag(QString json) { @@ -75,10 +75,10 @@ OAITag::asJson () const { QJsonObject OAITag::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if(m_id_isSet){ obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_name_isSet){ + if(m_name_isSet){ obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); } return obj; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h index 497a021f0858..2c8eb291d0ff 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h @@ -27,6 +27,7 @@ #include "OAIObject.h" #include "OAIEnum.h" + namespace OpenAPI { class OAITag: public OAIObject { @@ -49,7 +50,7 @@ class OAITag: public OAIObject { void setName(const QString &name); - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp index 52431c0367bb..2afe6d808eb4 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp @@ -13,13 +13,13 @@ #include "OAIUser.h" -#include "OAIHelpers.h" - #include #include #include #include +#include "OAIHelpers.h" + namespace OpenAPI { OAIUser::OAIUser(QString json) { @@ -111,28 +111,28 @@ OAIUser::asJson () const { QJsonObject OAIUser::asJsonObject() const { QJsonObject obj; - if(m_id_isSet){ + if(m_id_isSet){ obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); } - if(m_username_isSet){ + if(m_username_isSet){ obj.insert(QString("username"), ::OpenAPI::toJsonValue(username)); } - if(m_first_name_isSet){ + if(m_first_name_isSet){ obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name)); } - if(m_last_name_isSet){ + if(m_last_name_isSet){ obj.insert(QString("lastName"), ::OpenAPI::toJsonValue(last_name)); } - if(m_email_isSet){ + if(m_email_isSet){ obj.insert(QString("email"), ::OpenAPI::toJsonValue(email)); } - if(m_password_isSet){ + if(m_password_isSet){ obj.insert(QString("password"), ::OpenAPI::toJsonValue(password)); } - if(m_phone_isSet){ + if(m_phone_isSet){ obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone)); } - if(m_user_status_isSet){ + if(m_user_status_isSet){ obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status)); } return obj; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h index 556de322584e..29da83043b6b 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h @@ -27,6 +27,7 @@ #include "OAIObject.h" #include "OAIEnum.h" + namespace OpenAPI { class OAIUser: public OAIObject { @@ -73,7 +74,7 @@ class OAIUser: public OAIObject { void setUserStatus(const qint32 &user_status); - + virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp index 1d4fcfa1634a..d1a62ee04b5e 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp @@ -173,7 +173,7 @@ void OAIPetApiRequest::uploadFileRequest(const QString& pet_idstr){ fromStringValue(pet_idstr, pet_id); QString additional_metadata; - QIODevice* file; + OAIHttpFileElement file; emit uploadFile(pet_id, additional_metadata, file); } diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h index ad53bb80e731..41a0e49e7965 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h @@ -21,8 +21,8 @@ #include #include "OAIApiResponse.h" +#include "OAIHttpFileElement.h" #include "OAIPet.h" -#include #include #include "OAIPetApiHandler.h" @@ -84,7 +84,7 @@ class OAIPetApiRequest : public QObject void getPetById(qint64 pet_id); void updatePet(OAIPet body); void updatePetWithForm(qint64 pet_id, QString name, QString status); - void uploadFile(qint64 pet_id, QString additional_metadata, QIODevice* file); + void uploadFile(qint64 pet_id, QString additional_metadata, OAIHttpFileElement file); private: diff --git a/samples/server/petstore/fsharp-functions/.gitignore b/samples/server/petstore/fsharp-functions/.gitignore new file mode 100644 index 000000000000..ab071890fc85 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/.gitignore @@ -0,0 +1,265 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# Azure Functions localsettings file +local.settings.json + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +**/packages/** +# except build/, which is used as an MSBuild target. +#!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +mercury_server/.paket/paket.exe +mercury_server/paket-files/ + +# FAKE - F# Make +mercury_server/.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/.openapi-generator-ignore b/samples/server/petstore/fsharp-functions/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/.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/server/petstore/fsharp-functions/.openapi-generator/VERSION b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/OpenAPI.fsproj b/samples/server/petstore/fsharp-functions/OpenAPI/OpenAPI.fsproj new file mode 100644 index 000000000000..e26976729b75 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/OpenAPI.fsproj @@ -0,0 +1,44 @@ + + + OpenAPI + OpenAPI + netcoreapp2.1 + v2 + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/build.bat b/samples/server/petstore/fsharp-functions/OpenAPI/build.bat new file mode 100644 index 000000000000..607db898bff9 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/build.bat @@ -0,0 +1,3 @@ +dotnet restore OpenAPI.fsproj +dotnet build OpenAPI.fsproj + diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/build.sh b/samples/server/petstore/fsharp-functions/OpenAPI/build.sh new file mode 100644 index 000000000000..9356b9ac120b --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +dotnet restore OpenAPI.fsproj +dotnet build OpenAPI.fsproj + diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiHandler.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiHandler.fs new file mode 100644 index 000000000000..53025caf26ed --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiHandler.fs @@ -0,0 +1,193 @@ +namespace OpenAPI + +open PetApiHandlerParams +open PetApiServiceImplementation +open Microsoft.AspNetCore.Mvc +open Microsoft.AspNetCore.Http +open Newtonsoft.Json +open Microsoft.Azure.WebJobs +open System.IO + +module PetApiHandlers = + + /// + /// + /// + + //#region AddPet + /// + /// Add a new pet to the store + /// + [] + let AddPet + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = ["application/json";"application/xml";] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = PetApiService.AddPet bodyParams + match result with + | AddPetStatusCode405 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(405)) + + //#region DeletePet + /// + /// Deletes a pet + /// + [] + let DeletePet + ([] + req:HttpRequest ) = + + let result = PetApiService.DeletePet () + match result with + | DeletePetStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + + //#region FindPetsByStatus + /// + /// Finds Pets by status + /// + [] + let FindPetsByStatus + ([] + req:HttpRequest ) = + + let result = PetApiService.FindPetsByStatus () + match result with + | FindPetsByStatusDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | FindPetsByStatusStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + + //#region FindPetsByTags + /// + /// Finds Pets by tags + /// + [] + let FindPetsByTags + ([] + req:HttpRequest ) = + + let result = PetApiService.FindPetsByTags () + match result with + | FindPetsByTagsDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | FindPetsByTagsStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + + //#region GetPetById + /// + /// Find pet by ID + /// + [] + let GetPetById + ([] + req:HttpRequest ) = + + let result = PetApiService.GetPetById () + match result with + | GetPetByIdDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | GetPetByIdStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | GetPetByIdStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + + //#region UpdatePet + /// + /// Update an existing pet + /// + [] + let UpdatePet + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = ["application/json";"application/xml";] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = PetApiService.UpdatePet bodyParams + match result with + | UpdatePetStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | UpdatePetStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + | UpdatePetStatusCode405 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(405)) + + //#region UpdatePetWithForm + /// + /// Updates a pet in the store with form data + /// + [] + let UpdatePetWithForm + ([] + req:HttpRequest ) = + + let result = PetApiService.UpdatePetWithForm () + match result with + | UpdatePetWithFormStatusCode405 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(405)) + + //#region UploadFile + /// + /// uploads an image + /// + [] + let UploadFile + ([] + req:HttpRequest ) = + + let result = PetApiService.UploadFile () + match result with + | UploadFileDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + + + + diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiHandlerParams.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiHandlerParams.fs new file mode 100644 index 000000000000..f84ffb76b22c --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiHandlerParams.fs @@ -0,0 +1,210 @@ +namespace OpenAPI + +open OpenAPI.Model.ApiResponse +open OpenAPI.Model.Pet +open System.Collections.Generic +open System + +module PetApiHandlerParams = + + + //#region Body parameters + [] + type AddPetBodyParams = Pet + //#endregion + + + type AddPetStatusCode405Response = { + content:string; + + } + type AddPetResult = AddPetStatusCode405 of AddPetStatusCode405Response + + type AddPetArgs = { + bodyParams:AddPetBodyParams + } + //#region Path parameters + [] + type DeletePetPathParams = { + petId : int64 ; + } + //#endregion + + //#region Header parameters + [] + type DeletePetHeaderParams = { + apiKey : string option; + } + //#endregion + + + type DeletePetStatusCode400Response = { + content:string; + + } + type DeletePetResult = DeletePetStatusCode400 of DeletePetStatusCode400Response + + type DeletePetArgs = { + headerParams:DeletePetHeaderParams; + pathParams:DeletePetPathParams; + } + + //#region Query parameters + [] + type FindPetsByStatusQueryParams = { + status : string[] ; + + } + //#endregion + + + type FindPetsByStatusDefaultStatusCodeResponse = { + content:Pet[]; + + } + + type FindPetsByStatusStatusCode400Response = { + content:string; + + } + type FindPetsByStatusResult = FindPetsByStatusDefaultStatusCode of FindPetsByStatusDefaultStatusCodeResponse|FindPetsByStatusStatusCode400 of FindPetsByStatusStatusCode400Response + + type FindPetsByStatusArgs = { + queryParams:Result; + } + + //#region Query parameters + [] + type FindPetsByTagsQueryParams = { + tags : string[] ; + + } + //#endregion + + + type FindPetsByTagsDefaultStatusCodeResponse = { + content:Pet[]; + + } + + type FindPetsByTagsStatusCode400Response = { + content:string; + + } + type FindPetsByTagsResult = FindPetsByTagsDefaultStatusCode of FindPetsByTagsDefaultStatusCodeResponse|FindPetsByTagsStatusCode400 of FindPetsByTagsStatusCode400Response + + type FindPetsByTagsArgs = { + queryParams:Result; + } + //#region Path parameters + [] + type GetPetByIdPathParams = { + petId : int64 ; + } + //#endregion + + + type GetPetByIdDefaultStatusCodeResponse = { + content:Pet; + + } + + type GetPetByIdStatusCode400Response = { + content:string; + + } + + type GetPetByIdStatusCode404Response = { + content:string; + + } + type GetPetByIdResult = GetPetByIdDefaultStatusCode of GetPetByIdDefaultStatusCodeResponse|GetPetByIdStatusCode400 of GetPetByIdStatusCode400Response|GetPetByIdStatusCode404 of GetPetByIdStatusCode404Response + + type GetPetByIdArgs = { + pathParams:GetPetByIdPathParams; + } + + //#region Body parameters + [] + type UpdatePetBodyParams = Pet + //#endregion + + + type UpdatePetStatusCode400Response = { + content:string; + + } + + type UpdatePetStatusCode404Response = { + content:string; + + } + + type UpdatePetStatusCode405Response = { + content:string; + + } + type UpdatePetResult = UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response + + type UpdatePetArgs = { + bodyParams:UpdatePetBodyParams + } + //#region Path parameters + [] + type UpdatePetWithFormPathParams = { + petId : int64 ; + } + //#endregion + + //#region Form parameters + [] + type UpdatePetWithFormFormParams = { + name : string option; + //#endregion + + //#region Form parameters + status : string option; + } + //#endregion + + + type UpdatePetWithFormStatusCode405Response = { + content:string; + + } + type UpdatePetWithFormResult = UpdatePetWithFormStatusCode405 of UpdatePetWithFormStatusCode405Response + + type UpdatePetWithFormArgs = { + pathParams:UpdatePetWithFormPathParams; + formParams:Result + } + //#region Path parameters + [] + type UploadFilePathParams = { + petId : int64 ; + } + //#endregion + + //#region Form parameters + [] + type UploadFileFormParams = { + additionalMetadata : string option; + //#endregion + + //#region Form parameters + file : System.IO.Stream option; + } + //#endregion + + + type UploadFileDefaultStatusCodeResponse = { + content:ApiResponse; + + } + type UploadFileResult = UploadFileDefaultStatusCode of UploadFileDefaultStatusCodeResponse + + type UploadFileArgs = { + pathParams:UploadFilePathParams; + formParams:Result + } + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiServiceInterface.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiServiceInterface.fs new file mode 100644 index 000000000000..d30fe21fff5d --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/PetApiServiceInterface.fs @@ -0,0 +1,19 @@ +namespace OpenAPI +open PetApiHandlerParams +open System +open Microsoft.AspNetCore.Http + + +module PetApiServiceInterface = + + //#region Service interface + type IPetApiService = + abstract member AddPet : AddPetBodyParams -> AddPetResult + abstract member DeletePet : unit -> DeletePetResult + abstract member FindPetsByStatus : unit -> FindPetsByStatusResult + abstract member FindPetsByTags : unit -> FindPetsByTagsResult + abstract member GetPetById : unit -> GetPetByIdResult + abstract member UpdatePet : UpdatePetBodyParams -> UpdatePetResult + abstract member UpdatePetWithForm : unit -> UpdatePetWithFormResult + abstract member UploadFile : unit -> UploadFileResult + //#endregion \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiHandler.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiHandler.fs new file mode 100644 index 000000000000..82c9a05e19ff --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiHandler.fs @@ -0,0 +1,110 @@ +namespace OpenAPI + +open StoreApiHandlerParams +open StoreApiServiceImplementation +open Microsoft.AspNetCore.Mvc +open Microsoft.AspNetCore.Http +open Newtonsoft.Json +open Microsoft.Azure.WebJobs +open System.IO + +module StoreApiHandlers = + + /// + /// + /// + + //#region DeleteOrder + /// + /// Delete purchase order by ID + /// + [] + let DeleteOrder + ([] + req:HttpRequest ) = + + let result = StoreApiService.DeleteOrder () + match result with + | DeleteOrderStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | DeleteOrderStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + + //#region GetInventory + /// + /// Returns pet inventories by status + /// + [] + let GetInventory + ([] + req:HttpRequest ) = + + let result = StoreApiService.GetInventory () + match result with + | GetInventoryDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + + //#region GetOrderById + /// + /// Find purchase order by ID + /// + [] + let GetOrderById + ([] + req:HttpRequest ) = + + let result = StoreApiService.GetOrderById () + match result with + | GetOrderByIdDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | GetOrderByIdStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | GetOrderByIdStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + + //#region PlaceOrder + /// + /// Place an order for a pet + /// + [] + let PlaceOrder + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = [] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = StoreApiService.PlaceOrder bodyParams + match result with + | PlaceOrderDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | PlaceOrderStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + + + + diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiHandlerParams.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiHandlerParams.fs new file mode 100644 index 000000000000..2c9226f8abfe --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiHandlerParams.fs @@ -0,0 +1,88 @@ +namespace OpenAPI + +open System.Collections.Generic +open OpenAPI.Model.Order +open System.Collections.Generic +open System + +module StoreApiHandlerParams = + + //#region Path parameters + [] + type DeleteOrderPathParams = { + orderId : string ; + } + //#endregion + + + type DeleteOrderStatusCode400Response = { + content:string; + + } + + type DeleteOrderStatusCode404Response = { + content:string; + + } + type DeleteOrderResult = DeleteOrderStatusCode400 of DeleteOrderStatusCode400Response|DeleteOrderStatusCode404 of DeleteOrderStatusCode404Response + + type DeleteOrderArgs = { + pathParams:DeleteOrderPathParams; + } + + + type GetInventoryDefaultStatusCodeResponse = { + content:IDictionary; + + } + type GetInventoryResult = GetInventoryDefaultStatusCode of GetInventoryDefaultStatusCodeResponse + + //#region Path parameters + [] + type GetOrderByIdPathParams = { + orderId : int64 ; + } + //#endregion + + + type GetOrderByIdDefaultStatusCodeResponse = { + content:Order; + + } + + type GetOrderByIdStatusCode400Response = { + content:string; + + } + + type GetOrderByIdStatusCode404Response = { + content:string; + + } + type GetOrderByIdResult = GetOrderByIdDefaultStatusCode of GetOrderByIdDefaultStatusCodeResponse|GetOrderByIdStatusCode400 of GetOrderByIdStatusCode400Response|GetOrderByIdStatusCode404 of GetOrderByIdStatusCode404Response + + type GetOrderByIdArgs = { + pathParams:GetOrderByIdPathParams; + } + + //#region Body parameters + [] + type PlaceOrderBodyParams = Order + //#endregion + + + type PlaceOrderDefaultStatusCodeResponse = { + content:Order; + + } + + type PlaceOrderStatusCode400Response = { + content:string; + + } + type PlaceOrderResult = PlaceOrderDefaultStatusCode of PlaceOrderDefaultStatusCodeResponse|PlaceOrderStatusCode400 of PlaceOrderStatusCode400Response + + type PlaceOrderArgs = { + bodyParams:PlaceOrderBodyParams + } + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiServiceInterface.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiServiceInterface.fs new file mode 100644 index 000000000000..0e8e072b8b53 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/StoreApiServiceInterface.fs @@ -0,0 +1,15 @@ +namespace OpenAPI +open StoreApiHandlerParams +open System +open Microsoft.AspNetCore.Http + + +module StoreApiServiceInterface = + + //#region Service interface + type IStoreApiService = + abstract member DeleteOrder : unit -> DeleteOrderResult + abstract member GetInventory : unit -> GetInventoryResult + abstract member GetOrderById : unit -> GetOrderByIdResult + abstract member PlaceOrder : PlaceOrderBodyParams -> PlaceOrderResult + //#endregion \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiHandler.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiHandler.fs new file mode 100644 index 000000000000..35f1ddf71570 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiHandler.fs @@ -0,0 +1,211 @@ +namespace OpenAPI + +open UserApiHandlerParams +open UserApiServiceImplementation +open Microsoft.AspNetCore.Mvc +open Microsoft.AspNetCore.Http +open Newtonsoft.Json +open Microsoft.Azure.WebJobs +open System.IO + +module UserApiHandlers = + + /// + /// + /// + + //#region CreateUser + /// + /// Create user + /// + [] + let CreateUser + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = [] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = UserApiService.CreateUser bodyParams + match result with + | CreateUserDefaultStatusCode resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(0)) + + //#region CreateUsersWithArrayInput + /// + /// Creates list of users with given input array + /// + [] + let CreateUsersWithArrayInput + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = [] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = UserApiService.CreateUsersWithArrayInput bodyParams + match result with + | CreateUsersWithArrayInputDefaultStatusCode resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(0)) + + //#region CreateUsersWithListInput + /// + /// Creates list of users with given input array + /// + [] + let CreateUsersWithListInput + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = [] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = UserApiService.CreateUsersWithListInput bodyParams + match result with + | CreateUsersWithListInputDefaultStatusCode resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(0)) + + //#region DeleteUser + /// + /// Delete user + /// + [] + let DeleteUser + ([] + req:HttpRequest ) = + + let result = UserApiService.DeleteUser () + match result with + | DeleteUserStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | DeleteUserStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + + //#region GetUserByName + /// + /// Get user by user name + /// + [] + let GetUserByName + ([] + req:HttpRequest ) = + + let result = UserApiService.GetUserByName () + match result with + | GetUserByNameDefaultStatusCode resolved -> + let content = JsonConvert.SerializeObject resolved.content + let responseContentType = "application/json" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | GetUserByNameStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | GetUserByNameStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + + //#region LoginUser + /// + /// Logs user into the system + /// + [] + let LoginUser + ([] + req:HttpRequest ) = + + let result = UserApiService.LoginUser () + match result with + | LoginUserDefaultStatusCode resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(200)) + | LoginUserStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + + //#region LogoutUser + /// + /// Logs out current logged in user session + /// + [] + let LogoutUser + ([] + req:HttpRequest ) = + + let result = UserApiService.LogoutUser () + match result with + | LogoutUserDefaultStatusCode resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(0)) + + //#region UpdateUser + /// + /// Updated user + /// + [] + let UpdateUser + ([] + req:HttpRequest ) = + + use reader = StreamReader(req.Body) + + let mediaTypes = [] // currently unused + + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject + | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) + + let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let result = UserApiService.UpdateUser bodyParams + match result with + | UpdateUserStatusCode400 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(400)) + | UpdateUserStatusCode404 resolved -> + let content = resolved.content + let responseContentType = "text/plain" + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable(404)) + + + + diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiHandlerParams.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiHandlerParams.fs new file mode 100644 index 000000000000..42c51c93a664 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiHandlerParams.fs @@ -0,0 +1,169 @@ +namespace OpenAPI + +open OpenAPI.Model.User +open System.Collections.Generic +open System + +module UserApiHandlerParams = + + + //#region Body parameters + [] + type CreateUserBodyParams = User + //#endregion + + + type CreateUserDefaultStatusCodeResponse = { + content:string; + + } + type CreateUserResult = CreateUserDefaultStatusCode of CreateUserDefaultStatusCodeResponse + + type CreateUserArgs = { + bodyParams:CreateUserBodyParams + } + + //#region Body parameters + [] + type CreateUsersWithArrayInputBodyParams = User[] + //#endregion + + + type CreateUsersWithArrayInputDefaultStatusCodeResponse = { + content:string; + + } + type CreateUsersWithArrayInputResult = CreateUsersWithArrayInputDefaultStatusCode of CreateUsersWithArrayInputDefaultStatusCodeResponse + + type CreateUsersWithArrayInputArgs = { + bodyParams:CreateUsersWithArrayInputBodyParams + } + + //#region Body parameters + [] + type CreateUsersWithListInputBodyParams = User[] + //#endregion + + + type CreateUsersWithListInputDefaultStatusCodeResponse = { + content:string; + + } + type CreateUsersWithListInputResult = CreateUsersWithListInputDefaultStatusCode of CreateUsersWithListInputDefaultStatusCodeResponse + + type CreateUsersWithListInputArgs = { + bodyParams:CreateUsersWithListInputBodyParams + } + //#region Path parameters + [] + type DeleteUserPathParams = { + username : string ; + } + //#endregion + + + type DeleteUserStatusCode400Response = { + content:string; + + } + + type DeleteUserStatusCode404Response = { + content:string; + + } + type DeleteUserResult = DeleteUserStatusCode400 of DeleteUserStatusCode400Response|DeleteUserStatusCode404 of DeleteUserStatusCode404Response + + type DeleteUserArgs = { + pathParams:DeleteUserPathParams; + } + //#region Path parameters + [] + type GetUserByNamePathParams = { + username : string ; + } + //#endregion + + + type GetUserByNameDefaultStatusCodeResponse = { + content:User; + + } + + type GetUserByNameStatusCode400Response = { + content:string; + + } + + type GetUserByNameStatusCode404Response = { + content:string; + + } + type GetUserByNameResult = GetUserByNameDefaultStatusCode of GetUserByNameDefaultStatusCodeResponse|GetUserByNameStatusCode400 of GetUserByNameStatusCode400Response|GetUserByNameStatusCode404 of GetUserByNameStatusCode404Response + + type GetUserByNameArgs = { + pathParams:GetUserByNamePathParams; + } + + //#region Query parameters + [] + type LoginUserQueryParams = { + username : string ; + + + password : string ; + + } + //#endregion + + + type LoginUserDefaultStatusCodeResponse = { + content:string; + + } + + type LoginUserStatusCode400Response = { + content:string; + + } + type LoginUserResult = LoginUserDefaultStatusCode of LoginUserDefaultStatusCodeResponse|LoginUserStatusCode400 of LoginUserStatusCode400Response + + type LoginUserArgs = { + queryParams:Result; + } + + + type LogoutUserDefaultStatusCodeResponse = { + content:string; + + } + type LogoutUserResult = LogoutUserDefaultStatusCode of LogoutUserDefaultStatusCodeResponse + + //#region Path parameters + [] + type UpdateUserPathParams = { + username : string ; + } + //#endregion + + //#region Body parameters + [] + type UpdateUserBodyParams = User + //#endregion + + + type UpdateUserStatusCode400Response = { + content:string; + + } + + type UpdateUserStatusCode404Response = { + content:string; + + } + type UpdateUserResult = UpdateUserStatusCode400 of UpdateUserStatusCode400Response|UpdateUserStatusCode404 of UpdateUserStatusCode404Response + + type UpdateUserArgs = { + pathParams:UpdateUserPathParams; + bodyParams:UpdateUserBodyParams + } + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiServiceInterface.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiServiceInterface.fs new file mode 100644 index 000000000000..d1aefa1cfb95 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/api/UserApiServiceInterface.fs @@ -0,0 +1,19 @@ +namespace OpenAPI +open UserApiHandlerParams +open System +open Microsoft.AspNetCore.Http + + +module UserApiServiceInterface = + + //#region Service interface + type IUserApiService = + abstract member CreateUser : CreateUserBodyParams -> CreateUserResult + abstract member CreateUsersWithArrayInput : CreateUsersWithArrayInputBodyParams -> CreateUsersWithArrayInputResult + abstract member CreateUsersWithListInput : CreateUsersWithListInputBodyParams -> CreateUsersWithListInputResult + abstract member DeleteUser : unit -> DeleteUserResult + abstract member GetUserByName : unit -> GetUserByNameResult + abstract member LoginUser : unit -> LoginUserResult + abstract member LogoutUser : unit -> LogoutUserResult + abstract member UpdateUser : UpdateUserBodyParams -> UpdateUserResult + //#endregion \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/PetApiService.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/PetApiService.fs new file mode 100644 index 000000000000..913aff5bc1ff --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/PetApiService.fs @@ -0,0 +1,71 @@ +namespace OpenAPI +open OpenAPI.Model.ApiResponse +open OpenAPI.Model.Pet +open PetApiHandlerParams +open PetApiServiceInterface +open System.Collections.Generic +open System + +module PetApiServiceImplementation = + + //#region Service implementation + type PetApiServiceImpl() = + interface IPetApiService with + + member this.AddPet (parameters:AddPetBodyParams) = + let content = "Invalid input" + AddPetStatusCode405 { content = content } + + member this.DeletePet () = + let content = "Invalid pet value" + DeletePetStatusCode400 { content = content } + + member this.FindPetsByStatus () = + if true then + let content = "successful operation" :> obj :?> Pet[] // this cast is obviously wrong, and is only intended to allow generated project to compile + FindPetsByStatusDefaultStatusCode { content = content } + else + let content = "Invalid status value" + FindPetsByStatusStatusCode400 { content = content } + + member this.FindPetsByTags () = + if true then + let content = "successful operation" :> obj :?> Pet[] // this cast is obviously wrong, and is only intended to allow generated project to compile + FindPetsByTagsDefaultStatusCode { content = content } + else + let content = "Invalid tag value" + FindPetsByTagsStatusCode400 { content = content } + + member this.GetPetById () = + if true then + let content = "successful operation" :> obj :?> Pet // this cast is obviously wrong, and is only intended to allow generated project to compile + GetPetByIdDefaultStatusCode { content = content } + else if true then + let content = "Invalid ID supplied" + GetPetByIdStatusCode400 { content = content } + else + let content = "Pet not found" + GetPetByIdStatusCode404 { content = content } + + member this.UpdatePet (parameters:UpdatePetBodyParams) = + if true then + let content = "Invalid ID supplied" + UpdatePetStatusCode400 { content = content } + else if true then + let content = "Pet not found" + UpdatePetStatusCode404 { content = content } + else + let content = "Validation exception" + UpdatePetStatusCode405 { content = content } + + member this.UpdatePetWithForm () = + let content = "Invalid input" + UpdatePetWithFormStatusCode405 { content = content } + + member this.UploadFile () = + let content = "successful operation" :> obj :?> ApiResponse // this cast is obviously wrong, and is only intended to allow generated project to compile + UploadFileDefaultStatusCode { content = content } + + //#endregion + + let PetApiService = PetApiServiceImpl() :> IPetApiService \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/StoreApiService.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/StoreApiService.fs new file mode 100644 index 000000000000..13ea7dde1501 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/StoreApiService.fs @@ -0,0 +1,48 @@ +namespace OpenAPI +open System.Collections.Generic +open OpenAPI.Model.Order +open StoreApiHandlerParams +open StoreApiServiceInterface +open System.Collections.Generic +open System + +module StoreApiServiceImplementation = + + //#region Service implementation + type StoreApiServiceImpl() = + interface IStoreApiService with + + member this.DeleteOrder () = + if true then + let content = "Invalid ID supplied" + DeleteOrderStatusCode400 { content = content } + else + let content = "Order not found" + DeleteOrderStatusCode404 { content = content } + + member this.GetInventory () = + let content = "successful operation" :> obj :?> IDictionary // this cast is obviously wrong, and is only intended to allow generated project to compile + GetInventoryDefaultStatusCode { content = content } + + member this.GetOrderById () = + if true then + let content = "successful operation" :> obj :?> Order // this cast is obviously wrong, and is only intended to allow generated project to compile + GetOrderByIdDefaultStatusCode { content = content } + else if true then + let content = "Invalid ID supplied" + GetOrderByIdStatusCode400 { content = content } + else + let content = "Order not found" + GetOrderByIdStatusCode404 { content = content } + + member this.PlaceOrder (parameters:PlaceOrderBodyParams) = + if true then + let content = "successful operation" :> obj :?> Order // this cast is obviously wrong, and is only intended to allow generated project to compile + PlaceOrderDefaultStatusCode { content = content } + else + let content = "Invalid Order" + PlaceOrderStatusCode400 { content = content } + + //#endregion + + let StoreApiService = StoreApiServiceImpl() :> IStoreApiService \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/UserApiService.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/UserApiService.fs new file mode 100644 index 000000000000..63d1bfcd1369 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/impl/UserApiService.fs @@ -0,0 +1,67 @@ +namespace OpenAPI +open OpenAPI.Model.User +open UserApiHandlerParams +open UserApiServiceInterface +open System.Collections.Generic +open System + +module UserApiServiceImplementation = + + //#region Service implementation + type UserApiServiceImpl() = + interface IUserApiService with + + member this.CreateUser (parameters:CreateUserBodyParams) = + let content = "successful operation" + CreateUserDefaultStatusCode { content = content } + + member this.CreateUsersWithArrayInput (parameters:CreateUsersWithArrayInputBodyParams) = + let content = "successful operation" + CreateUsersWithArrayInputDefaultStatusCode { content = content } + + member this.CreateUsersWithListInput (parameters:CreateUsersWithListInputBodyParams) = + let content = "successful operation" + CreateUsersWithListInputDefaultStatusCode { content = content } + + member this.DeleteUser () = + if true then + let content = "Invalid username supplied" + DeleteUserStatusCode400 { content = content } + else + let content = "User not found" + DeleteUserStatusCode404 { content = content } + + member this.GetUserByName () = + if true then + let content = "successful operation" :> obj :?> User // this cast is obviously wrong, and is only intended to allow generated project to compile + GetUserByNameDefaultStatusCode { content = content } + else if true then + let content = "Invalid username supplied" + GetUserByNameStatusCode400 { content = content } + else + let content = "User not found" + GetUserByNameStatusCode404 { content = content } + + member this.LoginUser () = + if true then + let content = "successful operation" :> obj :?> string // this cast is obviously wrong, and is only intended to allow generated project to compile + LoginUserDefaultStatusCode { content = content } + else + let content = "Invalid username/password supplied" + LoginUserStatusCode400 { content = content } + + member this.LogoutUser () = + let content = "successful operation" + LogoutUserDefaultStatusCode { content = content } + + member this.UpdateUser (parameters:UpdateUserBodyParams) = + if true then + let content = "Invalid user supplied" + UpdateUserStatusCode400 { content = content } + else + let content = "User not found" + UpdateUserStatusCode404 { content = content } + + //#endregion + + let UserApiService = UserApiServiceImpl() :> IUserApiService \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/model/ApiResponse.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/ApiResponse.fs new file mode 100644 index 000000000000..aed7bd6288fb --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/ApiResponse.fs @@ -0,0 +1,22 @@ +namespace OpenAPI.Model + +open System +open System.Collections.Generic +open Newtonsoft.Json + +module ApiResponse = + + //#region ApiResponse + + [] + type ApiResponse = { + [] + Code : int; + [] + Type : string; + [] + Message : string; + } + + //#endregion + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Category.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Category.fs new file mode 100644 index 000000000000..866d74e8d9e9 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Category.fs @@ -0,0 +1,20 @@ +namespace OpenAPI.Model + +open System +open System.Collections.Generic +open Newtonsoft.Json + +module Category = + + //#region Category + + [] + type Category = { + [] + Id : int64; + [] + Name : string; + } + + //#endregion + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Order.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Order.fs new file mode 100644 index 000000000000..8d5c9f769b17 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Order.fs @@ -0,0 +1,28 @@ +namespace OpenAPI.Model + +open System +open System.Collections.Generic +open Newtonsoft.Json + +module Order = + + //#region Order + + [] + type Order = { + [] + Id : int64; + [] + PetId : int64; + [] + Quantity : int; + [] + ShipDate : Nullable; + [] + Status : string; + [] + Complete : bool; + } + + //#endregion + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Pet.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Pet.fs new file mode 100644 index 000000000000..0917e14410f6 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Pet.fs @@ -0,0 +1,30 @@ +namespace OpenAPI.Model + +open System +open System.Collections.Generic +open Newtonsoft.Json +open OpenAPI.Model.Category +open OpenAPI.Model.Tag + +module Pet = + + //#region Pet + + [] + type Pet = { + [] + Id : int64; + [] + Category : Category; + [] + Name : string; + [] + PhotoUrls : string[]; + [] + Tags : Tag[]; + [] + Status : string; + } + + //#endregion + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Tag.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Tag.fs new file mode 100644 index 000000000000..3e4e1996b3ed --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/Tag.fs @@ -0,0 +1,20 @@ +namespace OpenAPI.Model + +open System +open System.Collections.Generic +open Newtonsoft.Json + +module Tag = + + //#region Tag + + [] + type Tag = { + [] + Id : int64; + [] + Name : string; + } + + //#endregion + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/OpenAPI/src/model/User.fs b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/User.fs new file mode 100644 index 000000000000..4c77e4c8a547 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/OpenAPI/src/model/User.fs @@ -0,0 +1,32 @@ +namespace OpenAPI.Model + +open System +open System.Collections.Generic +open Newtonsoft.Json + +module User = + + //#region User + + [] + type User = { + [] + Id : int64; + [] + Username : string; + [] + FirstName : string; + [] + LastName : string; + [] + Email : string; + [] + Password : string; + [] + Phone : string; + [] + UserStatus : int; + } + + //#endregion + \ No newline at end of file diff --git a/samples/server/petstore/fsharp-functions/host.json b/samples/server/petstore/fsharp-functions/host.json new file mode 100644 index 000000000000..ccd1678a5e12 --- /dev/null +++ b/samples/server/petstore/fsharp-functions/host.json @@ -0,0 +1,8 @@ +{ + "version": "2.0", + "extensions":{ + "http": { + "routePrefix": "" + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION index afa636560641..0e97bd19efbf 100644 --- a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/PetApiTests.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/PetApiTests.fs index 8408a25602ee..aec008210d56 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/PetApiTests.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/PetApiTests.fs @@ -106,7 +106,7 @@ module PetApiHandlerTests = // add your setup code here - let path = "/v2/pet/findByTags" + "?tags=ADDME&maxCount=ADDME" + let path = "/v2/pet/findByTags" + "?tags=ADDME" HttpGet client path |> isStatus (enum(200)) @@ -123,7 +123,7 @@ module PetApiHandlerTests = // add your setup code here - let path = "/v2/pet/findByTags" + "?tags=ADDME&maxCount=ADDME" + let path = "/v2/pet/findByTags" + "?tags=ADDME" HttpGet client path |> isStatus (enum(400)) diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/UserApiTestsHelper.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/UserApiTestsHelper.fs index 352c553e0c02..fca7987ef4c8 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/UserApiTestsHelper.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI.Tests/UserApiTestsHelper.fs @@ -40,8 +40,17 @@ module UserApiHandlerTestsHelper = let mutable CreateUsersWithArrayInputExamples = Map.empty let mutable CreateUsersWithArrayInputBody = "" - CreateUsersWithArrayInputBody <- WebUtility.HtmlDecode "" - CreateUsersWithArrayInputExamples <- CreateUsersWithArrayInputExamples.Add("", CreateUsersWithArrayInputBody) + CreateUsersWithArrayInputBody <- WebUtility.HtmlDecode "{ + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +}" + CreateUsersWithArrayInputExamples <- CreateUsersWithArrayInputExamples.Add("application/json", CreateUsersWithArrayInputBody) let getCreateUsersWithArrayInputExample mediaType = CreateUsersWithArrayInputExamples.[mediaType] @@ -50,8 +59,17 @@ module UserApiHandlerTestsHelper = let mutable CreateUsersWithListInputExamples = Map.empty let mutable CreateUsersWithListInputBody = "" - CreateUsersWithListInputBody <- WebUtility.HtmlDecode "" - CreateUsersWithListInputExamples <- CreateUsersWithListInputExamples.Add("", CreateUsersWithListInputBody) + CreateUsersWithListInputBody <- WebUtility.HtmlDecode "{ + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +}" + CreateUsersWithListInputExamples <- CreateUsersWithListInputExamples.Add("application/json", CreateUsersWithListInputBody) let getCreateUsersWithListInputExample mediaType = CreateUsersWithListInputExamples.[mediaType] diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md b/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md index 42731ee69c65..c529ef85cdd8 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/README.md @@ -6,7 +6,6 @@ A [Giraffe](https://github.com/giraffe-fsharp/Giraffe) server stub for the OpenA The following models have been auto-generated from the provided OpenAPI schema: -- model/ApiResponseModel.fs - model/UserModel.fs - model/TagModel.fs - model/CategoryModel.fs @@ -14,6 +13,7 @@ The following models have been auto-generated from the provided OpenAPI schema: - model/InlineObject1Model.fs - model/InlineObjectModel.fs - model/PetModel.fs +- model/ApiResponseModel.fs ## Operations diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj index a5d1a1bebb10..4b31d698ba33 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/OpenAPI.fsproj @@ -21,7 +21,6 @@ - @@ -29,6 +28,7 @@ + diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs index 6bc290e74a7a..f84ffb76b22c 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs @@ -78,9 +78,6 @@ module PetApiHandlerParams = type FindPetsByTagsQueryParams = { tags : string[] ; - - maxCount : int option; - } //#endregion 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 2f81801b7943..0e97bd19efbf 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 @@ -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/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.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/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java index d632341919db..52732fb652b8 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java @@ -230,6 +230,22 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param,param2); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("pipe") List pipe +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("http") List http +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("url") List url +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("context") List context +) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe,ioutil,http,url,context); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java index 848b5ac67bdf..2414c140c2f7 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java @@ -79,6 +79,12 @@ public abstract Response testInlineAdditionalProperties(Map para ) throws NotFoundException; public abstract Response testJsonFormData(String param ,String param2 + ) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat(List pipe + ,List ioutil + ,List http + ,List url + ,List context ) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId ,InputStream requiredFileInputStream, FileInfo requiredFileDetail diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 1c30280471c1..96555d52a2ca 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -40,13 +40,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 4e05197cd03a..c5c14ad580d1 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -14,7 +14,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") private List files = null; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java index 639755078497..4a45c8ddac2a 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,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-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java index 361e34961a09..11b068f543a2 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -20,6 +20,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -65,6 +68,24 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -136,6 +157,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -143,7 +165,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -153,6 +175,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 3bd65b6d0d4e..bbf37cfaaab9 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -128,6 +128,16 @@ public Response testInlineAdditionalProperties(Map param @Override public Response testJsonFormData(String param , String param2 + ) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response testQueryParameterCollectionFormat(List pipe +, List ioutil +, List http +, List url +, List context ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); 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 dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-api-package-override/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java index 7932fea7b2af..253f6e33751c 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java index 2eb66e8fbb9b..8b6dde9c2d15 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java index 19b38fe2142a..39679e11f45c 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java index 2aaae94f8dfd..225d3009543f 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java index 4166031e9082..fe2cf4f6808e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java index 387836d83804..4f2aadae998c 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java index 8190c6f6f6a2..5e103c7eeb6f 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java index 85a70248c4ad..d53c2a82c11d 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java index d103affead0d..4904073cbc2e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json +++ b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-async/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java index 0dd34c6888f2..1344ffe7afb1 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java @@ -17,9 +17,6 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -41,25 +38,23 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction - public CompletionStage addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + public Result addPet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.addPet(pet) - return ok(); - }); + imp.addPet(body); + return ok(); } @ApiAction - public CompletionStage deletePet(Long petId) throws Exception { + public Result deletePet(Long petId) throws Exception { String valueapiKey = request().getHeader("api_key"); String apiKey; if (valueapiKey != null) { @@ -67,14 +62,12 @@ public CompletionStage deletePet(Long petId) throws Exception { } else { apiKey = null; } - return CompletableFuture.supplyAsync(() -> { - imp.deletePet(petId, apiKey) - return ok(); - }); + imp.deletePet(petId, apiKey); + return ok(); } @ApiAction - public CompletionStage findPetsByStatus() throws Exception { + public Result findPetsByStatus() throws Exception { String[] statusArray = request().queryString().get("status"); if (statusArray == null) { throw new IllegalArgumentException("'status' parameter is required"); @@ -87,22 +80,18 @@ public CompletionStage findPetsByStatus() throws Exception { status.add(curParam); } } - CompletionStage> stage = imp.findPetsByStatus(status).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); - } + List obj = imp.findPetsByStatus(status); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage findPetsByTags() throws Exception { + public Result findPetsByTags() throws Exception { String[] tagsArray = request().queryString().get("tags"); if (tagsArray == null) { throw new IllegalArgumentException("'tags' parameter is required"); @@ -115,93 +104,77 @@ public CompletionStage findPetsByTags() throws Exception { tags.add(curParam); } } - CompletionStage> stage = imp.findPetsByTags(tags).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); - } + List obj = imp.findPetsByTags(tags); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage getPetById(Long petId) throws Exception { - CompletionStage stage = imp.getPetById(petId).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getPetById(Long petId) throws Exception { + Pet obj = imp.getPetById(petId); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + public Result updatePet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.updatePet(pet) - return ok(); - }); + imp.updatePet(body); + return ok(); } @ApiAction - public CompletionStage updatePetWithForm(Long petId) throws Exception { + public Result updatePetWithForm(Long petId) throws Exception { String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; String name; if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } - return CompletableFuture.supplyAsync(() -> { - imp.updatePetWithForm(petId, name, status) - return ok(); - }); + imp.updatePetWithForm(petId, name, status); + return ok(); } @ApiAction - public CompletionStage uploadFile(Long petId) throws Exception { + public Result uploadFile(Long petId) throws Exception { String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - CompletionStage stage = imp.uploadFile(petId, additionalMetadata, file).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java index a0cb57281b9c..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -23,31 +23,25 @@ public void deletePet(Long petId, String apiKey) throws Exception { } @Override - public CompletionStage> findPetsByStatus( @NotNull List status) throws Exception { + public List findPetsByStatus( @NotNull List status) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ArrayList(); - }); + return new ArrayList(); } @Override - public CompletionStage> findPetsByTags( @NotNull List tags) throws Exception { + public List findPetsByTags( @NotNull List tags) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ArrayList(); - }); + return new ArrayList(); } @Override - public CompletionStage getPetById(Long petId) throws Exception { + public Pet getPetById(Long petId) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Pet(); - }); + return new Pet(); } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } @@ -57,11 +51,9 @@ public void updatePetWithForm(Long petId, String name, String status) throws Exc } @Override - public CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ModelApiResponse(); - }); + return new ModelApiResponse(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java index 64b60d9ab75e..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java @@ -8,27 +8,25 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; - CompletionStage> findPetsByStatus( @NotNull List status) throws Exception; + List findPetsByStatus( @NotNull List status) throws Exception; - CompletionStage> findPetsByTags( @NotNull List tags) throws Exception; + List findPetsByTags( @NotNull List tags) throws Exception; - CompletionStage getPetById(Long petId) throws Exception; + Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; - CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; + ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java index 9c112f2e9d62..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java @@ -16,9 +16,6 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -40,59 +37,45 @@ private StoreApiController(Configuration configuration, StoreApiControllerImpInt @ApiAction - public CompletionStage deleteOrder(String orderId) throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.deleteOrder(orderId) - return ok(); - }); + public Result deleteOrder(String orderId) throws Exception { + imp.deleteOrder(orderId); + return ok(); } @ApiAction - public CompletionStage getInventory() throws Exception { - CompletionStage> stage = imp.getInventory().thenApply(obj -> { - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getInventory() throws Exception { + Map obj = imp.getInventory(); + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { - CompletionStage stage = imp.getOrderById(orderId).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + Order obj = imp.getOrderById(orderId); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + public Result placeOrder() throws Exception { + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - CompletionStage stage = imp.placeOrder(order).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + Order obj = imp.placeOrder(body); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java index adcd9a11adc0..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java @@ -17,27 +17,21 @@ public void deleteOrder(String orderId) throws Exception { } @Override - public CompletionStage> getInventory() throws Exception { + public Map getInventory() throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new HashMap(); - }); + return new HashMap(); } @Override - public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Order(); - }); + return new Order(); } @Override - public CompletionStage placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Order(); - }); + return new Order(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java index 86fda5b54fb1..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java @@ -7,8 +7,6 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @@ -16,10 +14,10 @@ public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; - CompletionStage> getInventory() throws Exception; + Map getInventory() throws Exception; - CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; + Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - CompletionStage placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index 35c1134b0f41..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -16,9 +16,6 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -40,87 +37,75 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction - public CompletionStage createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + public Result createUser() throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUser(user) - return ok(); - }); + imp.createUser(body); + return ok(); } @ApiAction - public CompletionStage createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + public Result createUsersWithArrayInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUsersWithArrayInput(user) - return ok(); - }); + imp.createUsersWithArrayInput(body); + return ok(); } @ApiAction - public CompletionStage createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + public Result createUsersWithListInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUsersWithListInput(user) - return ok(); - }); + imp.createUsersWithListInput(body); + return ok(); } @ApiAction - public CompletionStage deleteUser(String username) throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.deleteUser(username) - return ok(); - }); + public Result deleteUser(String username) throws Exception { + imp.deleteUser(username); + return ok(); } @ApiAction - public CompletionStage getUserByName(String username) throws Exception { - CompletionStage stage = imp.getUserByName(username).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getUserByName(String username) throws Exception { + User obj = imp.getUserByName(username); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage loginUser() throws Exception { + public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; if (valueusername != null) { @@ -135,38 +120,30 @@ public CompletionStage loginUser() throws Exception { } else { throw new IllegalArgumentException("'password' parameter is required"); } - CompletionStage stage = imp.loginUser(username, password).thenApply(obj -> { - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + String obj = imp.loginUser(username, password); + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage logoutUser() throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.logoutUser() - return ok(); - }); + public Result logoutUser() throws Exception { + imp.logoutUser(); + return ok(); } @ApiAction - public CompletionStage updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + public Result updateUser(String username) throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.updateUser(username, user) - return ok(); - }); + imp.updateUser(username, body); + return ok(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index ebaae2d462bd..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -32,19 +32,15 @@ public void deleteUser(String username) throws Exception { } @Override - public CompletionStage getUserByName(String username) throws Exception { + public User getUserByName(String username) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new User(); - }); + return new User(); } @Override - public CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception { + public String loginUser( @NotNull String username, @NotNull String password) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new String(); - }); + return new String(); } @Override @@ -53,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java index 62140ddabeae..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java @@ -7,27 +7,25 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; - CompletionStage getUserByName(String username) throws Exception; + User getUserByName(String username) throws Exception; - CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception; + String loginUser( @NotNull String username, @NotNull String password) throws Exception; void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-async/public/openapi.json b/samples/server/petstore/java-play-framework-async/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-async/public/openapi.json +++ b/samples/server/petstore/java-play-framework-async/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-controller-only/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java index 916fd313b613..c00e111435b5 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java @@ -37,15 +37,15 @@ private PetApiController(Configuration configuration) { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -103,15 +103,15 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -123,14 +123,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } return ok(); } @@ -142,7 +142,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); return ok(); diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java index 928173a5b557..c6b50d599729 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java @@ -51,15 +51,15 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 58bebfd7e1ef..9886a7b377a0 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -36,49 +36,49 @@ private UserApiController(Configuration configuration) { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -119,15 +119,15 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java new file mode 100644 index 000000000000..0d9f1a4dc74c --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesAnyType + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(name, additionalPropertiesAnyType.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java new file mode 100644 index 000000000000..0b169be3610d --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java @@ -0,0 +1,78 @@ +package apimodels; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesArray + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(name, additionalPropertiesArray.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java new file mode 100644 index 000000000000..7658378e516c --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesBoolean + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(name, additionalPropertiesBoolean.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java index 0d1d7a1fd98e..a41e1e9d2159 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package apimodels; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,61 +15,296 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; + @JsonProperty("map_string") + private Map mapString = null; - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; + @JsonProperty("map_number") + private Map mapNumber = null; - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + @JsonProperty("map_integer") + private Map mapInteger = null; + + @JsonProperty("map_boolean") + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1; + + @JsonProperty("anytype_2") + private Object anytype2; + + @JsonProperty("anytype_3") + private Object anytype3; + + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } - public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { - if (this.mapProperty == null) { - this.mapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); } - this.mapProperty.put(key, mapPropertyItem); + this.mapString.put(key, mapStringItem); return this; } /** - * Get mapProperty - * @return mapProperty + * Get mapString + * @return mapString **/ - public Map getMapProperty() { - return mapProperty; + public Map getMapString() { + return mapString; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setMapString(Map mapString) { + this.mapString = mapString; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } - public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { - if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); } - this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + this.mapNumber.put(key, mapNumberItem); + return this; + } + + /** + * Get mapNumber + * @return mapNumber + **/ + @Valid + public Map getMapNumber() { + return mapNumber; + } + + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + **/ + public Map getMapInteger() { + return mapInteger; + } + + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + **/ + public Map getMapBoolean() { + return mapBoolean; + } + + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + **/ + @Valid + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + **/ + @Valid + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + **/ + @Valid + public Map> getMapMapString() { + return mapMapString; + } + + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + **/ + @Valid + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @Valid + public Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + **/ + @Valid + public Object getAnytype2() { + return anytype2; + } + + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } /** - * Get mapOfMapProperty - * @return mapOfMapProperty + * Get anytype3 + * @return anytype3 **/ @Valid - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + public Object getAnytype3() { + return anytype3; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -81,13 +317,22 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapString, additionalPropertiesClass.mapString) && + Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @SuppressWarnings("StringBufferReplaceableByString") @@ -96,8 +341,17 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java new file mode 100644 index 000000000000..ed3671bfeeb0 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesInteger + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(name, additionalPropertiesInteger.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java new file mode 100644 index 000000000000..d3590987e618 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java @@ -0,0 +1,78 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesNumber + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(name, additionalPropertiesNumber.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java new file mode 100644 index 000000000000..5b27a250f255 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesObject + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(name, additionalPropertiesObject.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java new file mode 100644 index 000000000000..bbd9f6541420 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesString + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(name, additionalPropertiesString.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java index 2202fe1078e3..f79d687c4f98 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java @@ -14,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Animal { @JsonProperty("className") - private String className = null; + private String className; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java index f78ceeb9d0b2..cd5031205e81 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java @@ -12,22 +12,22 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel = null; + private String smallCamel; @JsonProperty("CapitalCamel") - private String capitalCamel = null; + private String capitalCamel; @JsonProperty("small_Snake") - private String smallSnake = null; + private String smallSnake; @JsonProperty("Capital_Snake") - private String capitalSnake = null; + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") - private String ATT_NAME = null; + private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java index 5e8dfb06c054..0c0aa9fd204a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.Animal; +import apimodels.CatAllOf; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -13,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed = null; + private Boolean declawed; public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java new file mode 100644 index 000000000000..04a1572284c8 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java @@ -0,0 +1,74 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * CatAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class CatAllOf { + @JsonProperty("declawed") + private Boolean declawed; + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java index c2a4222a8aa5..54b0afb8d7fe 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name = "default-name"; public Category id(Long id) { this.id = id; @@ -43,7 +43,8 @@ public Category name(String name) { * Get name * @return name **/ - public String getName() { + @NotNull + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java index ee8cd40ca40d..84a3fbddbf83 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ClassModel { @JsonProperty("_class") - private String propertyClass = null; + private String propertyClass; public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java index f14be52cf46e..90da55b8e99d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Client { @JsonProperty("client") - private String client = null; + private String client; public Client client(String client) { this.client = client; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java index 27e3f5fdb256..7e4fe30c682a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.Animal; +import apimodels.DogAllOf; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -13,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Dog extends Animal { @JsonProperty("breed") - private String breed = null; + private String breed; public Dog breed(String breed) { this.breed = breed; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java new file mode 100644 index 000000000000..c49367934f97 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java @@ -0,0 +1,74 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * DogAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class DogAllOf { + @JsonProperty("breed") + private String breed; + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java index 5f2c63d116d3..1c5806205d0e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java @@ -34,18 +34,18 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; + private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum @@ -68,13 +68,13 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java index c0f2b0ad97ee..647abcf53424 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java @@ -29,13 +29,13 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index 861a7e577770..9bafde9f409f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -35,18 +35,18 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_string") - private EnumStringEnum enumString = null; + private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired @@ -71,18 +71,18 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; + private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger @@ -105,18 +105,18 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; + private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber @@ -139,21 +139,21 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; + private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java index d01ed397a32e..839ab49292c6 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java @@ -14,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") private List files = null; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java index b16bbd537f4f..e01fd150a45f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java @@ -17,43 +17,43 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FormatTest { @JsonProperty("integer") - private Integer integer = null; + private Integer integer; @JsonProperty("int32") - private Integer int32 = null; + private Integer int32; @JsonProperty("int64") - private Long int64 = null; + private Long int64; @JsonProperty("number") - private BigDecimal number = null; + private BigDecimal number; @JsonProperty("float") - private Float _float = null; + private Float _float; @JsonProperty("double") - private Double _double = null; + private Double _double; @JsonProperty("string") - private String string = null; + private String string; @JsonProperty("byte") - private byte[] _byte = null; + private byte[] _byte; @JsonProperty("binary") - private InputStream binary = null; + private InputStream binary; @JsonProperty("date") - private LocalDate date = null; + private LocalDate date; @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; + private OffsetDateTime dateTime; @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("password") - private String password = null; + private String password; public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java index 17d09b40692f..20a101fd6b75 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("foo") - private String foo = null; + private String foo; public HasOnlyReadOnly bar(String bar) { this.bar = bar; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java index 5c1518d4cd3a..3b6a62bf3991 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java @@ -1,6 +1,5 @@ package apimodels; -import apimodels.StringBooleanMap; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,13 +38,13 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -56,7 +55,7 @@ public static InnerEnum fromValue(String text) { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -134,21 +133,28 @@ public void setDirectMap(Map directMap) { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java index e52678fa5c45..461c704af66c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,10 +18,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; + private OffsetDateTime dateTime; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java index b17e0ed8a79c..895a9578a350 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Model200Response { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("class") - private String propertyClass = null; + private String propertyClass; public Model200Response name(Integer name) { this.name = name; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java index a5505482e089..0a884c198159 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java index 89d3a0e25ffa..f92e2c16411f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelReturn { @JsonProperty("return") - private Integer _return = null; + private Integer _return; public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java index 7bfcff1e5be8..36d4fa5e5453 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java @@ -12,16 +12,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Name { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("snake_case") - private Integer snakeCase = null; + private Integer snakeCase; @JsonProperty("property") - private String property = null; + private String property; @JsonProperty("123Number") - private Integer _123number = null; + private Integer _123number; public Name name(Integer name) { this.name = name; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java index a54fece62687..0d35aae626b9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java @@ -13,7 +13,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber = null; + private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java index 404beae15bc2..fa71fb1d7ef7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java index 92a8ca4c95a3..22c5a23259f9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java @@ -13,13 +13,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber = null; + private BigDecimal myNumber; @JsonProperty("my_string") - private String myString = null; + private String myString; @JsonProperty("my_boolean") - private Boolean myBoolean = null; + private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java index f5026996917f..98cd7feae6a7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java @@ -29,13 +29,13 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index aaa139c566df..cf7ff2912d9e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java index 693aa7eba342..4457994d7ae1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ReadOnlyFirst { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("baz") - private String baz = null; + private String baz; public ReadOnlyFirst bar(String bar) { this.bar = bar; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java index b8f387377d0c..9b1f8f6ebe3d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName = null; + private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java index 5426c883569b..ae8f84e74bc8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java new file mode 100644 index 000000000000..a12511e94fd2 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java @@ -0,0 +1,176 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * TypeHolderDefault + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class TypeHolderDefault { + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList<>(); + + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull +@Valid + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(stringItem, typeHolderDefault.stringItem) && + Objects.equals(numberItem, typeHolderDefault.numberItem) && + Objects.equals(integerItem, typeHolderDefault.integerItem) && + Objects.equals(boolItem, typeHolderDefault.boolItem) && + Objects.equals(arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java new file mode 100644 index 000000000000..4d636ea7fbcc --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java @@ -0,0 +1,199 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * TypeHolderExample + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class TypeHolderExample { + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("float_item") + private Float floatItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList<>(); + + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull +@Valid + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(stringItem, typeHolderExample.stringItem) && + Objects.equals(numberItem, typeHolderExample.numberItem) && + Objects.equals(floatItem, typeHolderExample.floatItem) && + Objects.equals(integerItem, typeHolderExample.integerItem) && + Objects.equals(boolItem, typeHolderExample.boolItem) && + Objects.equals(arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java index 0308cc926812..91739a288c97 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java new file mode 100644 index 000000000000..6cf480a9e7ec --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java @@ -0,0 +1,770 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * XmlItem + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class XmlItem { + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + private List prefixNsWrappedArray = null; + + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + **/ + public String getAttributeString() { + return attributeString; + } + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + **/ + @Valid + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + **/ + public Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + **/ + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArray == null) { + wrappedArray = new ArrayList<>(); + } + wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + **/ + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + **/ + public String getNameString() { + return nameString; + } + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + **/ + @Valid + public BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + **/ + public Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + **/ + public Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (nameArray == null) { + nameArray = new ArrayList<>(); + } + nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + **/ + public List getNameArray() { + return nameArray; + } + + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArray == null) { + nameWrappedArray = new ArrayList<>(); + } + nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + **/ + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + **/ + public String getPrefixString() { + return prefixString; + } + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + **/ + @Valid + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + **/ + public Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + **/ + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (prefixArray == null) { + prefixArray = new ArrayList<>(); + } + prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + **/ + public List getPrefixArray() { + return prefixArray; + } + + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArray == null) { + prefixWrappedArray = new ArrayList<>(); + } + prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + **/ + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + **/ + public String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + **/ + @Valid + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + **/ + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + **/ + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArray == null) { + namespaceArray = new ArrayList<>(); + } + namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + **/ + public List getNamespaceArray() { + return namespaceArray; + } + + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArray == null) { + namespaceWrappedArray = new ArrayList<>(); + } + namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + **/ + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + **/ + public String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + **/ + @Valid + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + **/ + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + **/ + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArray == null) { + prefixNsArray = new ArrayList<>(); + } + prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + **/ + public List getPrefixNsArray() { + return prefixNsArray; + } + + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArray == null) { + prefixNsWrappedArray = new ArrayList<>(); + } + prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + **/ + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(attributeString, xmlItem.attributeString) && + Objects.equals(attributeNumber, xmlItem.attributeNumber) && + Objects.equals(attributeInteger, xmlItem.attributeInteger) && + Objects.equals(attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(wrappedArray, xmlItem.wrappedArray) && + Objects.equals(nameString, xmlItem.nameString) && + Objects.equals(nameNumber, xmlItem.nameNumber) && + Objects.equals(nameInteger, xmlItem.nameInteger) && + Objects.equals(nameBoolean, xmlItem.nameBoolean) && + Objects.equals(nameArray, xmlItem.nameArray) && + Objects.equals(nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(prefixString, xmlItem.prefixString) && + Objects.equals(prefixNumber, xmlItem.prefixNumber) && + Objects.equals(prefixInteger, xmlItem.prefixInteger) && + Objects.equals(prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(prefixArray, xmlItem.prefixArray) && + Objects.equals(prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(namespaceString, xmlItem.namespaceString) && + Objects.equals(namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(namespaceArray, xmlItem.namespaceArray) && + Objects.equals(namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(prefixNsString, xmlItem.prefixNsString) && + Objects.equals(prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java index 3056c5a319ad..aa22bcb3ff80 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java @@ -36,18 +36,18 @@ private AnotherFakeApiController(Configuration configuration, AnotherFakeApiCont @ApiAction - public Result testSpecialTags() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + public Result call123testSpecialTags() throws Exception { + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testSpecialTags(client); + Client obj = imp.call123testSpecialTags(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java index 28461fdd91ae..cb14f49165c8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java @@ -11,7 +11,7 @@ public class AnotherFakeApiControllerImp implements AnotherFakeApiControllerImpInterface { @Override - public Client testSpecialTags(Client client) throws Exception { + public Client call123testSpecialTags(Client body) throws Exception { //Do your magic!!! return new Client(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java index 28d1da8e37bc..ebc18b14f241 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java @@ -11,6 +11,6 @@ @SuppressWarnings("RedundantThrows") public interface AnotherFakeApiControllerImpInterface { - Client testSpecialTags(Client client) throws Exception; + Client call123testSpecialTags(Client body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index fb501df6b6f3..508aacee714e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -9,6 +9,7 @@ import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Controller; import play.mvc.Result; @@ -43,6 +44,22 @@ private FakeApiController(Configuration configuration, FakeApiControllerImpInter } + @ApiAction + public Result createXmlItem() throws Exception { + JsonNode nodexmlItem = request().body().asJson(); + XmlItem xmlItem; + if (nodexmlItem != null) { + xmlItem = mapper.readValue(nodexmlItem.toString(), XmlItem.class); + if (configuration.getBoolean("useInputBeanValidation")) { + OpenAPIUtils.validate(xmlItem); + } + } else { + throw new IllegalArgumentException("'XmlItem' parameter is required"); + } + imp.createXmlItem(xmlItem); + return ok(); + } + @ApiAction public Result fakeOuterBooleanSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); @@ -62,17 +79,17 @@ public Result fakeOuterBooleanSerialize() throws Exception { @ApiAction public Result fakeOuterCompositeSerialize() throws Exception { - JsonNode nodeouterComposite = request().body().asJson(); - OuterComposite outerComposite; - if (nodeouterComposite != null) { - outerComposite = mapper.readValue(nodeouterComposite.toString(), OuterComposite.class); + JsonNode nodebody = request().body().asJson(); + OuterComposite body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), OuterComposite.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(outerComposite); + OpenAPIUtils.validate(body); } } else { - outerComposite = null; + body = null; } - OuterComposite obj = imp.fakeOuterCompositeSerialize(outerComposite); + OuterComposite obj = imp.fakeOuterCompositeSerialize(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } @@ -119,31 +136,31 @@ public Result fakeOuterStringSerialize() throws Exception { @ApiAction public Result testBodyWithFileSchema() throws Exception { - JsonNode nodefileSchemaTestClass = request().body().asJson(); - FileSchemaTestClass fileSchemaTestClass; - if (nodefileSchemaTestClass != null) { - fileSchemaTestClass = mapper.readValue(nodefileSchemaTestClass.toString(), FileSchemaTestClass.class); + JsonNode nodebody = request().body().asJson(); + FileSchemaTestClass body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), FileSchemaTestClass.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(fileSchemaTestClass); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'FileSchemaTestClass' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.testBodyWithFileSchema(fileSchemaTestClass); + imp.testBodyWithFileSchema(body); return ok(); } @ApiAction public Result testBodyWithQueryParams() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } String valuequery = request().getQueryString("query"); String query; @@ -152,23 +169,23 @@ public Result testBodyWithQueryParams() throws Exception { } else { throw new IllegalArgumentException("'query' parameter is required"); } - imp.testBodyWithQueryParams(query, user); + imp.testBodyWithQueryParams(query, body); return ok(); } @ApiAction public Result testClientModel() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testClientModel(client); + Client obj = imp.testClientModel(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } @@ -225,7 +242,7 @@ public Result testEndpointParameters() throws Exception { if (valuestring != null) { string = valuestring; } else { - string = "null"; + string = null; } String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0]; String patternWithoutDelimiter; @@ -261,14 +278,14 @@ public Result testEndpointParameters() throws Exception { if (valuepassword != null) { password = valuepassword; } else { - password = "null"; + password = null; } String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0]; String paramCallback; if (valueparamCallback != null) { paramCallback = valueparamCallback; } else { - paramCallback = "null"; + paramCallback = null; } imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); return ok(); @@ -342,21 +359,69 @@ public Result testEnumParameters() throws Exception { return ok(); } + @ApiAction + public Result testGroupParameters() throws Exception { + String valuerequiredStringGroup = request().getQueryString("required_string_group"); + Integer requiredStringGroup; + if (valuerequiredStringGroup != null) { + requiredStringGroup = Integer.parseInt(valuerequiredStringGroup); + } else { + throw new IllegalArgumentException("'required_string_group' parameter is required"); + } + String valuerequiredInt64Group = request().getQueryString("required_int64_group"); + Long requiredInt64Group; + if (valuerequiredInt64Group != null) { + requiredInt64Group = Long.parseLong(valuerequiredInt64Group); + } else { + throw new IllegalArgumentException("'required_int64_group' parameter is required"); + } + String valuestringGroup = request().getQueryString("string_group"); + Integer stringGroup; + if (valuestringGroup != null) { + stringGroup = Integer.parseInt(valuestringGroup); + } else { + stringGroup = null; + } + String valueint64Group = request().getQueryString("int64_group"); + Long int64Group; + if (valueint64Group != null) { + int64Group = Long.parseLong(valueint64Group); + } else { + int64Group = null; + } + String valuerequiredBooleanGroup = request().getHeader("required_boolean_group"); + Boolean requiredBooleanGroup; + if (valuerequiredBooleanGroup != null) { + requiredBooleanGroup = Boolean.valueOf(valuerequiredBooleanGroup); + } else { + throw new IllegalArgumentException("'required_boolean_group' parameter is required"); + } + String valuebooleanGroup = request().getHeader("boolean_group"); + Boolean booleanGroup; + if (valuebooleanGroup != null) { + booleanGroup = Boolean.valueOf(valuebooleanGroup); + } else { + booleanGroup = null; + } + imp.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + return ok(); + } + @ApiAction public Result testInlineAdditionalProperties() throws Exception { - JsonNode noderequestBody = request().body().asJson(); - Map requestBody; - if (noderequestBody != null) { - requestBody = mapper.readValue(noderequestBody.toString(), new TypeReference>(){}); + JsonNode nodeparam = request().body().asJson(); + Map param; + if (nodeparam != null) { + param = mapper.readValue(nodeparam.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (Map.Entry entry : requestBody.entrySet()) { + for (Map.Entry entry : param.entrySet()) { OpenAPIUtils.validate(entry.getValue()); } } } else { - throw new IllegalArgumentException("'request_body' parameter is required"); + throw new IllegalArgumentException("'param' parameter is required"); } - imp.testInlineAdditionalProperties(requestBody); + imp.testInlineAdditionalProperties(param); return ok(); } @@ -379,4 +444,70 @@ public Result testJsonFormData() throws Exception { imp.testJsonFormData(param, param2); return ok(); } + + @ApiAction + public Result testQueryParameterCollectionFormat() throws Exception { + String[] pipeArray = request().queryString().get("pipe"); + if (pipeArray == null) { + throw new IllegalArgumentException("'pipe' parameter is required"); + } + List pipeList = OpenAPIUtils.parametersToList("csv", pipeArray); + List pipe = new ArrayList(); + for (String curParam : pipeList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + pipe.add(curParam); + } + } + String[] ioutilArray = request().queryString().get("ioutil"); + if (ioutilArray == null) { + throw new IllegalArgumentException("'ioutil' parameter is required"); + } + List ioutilList = OpenAPIUtils.parametersToList("csv", ioutilArray); + List ioutil = new ArrayList(); + for (String curParam : ioutilList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + ioutil.add(curParam); + } + } + String[] httpArray = request().queryString().get("http"); + if (httpArray == null) { + throw new IllegalArgumentException("'http' parameter is required"); + } + List httpList = OpenAPIUtils.parametersToList("space", httpArray); + List http = new ArrayList(); + for (String curParam : httpList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + http.add(curParam); + } + } + String[] urlArray = request().queryString().get("url"); + if (urlArray == null) { + throw new IllegalArgumentException("'url' parameter is required"); + } + List urlList = OpenAPIUtils.parametersToList("csv", urlArray); + List url = new ArrayList(); + for (String curParam : urlList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + url.add(curParam); + } + } + String[] contextArray = request().queryString().get("context"); + if (contextArray == null) { + throw new IllegalArgumentException("'context' parameter is required"); + } + List contextList = OpenAPIUtils.parametersToList("multi", contextArray); + List context = new ArrayList(); + for (String curParam : contextList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + context.add(curParam); + } + } + imp.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + return ok(); + } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java index a33162119274..d50832ef3b1d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java @@ -9,6 +9,7 @@ import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Http; import java.util.List; @@ -18,6 +19,11 @@ import javax.validation.constraints.*; public class FakeApiControllerImp implements FakeApiControllerImpInterface { + @Override + public void createXmlItem(XmlItem xmlItem) throws Exception { + //Do your magic!!! + } + @Override public Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception { //Do your magic!!! @@ -25,7 +31,7 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception { } @Override - public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception { + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception { //Do your magic!!! return new OuterComposite(); } @@ -43,17 +49,17 @@ public String fakeOuterStringSerialize(String body) throws Exception { } @Override - public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception { + public void testBodyWithFileSchema(FileSchemaTestClass body) throws Exception { //Do your magic!!! } @Override - public void testBodyWithQueryParams( @NotNull String query, User user) throws Exception { + public void testBodyWithQueryParams( @NotNull String query, User body) throws Exception { //Do your magic!!! } @Override - public Client testClientModel(Client client) throws Exception { + public Client testClientModel(Client body) throws Exception { //Do your magic!!! return new Client(); } @@ -69,7 +75,12 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe } @Override - public void testInlineAdditionalProperties(Map requestBody) throws Exception { + public void testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws Exception { + //Do your magic!!! + } + + @Override + public void testInlineAdditionalProperties(Map param) throws Exception { //Do your magic!!! } @@ -78,4 +89,9 @@ public void testJsonFormData(String param, String param2) throws Exception { //Do your magic!!! } + @Override + public void testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context) throws Exception { + //Do your magic!!! + } + } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java index e36e7c50120c..3363805d153c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java @@ -9,6 +9,7 @@ import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Http; import java.util.List; @@ -19,26 +20,32 @@ @SuppressWarnings("RedundantThrows") public interface FakeApiControllerImpInterface { + void createXmlItem(XmlItem xmlItem) throws Exception; + Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception; - OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception; + OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception; BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws Exception; String fakeOuterStringSerialize(String body) throws Exception; - void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception; + void testBodyWithFileSchema(FileSchemaTestClass body) throws Exception; - void testBodyWithQueryParams( @NotNull String query, User user) throws Exception; + void testBodyWithQueryParams( @NotNull String query, User body) throws Exception; - Client testClientModel(Client client) throws Exception; + Client testClientModel(Client body) throws Exception; void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, Http.MultipartFormData.FilePart binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws Exception; void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws Exception; - void testInlineAdditionalProperties(Map requestBody) throws Exception; + void testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws Exception; + + void testInlineAdditionalProperties(Map param) throws Exception; void testJsonFormData(String param, String param2) throws Exception; + void testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context) throws Exception; + } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index 748cb9f2af41..760b0a394169 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -37,17 +37,17 @@ private FakeClassnameTags123ApiController(Configuration configuration, FakeClass @ApiAction public Result testClassname() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testClassname(client); + Client obj = imp.testClassname(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java index 8427478bcdd7..7d18dc42afba 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java @@ -11,7 +11,7 @@ public class FakeClassnameTags123ApiControllerImp implements FakeClassnameTags123ApiControllerImpInterface { @Override - public Client testClassname(Client client) throws Exception { + public Client testClassname(Client body) throws Exception { //Do your magic!!! return new Client(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java index 224e8fbd8975..8ea6e6598f11 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java @@ -11,6 +11,6 @@ @SuppressWarnings("RedundantThrows") public interface FakeClassnameTags123ApiControllerImpInterface { - Client testClassname(Client client) throws Exception; + Client testClassname(Client body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index 4b5720896eec..e4427543e641 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); @@ -185,13 +185,13 @@ public Result uploadFileWithRequiredFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } - Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - if ((file == null || ((File) file.getFile()).length() == 0)) { - throw new IllegalArgumentException("'file' file cannot be empty"); + Http.MultipartFormData.FilePart requiredFile = request().body().asMultipartFormData().getFile("requiredFile"); + if ((requiredFile == null || ((File) requiredFile.getFile()).length() == 0)) { + throw new IllegalArgumentException("'requiredFile' file cannot be empty"); } - ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java index 85e0c60ef6cf..3d028b318637 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } @@ -57,7 +57,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.M } @Override - public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart requiredFile, String additionalMetadata) throws Exception { //Do your magic!!! return new ModelApiResponse(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java index 1a87f77ac02c..a6c88443756b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,12 +23,12 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; - ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception; + ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart requiredFile, String additionalMetadata) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 03d64c1346ca..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index 439fa190f586..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes index 08762f3f8ebd..29ab19d99513 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes +++ b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes @@ -6,9 +6,10 @@ GET /api controllers.ApiDocController.api #Functions for AnotherFake API -PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.testSpecialTags() +PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.call123testSpecialTags() #Functions for Fake API +POST /v2/fake/create_xml_item controllers.FakeApiController.createXmlItem() POST /v2/fake/outer/boolean controllers.FakeApiController.fakeOuterBooleanSerialize() POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize() POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize() @@ -18,8 +19,10 @@ PUT /v2/fake/body-with-query-params controllers.FakeApiC PATCH /v2/fake controllers.FakeApiController.testClientModel() POST /v2/fake controllers.FakeApiController.testEndpointParameters() GET /v2/fake controllers.FakeApiController.testEnumParameters() +DELETE /v2/fake controllers.FakeApiController.testGroupParameters() POST /v2/fake/inline-additionalProperties controllers.FakeApiController.testInlineAdditionalProperties() GET /v2/fake/jsonFormData controllers.FakeApiController.testJsonFormData() +PUT /v2/fake/test-query-paramters controllers.FakeApiController.testQueryParameterCollectionFormat() #Functions for FakeClassnameTags123 API PATCH /v2/fake_classname_test controllers.FakeClassnameTags123ApiController.testClassname() diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index 6a55a7238e00..4c4f6b24a6fb 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", "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:80/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,34 +39,31 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } + "200" : { + "content" : { }, + "description" : "successful operation" }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +76,197 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "200" : { + "content" : { }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" : { + "200" : { + "content" : { }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +278,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +315,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" } } } @@ -286,61 +329,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +361,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" } } } @@ -364,58 +376,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +434,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +450,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{order_id}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "order_id", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId" : "getOrderById", "parameters" : [ { - "name" : "order_id", - "in" : "path", "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "order_id", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +520,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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" : "order_id", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +549,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +647,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when token expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when token expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +741,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +752,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,56 +788,31 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/fake_classname_test" : { "patch" : { - "tags" : [ "fake_classname_tags 123#$%^" ], - "summary" : "To test class name in snake case", "description" : "To test class name in snake case", "operationId" : "testClassname", "requestBody" : { - "description" : "client model", "content" : { "application/json" : { "schema" : { @@ -804,96 +820,160 @@ } } }, + "description" : "client model", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Client" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key_query" : [ ] } ], + "summary" : "To test class name in snake case", + "tags" : [ "fake_classname_tags 123#$%^" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/fake" : { - "get" : { + "delete" : { + "description" : "Fake endpoint to test group parameters (optional)", + "operationId" : "testGroupParameters", + "parameters" : [ { + "description" : "Required String in group parameters", + "in" : "query", + "name" : "required_string_group", + "required" : true, + "schema" : { + "type" : "integer" + } + }, { + "description" : "Required Boolean in group parameters", + "in" : "header", + "name" : "required_boolean_group", + "required" : true, + "schema" : { + "type" : "boolean" + } + }, { + "description" : "Required Integer in group parameters", + "in" : "query", + "name" : "required_int64_group", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + }, { + "description" : "String in group parameters", + "in" : "query", + "name" : "string_group", + "schema" : { + "type" : "integer" + } + }, { + "description" : "Boolean in group parameters", + "in" : "header", + "name" : "boolean_group", + "schema" : { + "type" : "boolean" + } + }, { + "description" : "Integer in group parameters", + "in" : "query", + "name" : "int64_group", + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Someting wrong" + } + }, + "summary" : "Fake endpoint to test group parameters (optional)", "tags" : [ "fake" ], - "summary" : "To test enum parameters", + "x-group-parameters" : true, + "x-accepts" : "application/json" + }, + "get" : { "description" : "To test enum parameters", "operationId" : "testEnumParameters", "parameters" : [ { - "name" : "enum_header_string_array", - "in" : "header", "description" : "Header parameter enum test (string array)", - "style" : "simple", "explode" : false, + "in" : "header", + "name" : "enum_header_string_array", "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "$", "enum" : [ ">", "$" ], - "default" : "$" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "simple" }, { - "name" : "enum_header_string", - "in" : "header", "description" : "Header parameter enum test (string)", + "in" : "header", + "name" : "enum_header_string", "schema" : { - "type" : "string", + "default" : "-efg", "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "type" : "string" } }, { - "name" : "enum_query_string_array", - "in" : "query", "description" : "Query parameter enum test (string array)", - "style" : "form", "explode" : false, + "in" : "query", + "name" : "enum_query_string_array", "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "$", "enum" : [ ">", "$" ], - "default" : "$" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" }, { - "name" : "enum_query_string", - "in" : "query", "description" : "Query parameter enum test (string)", + "in" : "query", + "name" : "enum_query_string", "schema" : { - "type" : "string", + "default" : "-efg", "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "type" : "string" } }, { - "name" : "enum_query_integer", - "in" : "query", "description" : "Query parameter enum test (double)", + "in" : "query", + "name" : "enum_query_integer", "schema" : { - "type" : "integer", + "enum" : [ 1, -2 ], "format" : "int32", - "enum" : [ 1, -2 ] + "type" : "integer" } }, { - "name" : "enum_query_double", - "in" : "query", "description" : "Query parameter enum test (double)", + "in" : "query", + "name" : "enum_query_double", "schema" : { - "type" : "number", + "enum" : [ 1.1, -1.2 ], "format" : "double", - "enum" : [ 1.1, -1.2 ] + "type" : "number" } } ], "requestBody" : { @@ -902,19 +982,19 @@ "schema" : { "properties" : { "enum_form_string_array" : { - "type" : "array", "description" : "Form parameter enum test (string array)", "items" : { - "type" : "string", + "default" : "$", "enum" : [ ">", "$" ], - "default" : "$" - } + "type" : "string" + }, + "type" : "array" }, "enum_form_string" : { - "type" : "string", + "default" : "-efg", "description" : "Form parameter enum test (string)", "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "type" : "string" } } } @@ -923,107 +1003,140 @@ }, "responses" : { "400" : { - "description" : "Invalid request", - "content" : { } + "content" : { }, + "description" : "Invalid request" }, "404" : { - "description" : "Not found", - "content" : { } + "content" : { }, + "description" : "Not found" } }, + "summary" : "To test enum parameters", + "tags" : [ "fake" ], "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" }, - "post" : { + "patch" : { + "description" : "To test \"client\" model", + "operationId" : "testClientModel", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "description" : "client model", + "required" : true + }, + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "description" : "successful operation" + } + }, + "summary" : "To test \"client\" model", "tags" : [ "fake" ], - "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "post" : { "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", "operationId" : "testEndpointParameters", "requestBody" : { "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], "properties" : { "integer" : { + "description" : "None", + "format" : "int32", "maximum" : 100, "minimum" : 10, - "type" : "integer", - "description" : "None" + "type" : "integer" }, "int32" : { + "description" : "None", + "format" : "int32", "maximum" : 200, "minimum" : 20, - "type" : "integer", - "description" : "None", - "format" : "int32" + "type" : "integer" }, "int64" : { - "type" : "integer", "description" : "None", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "number" : { + "description" : "None", "maximum" : 543.2, "minimum" : 32.1, - "type" : "number", - "description" : "None" + "type" : "number" }, "float" : { - "maximum" : 987.6, - "type" : "number", "description" : "None", - "format" : "float" + "format" : "float", + "maximum" : 987.6, + "type" : "number" }, "double" : { + "description" : "None", + "format" : "double", "maximum" : 123.4, "minimum" : 67.8, - "type" : "number", - "description" : "None", - "format" : "double" + "type" : "number" }, "string" : { + "description" : "None", "pattern" : "/[a-z]/i", - "type" : "string", - "description" : "None" + "type" : "string" }, "pattern_without_delimiter" : { + "description" : "None", "pattern" : "^[A-Z].*", - "type" : "string", - "description" : "None" + "type" : "string" }, "byte" : { - "type" : "string", "description" : "None", - "format" : "byte" + "format" : "byte", + "type" : "string" }, "binary" : { - "type" : "string", "description" : "None", - "format" : "binary" + "format" : "binary", + "type" : "string" }, "date" : { - "type" : "string", "description" : "None", - "format" : "date" + "format" : "date", + "type" : "string" }, "dateTime" : { - "type" : "string", "description" : "None", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "password" : { + "description" : "None", + "format" : "password", "maxLength" : 64, "minLength" : 10, - "type" : "string", - "description" : "None", - "format" : "password" + "type" : "string" }, "callback" : { - "type" : "string", - "description" : "None" + "description" : "None", + "type" : "string" } - } + }, + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ] } } }, @@ -1031,59 +1144,28 @@ }, "responses" : { "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, "security" : [ { "http_basic_test" : [ ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "patch" : { + "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", "tags" : [ "fake" ], - "summary" : "To test \"client\" model", - "description" : "To test \"client\" model", - "operationId" : "testClientModel", - "requestBody" : { - "description" : "client model", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Client" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Client" - } - } - } - } - }, - "x-contentType" : "application/json", + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/fake/outer/number" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of outer number types", "operationId" : "fakeOuterNumberSerialize", "requestBody" : { - "description" : "Input number as post body", "content" : { "*/*" : { "schema" : { @@ -1091,31 +1173,32 @@ } } }, + "description" : "Input number as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output number", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterNumber" } } - } + }, + "description" : "Output number" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/outer/string" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of outer string types", "operationId" : "fakeOuterStringSerialize", "requestBody" : { - "description" : "Input string as post body", "content" : { "*/*" : { "schema" : { @@ -1123,31 +1206,32 @@ } } }, + "description" : "Input string as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output string", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterString" } } - } + }, + "description" : "Output string" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/outer/boolean" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of outer boolean types", "operationId" : "fakeOuterBooleanSerialize", "requestBody" : { - "description" : "Input boolean as post body", "content" : { "*/*" : { "schema" : { @@ -1155,31 +1239,32 @@ } } }, + "description" : "Input boolean as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output boolean", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterBoolean" } } - } + }, + "description" : "Output boolean" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/outer/composite" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of object with outer number type", "operationId" : "fakeOuterCompositeSerialize", "requestBody" : { - "description" : "Input composite as post body", "content" : { "*/*" : { "schema" : { @@ -1187,44 +1272,45 @@ } } }, + "description" : "Input composite as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output composite", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterComposite" } } - } + }, + "description" : "Output composite" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/jsonFormData" : { "get" : { - "tags" : [ "fake" ], - "summary" : "test json serialization of form data", "operationId" : "testJsonFormData", "requestBody" : { "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "required" : [ "param", "param2" ], "properties" : { "param" : { - "type" : "string", - "description" : "field1" + "description" : "field1", + "type" : "string" }, "param2" : { - "type" : "string", - "description" : "field2" + "description" : "field2", + "type" : "string" } - } + }, + "required" : [ "param", "param2" ] } } }, @@ -1232,50 +1318,52 @@ }, "responses" : { "200" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "test json serialization of form data", + "tags" : [ "fake" ], "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/fake/inline-additionalProperties" : { "post" : { - "tags" : [ "fake" ], - "summary" : "test inline additionalProperties", "operationId" : "testInlineAdditionalProperties", "requestBody" : { - "description" : "request body", "content" : { "application/json" : { "schema" : { - "type" : "object", "additionalProperties" : { "type" : "string" - } + }, + "type" : "object" } } }, + "description" : "request body", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "test inline additionalProperties", + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "param", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/fake/body-with-query-params" : { "put" : { - "tags" : [ "fake" ], "operationId" : "testBodyWithQueryParams", "parameters" : [ { - "name" : "query", "in" : "query", + "name" : "query", "required" : true, "schema" : { "type" : "string" @@ -1293,22 +1381,74 @@ }, "responses" : { "200" : { - "description" : "Success", - "content" : { } + "content" : { }, + "description" : "Success" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, + "/fake/create_xml_item" : { + "post" : { + "description" : "this route creates an XmlItem", + "operationId" : "createXmlItem", + "requestBody" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "application/xml; charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "application/xml; charset=utf-16" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml; charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml; charset=utf-16" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + } + }, + "description" : "XmlItem Body", + "required" : true + }, + "responses" : { + "200" : { + "content" : { }, + "description" : "successful operation" + } + }, + "summary" : "creates an XmlItem", + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "XmlItem", + "x-contentType" : "application/xml", + "x-accepts" : "application/json" + } + }, "/another-fake/dummy" : { "patch" : { - "tags" : [ "$another-fake?" ], - "summary" : "To test special tags", - "description" : "To test special tags", - "operationId" : "test_special_tags", + "description" : "To test special tags and operation ID starting with number", + "operationId" : "123_test_@#$%_special_tags", "requestBody" : { - "description" : "client model", "content" : { "application/json" : { "schema" : { @@ -1316,27 +1456,30 @@ } } }, + "description" : "client model", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Client" } } - } + }, + "description" : "successful operation" } }, + "summary" : "To test special tags", + "tags" : [ "$another-fake?" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/fake/body-with-file-schema" : { "put" : { - "tags" : [ "fake" ], "description" : "For this test, the body for this request much reference a schema named `File`.", "operationId" : "testBodyWithFileSchema", "requestBody" : { @@ -1351,45 +1494,117 @@ }, "responses" : { "200" : { - "description" : "Success", - "content" : { } + "content" : { }, + "description" : "Success" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, + "/fake/test-query-paramters" : { + "put" : { + "description" : "To test the collection format in query parameters", + "operationId" : "testQueryParameterCollectionFormat", + "parameters" : [ { + "explode" : false, + "in" : "query", + "name" : "pipe", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + }, { + "in" : "query", + "name" : "ioutil", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + } + }, { + "in" : "query", + "name" : "http", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "spaceDelimited" + }, { + "explode" : false, + "in" : "query", + "name" : "url", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + }, { + "explode" : true, + "in" : "query", + "name" : "context", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "content" : { }, + "description" : "Success" + } + }, + "tags" : [ "fake" ], + "x-accepts" : "application/json" + } + }, "/fake/{petId}/uploadImageWithRequiredFile" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image (required)", "operationId" : "uploadFileWithRequiredFile", "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" : { "content" : { "multipart/form-data" : { "schema" : { - "required" : [ "file" ], "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, - "file" : { - "type" : "string", + "requiredFile" : { "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } - } + }, + "required" : [ "requiredFile" ] } } }, @@ -1397,19 +1612,21 @@ }, "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 (required)", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } @@ -1417,31 +1634,83 @@ }, "components" : { "schemas" : { - "Category" : { - "type" : "object", + "Order" : { + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, - "name" : { + "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" } }, + "type" : "object", + "xml" : { + "name" : "Order" + } + }, + "Category" : { "example" : { - "name" : "name", + "name" : "default-name", "id" : 6 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "default" : "default-name", + "type" : "string" + } + }, + "required" : [ "name" ], + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "type" : "object", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", "format" : "int64", + "type" : "integer", "x-is-unique" : true }, "username" : { @@ -1463,88 +1732,108 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, + "type" : "object", "xml" : { "name" : "User" } }, - "OuterNumber" : { - "type" : "number" - }, - "ArrayOfNumberOnly" : { - "type" : "object", + "Tag" : { + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { - "ArrayNumber" : { - "type" : "array", - "items" : { - "type" : "number" - } + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" } + }, + "type" : "object", + "xml" : { + "name" : "Tag" } }, - "Capitalization" : { - "type" : "object", + "Pet" : { + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "default-name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { - "smallCamel" : { - "type" : "string" + "id" : { + "format" : "int64", + "type" : "integer", + "x-is-unique" : true }, - "CapitalCamel" : { - "type" : "string" + "category" : { + "$ref" : "#/components/schemas/Category" }, - "small_Snake" : { + "name" : { + "example" : "doggie", "type" : "string" }, - "Capital_Snake" : { - "type" : "string" + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } }, - "SCA_ETH_Flow_Points" : { - "type" : "string" + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } }, - "ATT_NAME" : { - "type" : "string", - "description" : "Name of the pet\n" + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } - } - }, - "MixedPropertiesAndAdditionalPropertiesClass" : { + }, + "required" : [ "name", "photoUrls" ], "type" : "object", - "properties" : { - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "map" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/Animal" - } - } + "xml" : { + "name" : "Pet" } }, "ApiResponse" : { - "type" : "object", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1553,408 +1842,626 @@ "type" : "string" } }, - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" + "type" : "object" + }, + "$special[model.name]" : { + "properties" : { + "$special[property.name]" : { + "format" : "int64", + "type" : "integer" + } + }, + "type" : "object", + "xml" : { + "name" : "$special[model.name]" } }, - "Name" : { - "required" : [ "name" ], + "Return" : { + "description" : "Model for testing reserved words", + "properties" : { + "return" : { + "format" : "int32", + "type" : "integer" + } + }, "type" : "object", + "xml" : { + "name" : "Return" + } + }, + "Name" : { + "description" : "Model for testing model name same as property name", "properties" : { "name" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "snake_case" : { - "type" : "integer", "format" : "int32", - "readOnly" : true + "readOnly" : true, + "type" : "integer" }, "property" : { "type" : "string" }, "123Number" : { - "type" : "integer", - "readOnly" : true + "readOnly" : true, + "type" : "integer" } }, - "description" : "Model for testing model name same as property name", + "required" : [ "name" ], + "type" : "object", "xml" : { "name" : "Name" } }, - "EnumClass" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - }, - "List" : { - "type" : "object", - "properties" : { - "123-list" : { - "type" : "string" - } - }, - "example" : { - "123-list" : "123-list" - } - }, - "NumberOnly" : { - "type" : "object", - "properties" : { - "JustNumber" : { - "type" : "number" - } - } - }, "200_response" : { - "type" : "object", + "description" : "Model for testing model name starting with number", "properties" : { "name" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "class" : { "type" : "string" } }, - "description" : "Model for testing model name starting with number", + "type" : "object", "xml" : { "name" : "Name" } }, - "Client" : { - "type" : "object", + "ClassModel" : { + "description" : "Model for testing model with \"_class\" property", "properties" : { - "client" : { + "_class" : { "type" : "string" } }, - "example" : { - "client" : "client" - } + "type" : "object" }, "Dog" : { "allOf" : [ { "$ref" : "#/components/schemas/Animal" }, { - "type" : "object", - "properties" : { - "breed" : { - "type" : "string" - } - } + "$ref" : "#/components/schemas/Dog_allOf" } ] }, - "Enum_Test" : { - "required" : [ "enum_string_required" ], - "type" : "object", + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "propertyName" : "className" + }, "properties" : { - "enum_string" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_string_required" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_integer" : { - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -1 ] - }, - "enum_number" : { - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] + "className" : { + "type" : "string" }, - "outerEnum" : { - "$ref" : "#/components/schemas/OuterEnum" + "color" : { + "default" : "red", + "type" : "string" } - } + }, + "required" : [ "className" ], + "type" : "object" }, - "Order" : { - "type" : "object", + "AnimalFarm" : { + "items" : { + "$ref" : "#/components/schemas/Animal" + }, + "type" : "array" + }, + "format_test" : { "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "integer" : { + "maximum" : 1E+2, + "minimum" : 1E+1, + "type" : "integer" }, - "petId" : { - "type" : "integer", - "format" : "int64" + "int32" : { + "format" : "int32", + "maximum" : 2E+2, + "minimum" : 2E+1, + "type" : "integer" }, - "quantity" : { - "type" : "integer", - "format" : "int32" + "int64" : { + "format" : "int64", + "type" : "integer" }, - "shipDate" : { - "type" : "string", - "format" : "date-time" + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number" }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "float" : { + "format" : "float", + "maximum" : 987.6, + "minimum" : 54.3, + "type" : "number" }, - "complete" : { - "type" : "boolean", - "default" : false + "double" : { + "format" : "double", + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string" + }, + "byte" : { + "format" : "byte", + "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type" : "string" + }, + "binary" : { + "format" : "binary", + "type" : "string" + }, + "date" : { + "format" : "date", + "type" : "string" + }, + "dateTime" : { + "format" : "date-time", + "type" : "string" + }, + "uuid" : { + "example" : "72f98069-206d-4f12-9f12-3d1e525a8e84", + "format" : "uuid", + "type" : "string" + }, + "password" : { + "format" : "password", + "maxLength" : 64, + "minLength" : 10, + "type" : "string" } }, - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" + "required" : [ "byte", "date", "number", "password" ], + "type" : "object" + }, + "EnumClass" : { + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ], + "type" : "string" + }, + "Enum_Test" : { + "properties" : { + "enum_string" : { + "enum" : [ "UPPER", "lower", "" ], + "type" : "string" + }, + "enum_string_required" : { + "enum" : [ "UPPER", "lower", "" ], + "type" : "string" + }, + "enum_integer" : { + "enum" : [ 1, -1 ], + "format" : "int32", + "type" : "integer" + }, + "enum_number" : { + "enum" : [ 1.1, -1.2 ], + "format" : "double", + "type" : "number" + }, + "outerEnum" : { + "$ref" : "#/components/schemas/OuterEnum" + } }, - "xml" : { - "name" : "Order" - } + "required" : [ "enum_string_required" ], + "type" : "object" }, "AdditionalPropertiesClass" : { - "type" : "object", "properties" : { - "map_property" : { - "type" : "object", + "map_string" : { "additionalProperties" : { "type" : "string" - } + }, + "type" : "object" }, - "map_of_map_property" : { - "type" : "object", + "map_number" : { + "additionalProperties" : { + "type" : "number" + }, + "type" : "object" + }, + "map_integer" : { + "additionalProperties" : { + "type" : "integer" + }, + "type" : "object" + }, + "map_boolean" : { + "additionalProperties" : { + "type" : "boolean" + }, + "type" : "object" + }, + "map_array_integer" : { + "additionalProperties" : { + "items" : { + "type" : "integer" + }, + "type" : "array" + }, + "type" : "object" + }, + "map_array_anytype" : { + "additionalProperties" : { + "items" : { + "properties" : { }, + "type" : "object" + }, + "type" : "array" + }, + "type" : "object" + }, + "map_map_string" : { "additionalProperties" : { - "type" : "object", "additionalProperties" : { "type" : "string" - } - } + }, + "type" : "object" + }, + "type" : "object" + }, + "map_map_anytype" : { + "additionalProperties" : { + "additionalProperties" : { + "properties" : { }, + "type" : "object" + }, + "type" : "object" + }, + "type" : "object" + }, + "anytype_1" : { + "properties" : { }, + "type" : "object" + }, + "anytype_2" : { + "type" : "object" + }, + "anytype_3" : { + "properties" : { }, + "type" : "object" } - } + }, + "type" : "object" }, - "$special[model.name]" : { - "type" : "object", + "AdditionalPropertiesString" : { + "additionalProperties" : { + "type" : "string" + }, "properties" : { - "$special[property.name]" : { - "type" : "integer", - "format" : "int64" + "name" : { + "type" : "string" } }, - "xml" : { - "name" : "$special[model.name]" - } + "type" : "object" }, - "Return" : { - "type" : "object", + "AdditionalPropertiesInteger" : { + "additionalProperties" : { + "type" : "integer" + }, "properties" : { - "return" : { - "type" : "integer", - "format" : "int32" + "name" : { + "type" : "string" } }, - "description" : "Model for testing reserved words", - "xml" : { - "name" : "Return" - } + "type" : "object" }, - "ReadOnlyFirst" : { - "type" : "object", + "AdditionalPropertiesNumber" : { + "additionalProperties" : { + "type" : "number" + }, "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesBoolean" : { + "additionalProperties" : { + "type" : "boolean" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesArray" : { + "additionalProperties" : { + "items" : { + "properties" : { }, + "type" : "object" }, - "baz" : { + "type" : "array" + }, + "properties" : { + "name" : { "type" : "string" } - } + }, + "type" : "object" }, - "ArrayOfArrayOfNumberOnly" : { - "type" : "object", + "AdditionalPropertiesObject" : { + "additionalProperties" : { + "additionalProperties" : { + "properties" : { }, + "type" : "object" + }, + "type" : "object" + }, "properties" : { - "ArrayArrayNumber" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "number" - } - } + "name" : { + "type" : "string" } - } + }, + "type" : "object" }, - "OuterEnum" : { - "type" : "string", - "enum" : [ "placed", "approved", "delivered" ] + "AdditionalPropertiesAnyType" : { + "additionalProperties" : { + "properties" : { }, + "type" : "object" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" }, - "ArrayTest" : { - "type" : "object", + "MixedPropertiesAndAdditionalPropertiesClass" : { "properties" : { - "array_of_string" : { - "type" : "array", - "items" : { - "type" : "string" - } + "uuid" : { + "format" : "uuid", + "type" : "string" }, - "array_array_of_integer" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" - } - } + "dateTime" : { + "format" : "date-time", + "type" : "string" }, - "array_array_of_model" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ReadOnlyFirst" - } - } + "map" : { + "additionalProperties" : { + "$ref" : "#/components/schemas/Animal" + }, + "type" : "object" } - } + }, + "type" : "object" }, - "OuterComposite" : { - "type" : "object", + "List" : { "properties" : { - "my_number" : { - "type" : "number" - }, - "my_string" : { + "123-list" : { "type" : "string" - }, - "my_boolean" : { - "type" : "boolean", - "x-codegen-body-parameter-name" : "boolean_post_body" } }, + "type" : "object" + }, + "Client" : { "example" : { - "my_string" : "my_string", - "my_number" : 0.80082819046101150206595775671303272247314453125, - "my_boolean" : true - } + "client" : "client" + }, + "properties" : { + "client" : { + "type" : "string" + } + }, + "type" : "object" }, - "format_test" : { - "required" : [ "byte", "date", "number", "password" ], - "type" : "object", + "ReadOnlyFirst" : { "properties" : { - "integer" : { - "maximum" : 1E+2, - "minimum" : 1E+1, - "type" : "integer" + "bar" : { + "readOnly" : true, + "type" : "string" }, - "int32" : { - "maximum" : 2E+2, - "minimum" : 2E+1, - "type" : "integer", - "format" : "int32" + "baz" : { + "type" : "string" + } + }, + "type" : "object" + }, + "hasOnlyReadOnly" : { + "properties" : { + "bar" : { + "readOnly" : true, + "type" : "string" }, - "int64" : { - "type" : "integer", - "format" : "int64" + "foo" : { + "readOnly" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "Capitalization" : { + "properties" : { + "smallCamel" : { + "type" : "string" }, - "number" : { - "maximum" : 543.2, - "minimum" : 32.1, - "type" : "number" + "CapitalCamel" : { + "type" : "string" }, - "float" : { - "maximum" : 987.6, - "minimum" : 54.3, - "type" : "number", - "format" : "float" + "small_Snake" : { + "type" : "string" }, - "double" : { - "maximum" : 123.4, - "minimum" : 67.8, - "type" : "number", - "format" : "double" + "Capital_Snake" : { + "type" : "string" }, - "string" : { - "pattern" : "/[a-z]/i", + "SCA_ETH_Flow_Points" : { "type" : "string" }, - "byte" : { - "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", - "type" : "string", - "format" : "byte" + "ATT_NAME" : { + "description" : "Name of the pet\n", + "type" : "string" + } + }, + "type" : "object" + }, + "MapTest" : { + "properties" : { + "map_map_of_string" : { + "additionalProperties" : { + "additionalProperties" : { + "type" : "string" + }, + "type" : "object" + }, + "type" : "object" }, - "binary" : { - "type" : "string", - "format" : "binary" + "map_of_enum_string" : { + "additionalProperties" : { + "enum" : [ "UPPER", "lower" ], + "type" : "string" + }, + "type" : "object" }, - "date" : { - "type" : "string", - "format" : "date" + "direct_map" : { + "additionalProperties" : { + "type" : "boolean" + }, + "type" : "object" }, - "dateTime" : { - "type" : "string", - "format" : "date-time" + "indirect_map" : { + "additionalProperties" : { + "type" : "boolean" + }, + "type" : "object" + } + }, + "type" : "object" + }, + "ArrayTest" : { + "properties" : { + "array_of_string" : { + "items" : { + "type" : "string" + }, + "type" : "array" }, - "uuid" : { - "type" : "string", - "format" : "uuid" + "array_array_of_integer" : { + "items" : { + "items" : { + "format" : "int64", + "type" : "integer" + }, + "type" : "array" + }, + "type" : "array" }, - "password" : { - "maxLength" : 64, - "minLength" : 10, - "type" : "string", - "format" : "password" + "array_array_of_model" : { + "items" : { + "items" : { + "$ref" : "#/components/schemas/ReadOnlyFirst" + }, + "type" : "array" + }, + "type" : "array" } - } + }, + "type" : "object" + }, + "NumberOnly" : { + "properties" : { + "JustNumber" : { + "type" : "number" + } + }, + "type" : "object" + }, + "ArrayOfNumberOnly" : { + "properties" : { + "ArrayNumber" : { + "items" : { + "type" : "number" + }, + "type" : "array" + } + }, + "type" : "object" + }, + "ArrayOfArrayOfNumberOnly" : { + "properties" : { + "ArrayArrayNumber" : { + "items" : { + "items" : { + "type" : "number" + }, + "type" : "array" + }, + "type" : "array" + } + }, + "type" : "object" }, "EnumArrays" : { - "type" : "object", "properties" : { "just_symbol" : { - "type" : "string", - "enum" : [ ">=", "$" ] + "enum" : [ ">=", "$" ], + "type" : "string" }, "array_enum" : { - "type" : "array", "items" : { - "type" : "string", - "enum" : [ "fish", "crab" ] - } + "enum" : [ "fish", "crab" ], + "type" : "string" + }, + "type" : "array" } - } + }, + "type" : "object" }, - "OuterString" : { + "OuterEnum" : { + "enum" : [ "placed", "approved", "delivered" ], "type" : "string" }, - "ClassModel" : { - "type" : "object", + "OuterComposite" : { + "example" : { + "my_string" : "my_string", + "my_number" : 0.8008281904610115, + "my_boolean" : true + }, "properties" : { - "_class" : { + "my_number" : { + "type" : "number" + }, + "my_string" : { "type" : "string" + }, + "my_boolean" : { + "type" : "boolean", + "x-codegen-body-parameter-name" : "boolean_post_body" } }, - "description" : "Model for testing model with \"_class\" property" + "type" : "object" + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" }, "OuterBoolean" : { "type" : "boolean", "x-codegen-body-parameter-name" : "boolean_post_body" }, - "FileSchemaTestClass" : { - "type" : "object", - "properties" : { - "file" : { - "$ref" : "#/components/schemas/File" - }, - "files" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/File" - } - } + "StringBooleanMap" : { + "additionalProperties" : { + "type" : "boolean" }, + "type" : "object" + }, + "FileSchemaTestClass" : { "example" : { "file" : { "sourceURI" : "sourceURI" @@ -1964,189 +2471,363 @@ }, { "sourceURI" : "sourceURI" } ] - } + }, + "properties" : { + "file" : { + "$ref" : "#/components/schemas/File" + }, + "files" : { + "items" : { + "$ref" : "#/components/schemas/File" + }, + "type" : "array" + } + }, + "type" : "object" }, - "Animal" : { - "required" : [ "className" ], - "type" : "object", + "File" : { + "description" : "Must be named `File` for test.", + "example" : { + "sourceURI" : "sourceURI" + }, "properties" : { - "className" : { + "sourceURI" : { + "description" : "Test capitalization", "type" : "string" - }, - "color" : { - "type" : "string", - "default" : "red" } }, - "discriminator" : { - "propertyName" : "className" - } - }, - "StringBooleanMap" : { - "type" : "object", - "additionalProperties" : { - "type" : "boolean" - } - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/components/schemas/Animal" - }, { - "type" : "object", - "properties" : { - "declawed" : { - "type" : "boolean" - } - } - } ] + "type" : "object" }, - "MapTest" : { - "type" : "object", + "TypeHolderDefault" : { "properties" : { - "map_map_of_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } + "string_item" : { + "default" : "what", + "type" : "string" }, - "map_of_enum_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "enum" : [ "UPPER", "lower" ] - } + "number_item" : { + "type" : "number" }, - "direct_map" : { - "type" : "object", - "additionalProperties" : { - "type" : "boolean" - } + "integer_item" : { + "type" : "integer" }, - "indirect_map" : { - "$ref" : "#/components/schemas/StringBooleanMap" - } - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "bool_item" : { + "default" : true, + "type" : "boolean" }, - "name" : { - "type" : "string" + "array_item" : { + "items" : { + "type" : "integer" + }, + "type" : "array" } }, - "example" : { - "name" : "name", - "id" : 1 - }, - "xml" : { - "name" : "Tag" - } - }, - "AnimalFarm" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Animal" - } + "required" : [ "array_item", "bool_item", "integer_item", "number_item", "string_item" ], + "type" : "object" }, - "File" : { - "type" : "object", + "TypeHolderExample" : { "properties" : { - "sourceURI" : { - "type" : "string", - "description" : "Test capitalization" + "string_item" : { + "example" : "what", + "type" : "string" + }, + "number_item" : { + "example" : 1.234, + "type" : "number" + }, + "float_item" : { + "example" : 1.234, + "format" : "float", + "type" : "number" + }, + "integer_item" : { + "example" : -2, + "type" : "integer" + }, + "bool_item" : { + "example" : true, + "type" : "boolean" + }, + "array_item" : { + "example" : [ 0, 1, 2, 3 ], + "items" : { + "type" : "integer" + }, + "type" : "array" } }, - "example" : { - "sourceURI" : "sourceURI" - } + "required" : [ "array_item", "bool_item", "float_item", "integer_item", "number_item", "string_item" ], + "type" : "object" }, - "Pet" : { - "required" : [ "name", "photoUrls" ], - "type" : "object", + "XmlItem" : { "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true + "attribute_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "attribute" : true + } }, - "category" : { - "$ref" : "#/components/schemas/Category" + "attribute_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "attribute" : true + } }, - "name" : { - "type" : "string", - "example" : "doggie" + "attribute_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "attribute" : true + } }, - "photoUrls" : { + "attribute_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "attribute" : true + } + }, + "wrapped_array" : { + "items" : { + "type" : "integer" + }, "type" : "array", "xml" : { - "name" : "photoUrl", "wrapped" : true + } + }, + "name_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "name" : "xml_name_string" + } + }, + "name_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "name" : "xml_name_number" + } + }, + "name_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "name" : "xml_name_integer" + } + }, + "name_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "name" : "xml_name_boolean" + } + }, + "name_array" : { + "items" : { + "type" : "integer", + "xml" : { + "name" : "xml_name_array_item" + } }, + "type" : "array" + }, + "name_wrapped_array" : { "items" : { - "type" : "string" + "type" : "integer", + "xml" : { + "name" : "xml_name_wrapped_array_item" + } + }, + "type" : "array", + "xml" : { + "name" : "xml_name_wrapped_array", + "wrapped" : true } }, - "tags" : { + "prefix_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "prefix" : "ab" + } + }, + "prefix_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "prefix" : "cd" + } + }, + "prefix_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "prefix" : "ef" + } + }, + "prefix_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "prefix" : "gh" + } + }, + "prefix_array" : { + "items" : { + "type" : "integer", + "xml" : { + "prefix" : "ij" + } + }, + "type" : "array" + }, + "prefix_wrapped_array" : { + "items" : { + "type" : "integer", + "xml" : { + "prefix" : "mn" + } + }, "type" : "array", "xml" : { - "name" : "tag", + "prefix" : "kl", "wrapped" : true + } + }, + "namespace_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "namespace" : "http://a.com/schema" + } + }, + "namespace_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "namespace" : "http://b.com/schema" + } + }, + "namespace_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "namespace" : "http://c.com/schema" + } + }, + "namespace_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "namespace" : "http://d.com/schema" + } + }, + "namespace_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://e.com/schema" + } }, + "type" : "array" + }, + "namespace_wrapped_array" : { "items" : { - "$ref" : "#/components/schemas/Tag" + "type" : "integer", + "xml" : { + "namespace" : "http://g.com/schema" + } + }, + "type" : "array", + "xml" : { + "namespace" : "http://f.com/schema", + "wrapped" : true } }, - "status" : { + "prefix_ns_string" : { + "example" : "string", "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 + "xml" : { + "namespace" : "http://a.com/schema", + "prefix" : "a" + } }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" + "prefix_ns_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "namespace" : "http://b.com/schema", + "prefix" : "b" + } + }, + "prefix_ns_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "namespace" : "http://c.com/schema", + "prefix" : "c" + } + }, + "prefix_ns_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "namespace" : "http://d.com/schema", + "prefix" : "d" + } + }, + "prefix_ns_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://e.com/schema", + "prefix" : "e" + } + }, + "type" : "array" + }, + "prefix_ns_wrapped_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://g.com/schema", + "prefix" : "g" + } + }, + "type" : "array", + "xml" : { + "namespace" : "http://f.com/schema", + "prefix" : "f", + "wrapped" : true + } + } }, + "type" : "object", "xml" : { - "name" : "Pet" + "namespace" : "http://a.com/schema", + "prefix" : "pre" } }, - "hasOnlyReadOnly" : { - "type" : "object", + "Dog_allOf" : { "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "foo" : { - "type" : "string", - "readOnly" : true + "breed" : { + "type" : "string" + } + } + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" } } } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -2155,21 +2836,22 @@ "read:pets" : "read your pets" } } - } - }, - "http_basic_test" : { - "type" : "http", - "scheme" : "basic" + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" }, "api_key_query" : { - "type" : "apiKey", + "in" : "query", "name" : "api_key_query", - "in" : "query" + "type" : "apiKey" + }, + "http_basic_test" : { + "scheme" : "basic", + "type" : "http" } } } 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 dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-no-bean-validation/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java index 44eb3a6bf7ab..a4c373424f6f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java @@ -11,10 +11,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java index 81a2333008b7..666fa5ac4a15 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java @@ -11,13 +11,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java index a142a5974261..b6b87b743456 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java @@ -12,16 +12,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -46,18 +46,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java index ec14d76b41f8..50aa303e7aef 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java @@ -15,13 +15,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -52,18 +52,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java index 80b1d783b33e..7d0207c02586 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java @@ -11,10 +11,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java index 221a9f305912..2ef166c28380 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java @@ -11,28 +11,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java index 63ed0f01c34b..1fa710bf5bc1 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java @@ -35,14 +35,14 @@ private PetApiController(PetApiControllerImpInterface imp) { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -106,14 +106,14 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -124,14 +124,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -144,7 +144,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java index 6c5234d33bc7..ed9b151a2388 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java @@ -12,7 +12,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -40,7 +40,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java index 05a5a2002fb3..144362644aff 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -22,7 +22,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java index 214a6a6afb46..029baa761df4 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java @@ -54,14 +54,14 @@ public Result getOrderById(Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); JsonNode result = mapper.valueToTree(obj); return ok(result); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java index fb964dab3edc..b0d2d8f88a14 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java @@ -28,7 +28,7 @@ public Order getOrderById(Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java index 33f503ffd7fe..7a9c3fd82e85 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java @@ -17,6 +17,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById(Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 03e8392793c9..9b78e828229c 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -34,40 +34,40 @@ private UserApiController(UserApiControllerImpInterface imp) { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -113,14 +113,14 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java index cc9d1fdc8b45..8bf12fe7c82f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java @@ -11,17 +11,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -48,7 +48,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java index fdb3d301177d..8c5a5ee0af64 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java @@ -11,11 +11,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -25,6 +25,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java index 0fdd8c3cb4a8..6c40f54de9d6 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java @@ -79,6 +79,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-no-exception-handling/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java index 3bbbe36662a3..f94630bf20c4 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java @@ -40,17 +40,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws IOException { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -127,17 +127,17 @@ public Result getPetById(Long petId) { @ApiAction public Result updatePet() throws IOException { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -148,14 +148,14 @@ public Result updatePetWithForm(Long petId) { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -168,7 +168,7 @@ public Result uploadFile(Long petId) { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java index 2e129c9336f1..e8d4a8b504a1 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) { + public void addPet(Pet body) { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) { } @Override - public void updatePet(Pet pet) { + public void updatePet(Pet body) { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java index eaa035009c25..6efc073d0f28 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) ; + void addPet(Pet body) ; void deletePet(Long petId, String apiKey) ; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) ; - void updatePet(Pet pet) ; + void updatePet(Pet body) ; void updatePetWithForm(Long petId, String name, String status) ; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java index 0a29344d5eac..0836d1945e21 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java @@ -62,17 +62,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) { @ApiAction public Result placeOrder() throws IOException { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java index e5cab1016f2c..6406ee40e1fe 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) { } @Override - public Order placeOrder(Order order) { + public Order placeOrder(Order body) { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java index 9a61d254de2a..70d313028c6e 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) ; - Order placeOrder(Order order) ; + Order placeOrder(Order body) ; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index 1b5d4522954a..07e8f8316181 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -39,53 +39,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws IOException { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws IOException { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws IOException { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -134,17 +134,17 @@ public Result logoutUser() { @ApiAction public Result updateUser(String username) throws IOException { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java index 979dfab18ac9..a6a588b6c8e2 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) { + public void createUser(User body) { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) { + public void createUsersWithArrayInput(List body) { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) { + public void createUsersWithListInput(List body) { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() { } @Override - public void updateUser(String username, User user) { + public void updateUser(String username, User body) { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java index 3d48559fd3ef..c79d4b93820f 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) ; + void createUser(User body) ; - void createUsersWithArrayInput(List user) ; + void createUsersWithArrayInput(List body) ; - void createUsersWithListInput(List user) ; + void createUsersWithListInput(List body) ; void deleteUser(String username) ; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() ; - void updateUser(String username, User user) ; + void updateUser(String username, User body) ; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-no-interface/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java index 74dc88d8ad67..dc9fa0cbbdf1 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImp imp) { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java index 15bee18486e5..3af35ea53033 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp { - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java index e84ba99993d3..db21a0523d9e 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java index 5ee1178d5ffd..119afe97fbff 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index d0e01ef7720b..d4365213a672 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImp imp) @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java index f4e968cc679e..569811fe0954 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp { - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-no-swagger-ui/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java index 8dff19402378..1344ffe7afb1 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java index 2cd201c4bc35..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java index 961632675800..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java index 03d64c1346ca..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index 439fa190f586..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} 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 dde25ef08e8c..0e97bd19efbf 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 @@ -3.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/java-play-framework-no-wrap-calls/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java index 9e1c362bfb08..9059f7e2d912 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java @@ -38,17 +38,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -125,17 +125,17 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -146,14 +146,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -166,7 +166,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java index 2cd201c4bc35..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java index 961632675800..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java index 5c73582f93d2..da1876d0b998 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java @@ -60,17 +60,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 9dd1065fa8ea..6bb020422605 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -37,53 +37,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -132,17 +132,17 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java index fca771cfb00a..aff8786b457a 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java @@ -93,6 +93,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index dde25ef08e8c..0e97bd19efbf 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -3.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/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index 5e5ff3762945..627f21f8c09b 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 8dff19402378..1344ffe7afb1 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java index 2cd201c4bc35..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java index 961632675800..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index 03d64c1346ca..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 439fa190f586..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework/public/openapi.json b/samples/server/petstore/java-play-framework/public/openapi.json index ac1d45047828..50b8a7373199 100644 --- a/samples/server/petstore/java-play-framework/public/openapi.json +++ b/samples/server/petstore/java-play-framework/public/openapi.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,34 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "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", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +72,189 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/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" ], - "default" : "available" - } - } + "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "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" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "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" : { @@ -236,34 +266,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -272,12 +303,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" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/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" : { @@ -349,13 +349,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" } } } @@ -364,58 +364,57 @@ }, "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" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,38 +438,65 @@ "$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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "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", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -482,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "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", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "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" ], "x-accepts" : "application/json" } }, "/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" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "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" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "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" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$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" ], "x-accepts" : "application/json" }, "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" : { @@ -747,45 +776,23 @@ } } }, + "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-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "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", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,76 +800,85 @@ "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "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" @@ -883,118 +899,113 @@ "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", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "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" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "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" @@ -1003,17 +1014,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", @@ -1022,12 +1028,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/java-vertx/async/pom.xml b/samples/server/petstore/java-vertx/async/pom.xml index 0d89408e84d0..ebb71face287 100644 --- a/samples/server/petstore/java-vertx/async/pom.xml +++ b/samples/server/petstore/java-vertx/async/pom.xml @@ -14,7 +14,7 @@ 1.8 4.12 3.4.1 - 3.3 + 3.8.1 1.4.0 2.3 2.7.4 diff --git a/samples/server/petstore/java-vertx/rx/pom.xml b/samples/server/petstore/java-vertx/rx/pom.xml index bc586ffa263c..95c666375ea8 100644 --- a/samples/server/petstore/java-vertx/rx/pom.xml +++ b/samples/server/petstore/java-vertx/rx/pom.xml @@ -14,7 +14,7 @@ 1.8 4.12 3.4.1 - 3.3 + 3.8.1 1.4.0 2.3 2.7.4 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 2f81801b7943..0e97bd19efbf 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 @@ -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/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java index 66e33710952f..6cbeaf819529 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/model/Pet.java @@ -29,7 +29,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.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/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java index 36bd085083e8..d193b8aebb0c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Pet.java @@ -24,7 +24,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; 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 2f81801b7943..0e97bd19efbf 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 @@ -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/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java index 66e33710952f..6cbeaf819529 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/model/Pet.java @@ -29,7 +29,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.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/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java index fcc0d030d6ad..0f10d00a16a0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java @@ -177,9 +177,16 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); + + @PUT + @Path("/fake/test-query-paramters") + @ApiOperation(value = "", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 55d130563993..964f668d2c34 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -50,15 +50,15 @@ public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @Valid - private Object anytype1 = null; + private Object anytype1; @ApiModelProperty(value = "") @Valid - private Object anytype2 = null; + private Object anytype2; @ApiModelProperty(value = "") @Valid - private Object anytype3 = null; + private Object anytype3; /** * Get mapString * @return mapString diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 0b513ba821a1..50f7d73ed0d5 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -19,7 +19,7 @@ public class FileSchemaTestClass { @ApiModelProperty(value = "") @Valid - private java.io.File file = null; + private java.io.File file; @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java index ca8f0a370b37..3042dd056482 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java @@ -24,7 +24,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java index 9d82e8ca2f0e..04715a41c388 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -25,6 +25,9 @@ public class TypeHolderExample { @Valid private BigDecimal numberItem; + @ApiModelProperty(example = "1.234", required = true, value = "") + private Float floatItem; + @ApiModelProperty(example = "-2", required = true, value = "") private Integer integerItem; @@ -71,6 +74,25 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { return this; } + /** + * Get floatItem + * @return floatItem + **/ + @JsonProperty("float_item") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + /** * Get integerItem * @return integerItem @@ -141,6 +163,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 5857b27c3eb2..8e4b6ab67eae 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -148,5 +148,11 @@ public void testJsonFormData(String param, String param2) { } + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + // TODO: Implement... + + + } + } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java index 55ea1b445665..ddaddcf81411 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java @@ -313,4 +313,22 @@ public void testJsonFormDataTest() { } + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + + // TODO: test validations + + + } + } diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.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/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index 726d5bf768ab..dcf098f9613b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -256,6 +256,22 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "",required=true)@QueryParam("pipe") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java index 834fcfed4827..4565d8b002a5 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java @@ -40,5 +40,6 @@ public abstract class FakeApiService { public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group,Integer stringGroup,Boolean booleanGroup,Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map param,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 76bd7bda482a..29b9b6c3da23 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 9b192d8bc404..fd0557663049 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,9 @@ /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 53b59254da2b..2eb789716c6b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index f53002ba085d..1720475a7c41 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -29,6 +30,19 @@ /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass implements Serializable { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; @@ -65,15 +79,15 @@ public class AdditionalPropertiesClass implements Serializable { public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 910a0a140757..9ce92e3d63cd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 0604b2f09734..cfebd26c3109 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,9 @@ /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index a5fc827456fb..1d4f7d6eb48a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 91afde4e5da4..6b42e35df749 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java index 1213a4a57f30..841c01f67b88 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,10 @@ /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index c0c05a2cc840..7da62dea34f9 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,9 @@ /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly implements Serializable { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 128a94f550d2..410144097af0 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,9 @@ /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly implements Serializable { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java index d69678fed7e6..54097f361644 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,11 @@ /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest implements Serializable { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java index 19cda7e37235..6223662a3346 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,14 @@ /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization implements Serializable { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java index 3a4f8b5c5fc3..f483ecdb4741 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal implements Serializable { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java index 3ffd449fbae0..3f722c3987c4 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf implements Serializable { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java index a5620a90754a..1bac9ac7a832 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category implements Serializable { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java index 2f88bc344f85..650c68f9c5da 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -26,6 +27,9 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel implements Serializable { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java index 9044569e11d3..250c3e4c6347 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client implements Serializable { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java index 2d3f0ae54a74..5afd89d2233e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,9 @@ /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal implements Serializable { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java index 8c0474710c6c..5f6b3f06d3d4 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf implements Serializable { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java index a22a11383e8b..99e0430ef37a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,10 @@ /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays implements Serializable { /** diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumClass.java index 19d50b8828ae..3aac98ef17d2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index 4cf22d06585d..6369f5d42894 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,13 @@ /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest implements Serializable { /** diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 3a085b53df33..acbb3d0ff3b0 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,11 +28,15 @@ /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass implements Serializable { public static final String JSON_PROPERTY_FILE = "file"; @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java index b9d199895703..e58cb7798bf2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java @@ -23,6 +23,7 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -30,6 +31,21 @@ /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest implements Serializable { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index c844a811e53c..d0cae4f593f2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly implements Serializable { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 7ff777de2baa..a2abdc35bd6d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -29,6 +30,12 @@ /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest implements Serializable { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index dea3ce1e4605..5103814c4d39 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -31,6 +32,11 @@ /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java index cf9d920bd67c..448a3698f58a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -26,6 +27,10 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java index dae73bd1a353..9a5641ef8e5f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,11 @@ /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse implements Serializable { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java index a559626ec06b..dd530ff2025e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -26,6 +27,9 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn implements Serializable { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java index 7e8038ea3411..d4748ab32aaa 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -26,6 +27,12 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name implements Serializable { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java index e5c392741b5c..79945cb9d63f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -26,6 +27,9 @@ /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly implements Serializable { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java index ded72798bcd3..18d5f7198ce6 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -27,6 +28,14 @@ /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order implements Serializable { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java index a8955b79e4da..06f28bfe8d23 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -26,6 +27,11 @@ /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite implements Serializable { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterEnum.java index 3efde12881f5..e89abf334221 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java index d8bbd3edc3a6..9c7856935f86 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java @@ -23,6 +23,7 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -30,6 +31,14 @@ /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet implements Serializable { public static final String JSON_PROPERTY_ID = "id"; @@ -38,7 +47,7 @@ public class Pet implements Serializable { public static final String JSON_PROPERTY_CATEGORY = "category"; @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index d7c813279191..c63d00711dfb 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst implements Serializable { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java index 64e5c42dbd16..90c282efa49f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName implements Serializable { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java index 6800d8660b6b..a61318af7a46 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag implements Serializable { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java index e390947e2ff8..59df1a2c2efe 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,13 @@ /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault implements Serializable { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java index 85adfbb4f1c9..e829f9544261 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,14 @@ /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample implements Serializable { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; @@ -38,6 +47,10 @@ public class TypeHolderExample implements Serializable { @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; @@ -90,6 +103,26 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @JsonProperty("float_item") + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -167,6 +200,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -174,7 +208,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -185,6 +219,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java index b4df90e90945..600f1dd00cbd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,16 @@ /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User implements Serializable { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java index 3bc454bcc1c3..be17e1d84eff 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -28,6 +29,37 @@ /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem implements Serializable { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index cd0ac7e1e58a..ffd3185fe0a1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -93,6 +93,11 @@ public Response testJsonFormData(String param, String param2, SecurityContext se return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.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/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index a89e7df0c2a2..c97675926f7c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -256,6 +256,22 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "",required=true)@QueryParam("pipe") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index f42f7694ef63..ffb6a868cdda 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -39,5 +39,6 @@ public abstract class FakeApiService { public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group,Integer stringGroup,Boolean booleanGroup,Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 8b19fc6c1d2a..e4e94143383a 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -21,12 +21,17 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java index 196a01e7ec4d..b92746816fe0 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java @@ -20,12 +20,17 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index dd585cbc5d43..b61d1fabdc40 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e6ce7cdead2b..c2955daa575f 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java index a90ffb024264..a8ef31cdb79c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,12 +21,18 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java index 61c0f797129c..4db559dc7b31 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java @@ -18,12 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java index bf7893083ce2..bb3bad972102 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java index af37e2895961..d8bf140b58c5 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java index 74caab13ae25..1a39a7ccaf6b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java index 18d53d76e4b8..98ba52298ad3 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java index 0b9ce9c74e0b..cd1b6b08a63d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java index 831f704b6a90..6d0a7a90f828 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java index 4de5a238f00f..2551f2285c4c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java index 87593bd9fb41..5e6c640c3ebe 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java @@ -21,12 +21,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumClass.java index 9cd6c56f34cf..c9e85144ad11 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index f33a932689d7..a087fa931b26 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -23,12 +23,23 @@ import org.openapitools.model.OuterEnumDefaultValue; import org.openapitools.model.OuterEnumInteger; import org.openapitools.model.OuterEnumIntegerDefaultValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE +}) public class EnumTest { /** diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2c86b3fda551..4e3ec6a2cf81 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -20,17 +20,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java index ce5db3d6983f..0aea624b8736 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Foo */ +@JsonPropertyOrder({ + Foo.JSON_PROPERTY_BAR +}) public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java index 7b031a6979e2..e636b8c5a550 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java @@ -22,12 +22,30 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1e3b44e61877..30d9c4fccf93 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java index c8f37b3d367e..1bf90f377271 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. */ @ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonPropertyOrder({ + HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE +}) public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java index 3ff2df8be6d7..ab8ba1517504 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineObject */ +@JsonPropertyOrder({ + InlineObject.JSON_PROPERTY_NAME, + InlineObject.JSON_PROPERTY_STATUS +}) public class InlineObject { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java index 89a32d73a634..e2b3f9b5a82c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java @@ -19,12 +19,17 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineObject1 */ +@JsonPropertyOrder({ + InlineObject1.JSON_PROPERTY_ADDITIONAL_METADATA, + InlineObject1.JSON_PROPERTY_FILE +}) public class InlineObject1 { public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java index 09e12a0f7115..0d8faf7fb74b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java @@ -21,12 +21,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineObject2 */ +@JsonPropertyOrder({ + InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING_ARRAY, + InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING +}) public class InlineObject2 { /** diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java index 1d390c656835..89c6511971f6 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java @@ -21,12 +21,29 @@ import java.io.File; import java.math.BigDecimal; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineObject3 */ +@JsonPropertyOrder({ + InlineObject3.JSON_PROPERTY_INTEGER, + InlineObject3.JSON_PROPERTY_INT32, + InlineObject3.JSON_PROPERTY_INT64, + InlineObject3.JSON_PROPERTY_NUMBER, + InlineObject3.JSON_PROPERTY_FLOAT, + InlineObject3.JSON_PROPERTY_DOUBLE, + InlineObject3.JSON_PROPERTY_STRING, + InlineObject3.JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER, + InlineObject3.JSON_PROPERTY_BYTE, + InlineObject3.JSON_PROPERTY_BINARY, + InlineObject3.JSON_PROPERTY_DATE, + InlineObject3.JSON_PROPERTY_DATE_TIME, + InlineObject3.JSON_PROPERTY_PASSWORD, + InlineObject3.JSON_PROPERTY_CALLBACK +}) public class InlineObject3 { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java index da323853d86a..5aa12b96554e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineObject4 */ +@JsonPropertyOrder({ + InlineObject4.JSON_PROPERTY_PARAM, + InlineObject4.JSON_PROPERTY_PARAM2 +}) public class InlineObject4 { public static final String JSON_PROPERTY_PARAM = "param"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java index 6b822c410dfd..16cf25fff1ec 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java @@ -19,12 +19,17 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.File; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineObject5 */ +@JsonPropertyOrder({ + InlineObject5.JSON_PROPERTY_ADDITIONAL_METADATA, + InlineObject5.JSON_PROPERTY_REQUIRED_FILE +}) public class InlineObject5 { public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java index d1a5d14dace1..1095d685c6c8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java @@ -19,17 +19,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Foo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * InlineResponseDefault */ +@JsonPropertyOrder({ + InlineResponseDefault.JSON_PROPERTY_STRING +}) public class InlineResponseDefault { public static final String JSON_PROPERTY_STRING = "string"; @JsonProperty(JSON_PROPERTY_STRING) - private Foo string = null; + private Foo string; public InlineResponseDefault string(Foo string) { this.string = string; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java index df661e027e9d..497f98c1fb5f 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java @@ -22,12 +22,19 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index e6c0672c5ca9..e8ff1a269768 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,12 +24,18 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java index 0780d4322415..00901b890aea 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1b5c00664cab..8355a7526b68 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -18,12 +18,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java index 98e64dd70f36..a979d5e6fce5 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java index edf4368c9a11..5d4da98047b2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,12 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java index 37b9e807a59b..8d921d2cda45 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java @@ -24,12 +24,27 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NullableClass */ +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) public class NullableClass extends HashMap { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java index 15da555feb41..633e2e339ed9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java @@ -19,12 +19,16 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java index 4000d7fca78d..10fa5da35a9f 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java @@ -20,12 +20,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java index ee344471fc0d..448638abd374 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java @@ -19,12 +19,18 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnum.java index 1c1eb9c84c43..2b86eb9957c4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java index dfb431fd37d7..4b216b220ae8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumInteger.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumInteger.java index 25c1f7afe7e4..fb39156bca9f 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumInteger.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumInteger.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java index 138cb4157676..53764f30d0d2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java index 086c625aa3be..29963f3d63b4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java @@ -23,12 +23,21 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; @@ -37,7 +46,7 @@ public class Pet { public static final String JSON_PROPERTY_CATEGORY = "category"; @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 1e59f1624a19..447b43cb5010 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java index f7e88175fe9a..bdac9955e968 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java index d610b60e8ca6..35305769a2d2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java index 5df67fece765..23b9f6e3cee4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java @@ -18,12 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index fe6f25e1aaac..6e2fb3f06f8e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -92,6 +92,11 @@ public Response testJsonFormData(String param, String param2, SecurityContext se return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.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/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java index 1c5e279af808..f2cc2bd04df5 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java @@ -18,7 +18,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; private List photoUrls = new ArrayList(); private List tags = new ArrayList(); 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 2f81801b7943..0e97bd19efbf 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 @@ -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/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/Pet.java index e232871536e8..e83dd5c7d8c9 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; 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 2f81801b7943..0e97bd19efbf 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 @@ -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/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java index c02814218624..81b8a7ff5a57 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.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/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java index c02814218624..81b8a7ff5a57 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.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/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java index 1c5e279af808..f2cc2bd04df5 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java @@ -18,7 +18,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; private List photoUrls = new ArrayList(); private List tags = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.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/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java index 3a5c58f415aa..c065aca629a8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java @@ -131,6 +131,13 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + @PUT + @Path("/test-query-paramters") + @ApiOperation(value = "", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) }) + void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); + @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 06ef5eeec8f0..c70f3d5171d5 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -28,9 +28,9 @@ public class AdditionalPropertiesClass implements Serializable { private @Valid Map> mapArrayAnytype = new HashMap>(); private @Valid Map> mapMapString = new HashMap>(); private @Valid Map> mapMapAnytype = new HashMap>(); - private @Valid Object anytype1 = null; - private @Valid Object anytype2 = null; - private @Valid Object anytype3 = null; + private @Valid Object anytype1; + private @Valid Object anytype2; + private @Valid Object anytype3; /** **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index f40b18f1cbd7..e97c11e0df28 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -18,7 +18,7 @@ public class FileSchemaTestClass implements Serializable { - private @Valid java.io.File file = null; + private @Valid java.io.File file; private @Valid List files = new ArrayList(); /** diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index 5e22807ad680..6718025e6926 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -21,7 +21,7 @@ public class Pet implements Serializable { private @Valid Long id; - private @Valid Category category = null; + private @Valid Category category; private @Valid String name; private @Valid List photoUrls = new ArrayList(); private @Valid List tags = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java index c97a19122069..d7c9125b74fa 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,6 +21,7 @@ public class TypeHolderExample implements Serializable { private @Valid String stringItem; private @Valid BigDecimal numberItem; + private @Valid Float floatItem; private @Valid Integer integerItem; private @Valid Boolean boolItem; private @Valid List arrayItem = new ArrayList(); @@ -61,6 +62,24 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + /** + **/ + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") + @NotNull + public Float getFloatItem() { + return floatItem; + } + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + /** **/ public TypeHolderExample integerItem(Integer integerItem) { @@ -127,6 +146,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -134,7 +154,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -144,6 +164,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 67ecc530a56d..4482ec16b70b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -875,6 +875,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1228,6 +1229,62 @@ paths: x-accepts: application/json x-tags: - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1947,6 +2004,10 @@ components: number_item: example: 1.234 type: number + float_item: + example: 1.234 + format: float + type: number integer_item: example: -2 type: integer @@ -1965,6 +2026,7 @@ components: required: - array_item - bool_item + - float_item - integer_item - number_item - string_item diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.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/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index 45b188173203..37d6206104a3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -170,6 +170,16 @@ public Response testJsonFormData(@FormParam(value = "param") String param,@Form return Response.ok().entity("magic!").build(); } + @PUT + @Path("/test-query-paramters") + @ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) + }) + public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context) { + return Response.ok().entity("magic!").build(); + } + @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 06ef5eeec8f0..c70f3d5171d5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -28,9 +28,9 @@ public class AdditionalPropertiesClass implements Serializable { private @Valid Map> mapArrayAnytype = new HashMap>(); private @Valid Map> mapMapString = new HashMap>(); private @Valid Map> mapMapAnytype = new HashMap>(); - private @Valid Object anytype1 = null; - private @Valid Object anytype2 = null; - private @Valid Object anytype3 = null; + private @Valid Object anytype1; + private @Valid Object anytype2; + private @Valid Object anytype3; /** **/ diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index f40b18f1cbd7..e97c11e0df28 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -18,7 +18,7 @@ public class FileSchemaTestClass implements Serializable { - private @Valid java.io.File file = null; + private @Valid java.io.File file; private @Valid List files = new ArrayList(); /** diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 5e22807ad680..6718025e6926 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -21,7 +21,7 @@ public class Pet implements Serializable { private @Valid Long id; - private @Valid Category category = null; + private @Valid Category category; private @Valid String name; private @Valid List photoUrls = new ArrayList(); private @Valid List tags = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java index c97a19122069..d7c9125b74fa 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,6 +21,7 @@ public class TypeHolderExample implements Serializable { private @Valid String stringItem; private @Valid BigDecimal numberItem; + private @Valid Float floatItem; private @Valid Integer integerItem; private @Valid Boolean boolItem; private @Valid List arrayItem = new ArrayList(); @@ -61,6 +62,24 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + /** + **/ + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") + @NotNull + public Float getFloatItem() { + return floatItem; + } + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + /** **/ public TypeHolderExample integerItem(Integer integerItem) { @@ -127,6 +146,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -134,7 +154,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -144,6 +164,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 67ecc530a56d..4482ec16b70b 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -875,6 +875,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1228,6 +1229,62 @@ paths: x-accepts: application/json x-tags: - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1947,6 +2004,10 @@ components: number_item: example: 1.234 type: number + float_item: + example: 1.234 + format: float + type: number integer_item: example: -2 type: integer @@ -1965,6 +2026,7 @@ components: required: - array_item - bool_item + - float_item - integer_item - number_item - string_item diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.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/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java index b1b5f9315841..856c8fefbb6d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -232,7 +232,7 @@ public Response testInlineAdditionalProperties( @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( @@ -242,4 +242,21 @@ public Response testJsonFormData( throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat( + @ApiParam(value = "",required=true)@QueryParam("pipe") List pipe, + @ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil, + @ApiParam(value = "",required=true)@QueryParam("http") List http, + @ApiParam(value = "",required=true)@QueryParam("url") List url, + @ApiParam(value = "",required=true)@QueryParam("context") List context, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe,ioutil,http,url,context,securityContext); + } } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index 95092e85b4fd..86e8f3040d8e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -54,4 +54,6 @@ public abstract Response testInlineAdditionalProperties(Map para throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,SecurityContext securityContext) + throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 47156768c391..d6a652a1114f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 201ecdca22aa..64a756fcb61d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -21,12 +21,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 93c6b3d06233..333a1d0e3508 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 76cb99844c94..e46e60d0aeab 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,12 +22,26 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; @@ -64,15 +78,15 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index cbe2aeb620d6..9b850704be77 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 4d865d10914f..5ed8962462e6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index a810b4e281c2..bff07e2b6ac7 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 338cd8fd95d0..f957a853e20c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java index 196a01e7ec4d..b92746816fe0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -20,12 +20,17 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index dd585cbc5d43..b61d1fabdc40 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e6ce7cdead2b..c2955daa575f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index a90ffb024264..a8ef31cdb79c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,12 +21,18 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java index 61c0f797129c..4db559dc7b31 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java @@ -18,12 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java index bf7893083ce2..bb3bad972102 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index af37e2895961..d8bf140b58c5 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java index 74caab13ae25..1a39a7ccaf6b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java index 18d53d76e4b8..98ba52298ad3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java index 0b9ce9c74e0b..cd1b6b08a63d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java index 831f704b6a90..6d0a7a90f828 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index 4de5a238f00f..2551f2285c4c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index 87593bd9fb41..5e6c640c3ebe 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -21,12 +21,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumClass.java index 9cd6c56f34cf..c9e85144ad11 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 35f24f090f1c..ab576f99ef97 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -20,12 +20,20 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2c86b3fda551..4e3ec6a2cf81 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -20,17 +20,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java index 34ad45203ba7..e582bb62858e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -22,12 +22,28 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1e3b44e61877..30d9c4fccf93 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index df661e027e9d..497f98c1fb5f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -22,12 +22,19 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index e6c0672c5ca9..e8ff1a269768 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,12 +24,18 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java index 0780d4322415..00901b890aea 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1b5c00664cab..8355a7526b68 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -18,12 +18,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index 98e64dd70f36..a979d5e6fce5 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java index edf4368c9a11..5d4da98047b2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,12 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java index 15da555feb41..633e2e339ed9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java @@ -19,12 +19,16 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java index 4000d7fca78d..10fa5da35a9f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java @@ -20,12 +20,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index ee344471fc0d..448638abd374 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -19,12 +19,18 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterEnum.java index 06362e3365ec..7caf1a1ea1c2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java index 086c625aa3be..29963f3d63b4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -23,12 +23,21 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; @@ -37,7 +46,7 @@ public class Pet { public static final String JSON_PROPERTY_CATEGORY = "category"; @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 1e59f1624a19..447b43cb5010 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index 19b09742162f..4ad8f3205a0a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java index d610b60e8ca6..35305769a2d2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 18a173dd67e2..583a592963a8 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -21,12 +21,20 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 0ff32afc6930..2f29a40a22b7 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,12 +21,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; @@ -37,6 +46,10 @@ public class TypeHolderExample { @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; @@ -89,6 +102,26 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @JsonProperty("float_item") + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -166,6 +199,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -173,7 +207,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -184,6 +218,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java index 5df67fece765..23b9f6e3cee4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java @@ -18,12 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java index b00981431881..fa69d67a9e68 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -21,12 +21,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 210912ff3b7d..69b3c0f3b0b3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -106,4 +106,10 @@ public Response testJsonFormData(String param, String param2, SecurityContext se // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.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/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java index 794c4cddd0dd..0da73135d8ec 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java @@ -243,6 +243,23 @@ public Response testJsonFormData( throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat( + @ApiParam(value = "",required=true)@QueryParam("pipe") List pipe, + @ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil, + @ApiParam(value = "",required=true)@QueryParam("http") List http, + @ApiParam(value = "",required=true)@QueryParam("url") List url, + @ApiParam(value = "",required=true)@QueryParam("context") List context, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe,ioutil,http,url,context,securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java index dd2132bdad12..502afbcfccce 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java @@ -55,6 +55,8 @@ public abstract Response testInlineAdditionalProperties(Map para throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,SecurityContext securityContext) + throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 47156768c391..d6a652a1114f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 201ecdca22aa..64a756fcb61d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -21,12 +21,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 93c6b3d06233..333a1d0e3508 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 76cb99844c94..e46e60d0aeab 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,12 +22,26 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; @@ -64,15 +78,15 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index cbe2aeb620d6..9b850704be77 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 4d865d10914f..5ed8962462e6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index a810b4e281c2..bff07e2b6ac7 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 338cd8fd95d0..f957a853e20c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java index 196a01e7ec4d..b92746816fe0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java @@ -20,12 +20,17 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index dd585cbc5d43..b61d1fabdc40 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e6ce7cdead2b..c2955daa575f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java index a90ffb024264..a8ef31cdb79c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,12 +21,18 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java index 61c0f797129c..4db559dc7b31 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java @@ -18,12 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java index bf7893083ce2..bb3bad972102 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java index af37e2895961..d8bf140b58c5 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java index 74caab13ae25..1a39a7ccaf6b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java index 18d53d76e4b8..98ba52298ad3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java index 0b9ce9c74e0b..cd1b6b08a63d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java index 831f704b6a90..6d0a7a90f828 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java index 4de5a238f00f..2551f2285c4c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java index 87593bd9fb41..5e6c640c3ebe 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java @@ -21,12 +21,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumClass.java index 9cd6c56f34cf..c9e85144ad11 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index 35f24f090f1c..ab576f99ef97 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -20,12 +20,20 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2c86b3fda551..4e3ec6a2cf81 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -20,17 +20,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java index 34ad45203ba7..e582bb62858e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java @@ -22,12 +22,28 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1e3b44e61877..30d9c4fccf93 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index df661e027e9d..497f98c1fb5f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -22,12 +22,19 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index e6c0672c5ca9..e8ff1a269768 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,12 +24,18 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java index 0780d4322415..00901b890aea 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1b5c00664cab..8355a7526b68 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -18,12 +18,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java index 98e64dd70f36..a979d5e6fce5 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java index edf4368c9a11..5d4da98047b2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,12 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java index 15da555feb41..633e2e339ed9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java @@ -19,12 +19,16 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java index 4000d7fca78d..10fa5da35a9f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java @@ -20,12 +20,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java index ee344471fc0d..448638abd374 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java @@ -19,12 +19,18 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterEnum.java index 06362e3365ec..7caf1a1ea1c2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java index 086c625aa3be..29963f3d63b4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java @@ -23,12 +23,21 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; @@ -37,7 +46,7 @@ public class Pet { public static final String JSON_PROPERTY_CATEGORY = "category"; @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 1e59f1624a19..447b43cb5010 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java index 19b09742162f..4ad8f3205a0a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java index d610b60e8ca6..35305769a2d2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 18a173dd67e2..583a592963a8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -21,12 +21,20 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java index 0ff32afc6930..2f29a40a22b7 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,12 +21,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; @@ -37,6 +46,10 @@ public class TypeHolderExample { @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; @@ -89,6 +102,26 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @JsonProperty("float_item") + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -166,6 +199,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -173,7 +207,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -184,6 +218,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java index 5df67fece765..23b9f6e3cee4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java @@ -18,12 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java index b00981431881..fa69d67a9e68 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java @@ -21,12 +21,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 258dbb0f8647..7215c33e6247 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -108,6 +108,12 @@ public Response testJsonFormData(String param, String param2, SecurityContext se return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.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/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 177e149f8bb9..4d1751d9eeb5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -254,4 +254,20 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "",required=true)@QueryParam("pipe") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index dd457eb201fb..561cd7ba2a5a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -38,4 +38,5 @@ public abstract class FakeApiService { public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group,Integer stringGroup,Boolean booleanGroup,Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map param,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 47156768c391..d6a652a1114f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 201ecdca22aa..64a756fcb61d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -21,12 +21,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 93c6b3d06233..333a1d0e3508 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 76cb99844c94..e46e60d0aeab 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,12 +22,26 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; @@ -64,15 +78,15 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index cbe2aeb620d6..9b850704be77 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 4d865d10914f..5ed8962462e6 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index a810b4e281c2..bff07e2b6ac7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 338cd8fd95d0..f957a853e20c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java index 196a01e7ec4d..b92746816fe0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -20,12 +20,17 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index dd585cbc5d43..b61d1fabdc40 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e6ce7cdead2b..c2955daa575f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index a90ffb024264..a8ef31cdb79c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,12 +21,18 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java index 61c0f797129c..4db559dc7b31 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java @@ -18,12 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java index bf7893083ce2..bb3bad972102 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index af37e2895961..d8bf140b58c5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java index 74caab13ae25..1a39a7ccaf6b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java index 18d53d76e4b8..98ba52298ad3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java index 0b9ce9c74e0b..cd1b6b08a63d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java index 831f704b6a90..6d0a7a90f828 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index 4de5a238f00f..2551f2285c4c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index 87593bd9fb41..5e6c640c3ebe 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -21,12 +21,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumClass.java index 9cd6c56f34cf..c9e85144ad11 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 35f24f090f1c..ab576f99ef97 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -20,12 +20,20 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2c86b3fda551..4e3ec6a2cf81 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -20,17 +20,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java index 34ad45203ba7..e582bb62858e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -22,12 +22,28 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1e3b44e61877..30d9c4fccf93 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index df661e027e9d..497f98c1fb5f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -22,12 +22,19 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index e6c0672c5ca9..e8ff1a269768 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,12 +24,18 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java index 0780d4322415..00901b890aea 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1b5c00664cab..8355a7526b68 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -18,12 +18,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index 98e64dd70f36..a979d5e6fce5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java index edf4368c9a11..5d4da98047b2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,12 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java index 15da555feb41..633e2e339ed9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java @@ -19,12 +19,16 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java index 4000d7fca78d..10fa5da35a9f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java @@ -20,12 +20,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index ee344471fc0d..448638abd374 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -19,12 +19,18 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterEnum.java index 06362e3365ec..7caf1a1ea1c2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java index 086c625aa3be..29963f3d63b4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -23,12 +23,21 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; @@ -37,7 +46,7 @@ public class Pet { public static final String JSON_PROPERTY_CATEGORY = "category"; @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 1e59f1624a19..447b43cb5010 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index 19b09742162f..4ad8f3205a0a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java index d610b60e8ca6..35305769a2d2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 18a173dd67e2..583a592963a8 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -21,12 +21,20 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 0ff32afc6930..2f29a40a22b7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,12 +21,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; @@ -37,6 +46,10 @@ public class TypeHolderExample { @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; @@ -89,6 +102,26 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @JsonProperty("float_item") + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -166,6 +199,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -173,7 +207,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -184,6 +218,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java index 5df67fece765..23b9f6e3cee4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java @@ -18,12 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java index b00981431881..fa69d67a9e68 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -21,12 +21,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index fd583260f591..8dbd3ce48f75 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -90,4 +90,9 @@ public Response testJsonFormData(String param, String param2, SecurityContext se // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.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/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 0110d936790c..ce969dddcc9f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -255,6 +255,22 @@ public Response testJsonFormData(@ApiParam(value = "field1", required=true) @Fo throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "",required=true)@QueryParam("pipe") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java index 9b2c44ef2a7a..4b9b5aa80e25 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java @@ -39,5 +39,6 @@ public abstract class FakeApiService { public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group,Integer stringGroup,Boolean booleanGroup,Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map param,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 47156768c391..d6a652a1114f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesAnyType */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 201ecdca22aa..64a756fcb61d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -21,12 +21,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesArray */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 93c6b3d06233..333a1d0e3508 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesBoolean */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 76cb99844c94..e46e60d0aeab 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,12 +22,26 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesClass */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; @@ -64,15 +78,15 @@ public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; @JsonProperty(JSON_PROPERTY_ANYTYPE1) - private Object anytype1 = null; + private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; @JsonProperty(JSON_PROPERTY_ANYTYPE2) - private Object anytype2 = null; + private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; @JsonProperty(JSON_PROPERTY_ANYTYPE3) - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index cbe2aeb620d6..9b850704be77 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesInteger */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 4d865d10914f..5ed8962462e6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesNumber */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index a810b4e281c2..bff07e2b6ac7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesObject */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 338cd8fd95d0..f957a853e20c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * AdditionalPropertiesString */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java index 196a01e7ec4d..b92746816fe0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java @@ -20,12 +20,17 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Animal */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index dd585cbc5d43..b61d1fabdc40 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e6ce7cdead2b..c2955daa575f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,12 +21,16 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayOfNumberOnly */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java index a90ffb024264..a8ef31cdb79c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,12 +21,18 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ArrayTest */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java index 61c0f797129c..4db559dc7b31 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java @@ -18,12 +18,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Capitalization */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java index bf7893083ce2..bb3bad972102 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Cat */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java index af37e2895961..d8bf140b58c5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * CatAllOf */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java index 74caab13ae25..1a39a7ccaf6b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Category */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java index 18d53d76e4b8..98ba52298ad3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java index 0b9ce9c74e0b..cd1b6b08a63d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Client */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java index 831f704b6a90..6d0a7a90f828 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java @@ -20,12 +20,16 @@ import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import org.openapitools.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Dog */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java index 4de5a238f00f..2551f2285c4c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * DogAllOf */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java index 87593bd9fb41..5e6c640c3ebe 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java @@ -21,12 +21,17 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumArrays */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) public class EnumArrays { /** diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumClass.java index 9cd6c56f34cf..c9e85144ad11 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumClass.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index 35f24f090f1c..ab576f99ef97 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -20,12 +20,20 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * EnumTest */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) public class EnumTest { /** diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2c86b3fda551..4e3ec6a2cf81 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -20,17 +20,22 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FileSchemaTestClass */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; @JsonProperty(JSON_PROPERTY_FILE) - private java.io.File file = null; + private java.io.File file; public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java index 34ad45203ba7..e582bb62858e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java @@ -22,12 +22,28 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * FormatTest */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD +}) public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 1e3b44e61877..30d9c4fccf93 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * HasOnlyReadOnly */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index df661e027e9d..497f98c1fb5f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -22,12 +22,19 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MapTest */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index e6c0672c5ca9..e8ff1a269768 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,12 +24,18 @@ import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java index 0780d4322415..00901b890aea 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,10 @@ * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java index 1b5c00664cab..8355a7526b68 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -18,12 +18,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ModelApiResponse */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java index 98e64dd70f36..a979d5e6fce5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,9 @@ * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java index edf4368c9a11..5d4da98047b2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; @@ -25,6 +26,12 @@ * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java index 15da555feb41..633e2e339ed9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java @@ -19,12 +19,16 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * NumberOnly */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java index 4000d7fca78d..10fa5da35a9f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java @@ -20,12 +20,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Order */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java index ee344471fc0d..448638abd374 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java @@ -19,12 +19,18 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * OuterComposite */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterEnum.java index 06362e3365ec..7caf1a1ea1c2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterEnum.java @@ -15,6 +15,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java index 086c625aa3be..29963f3d63b4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java @@ -23,12 +23,21 @@ import java.util.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Pet */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) public class Pet { public static final String JSON_PROPERTY_ID = "id"; @@ -37,7 +46,7 @@ public class Pet { public static final String JSON_PROPERTY_CATEGORY = "category"; @JsonProperty(JSON_PROPERTY_CATEGORY) - private Category category = null; + private Category category; public static final String JSON_PROPERTY_NAME = "name"; @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 1e59f1624a19..447b43cb5010 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * ReadOnlyFirst */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java index 19b09742162f..4ad8f3205a0a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -18,12 +18,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * SpecialModelName */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java index d610b60e8ca6..35305769a2d2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java @@ -18,12 +18,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * Tag */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 18a173dd67e2..583a592963a8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -21,12 +21,20 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderDefault */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java index 0ff32afc6930..2f29a40a22b7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -21,12 +21,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * TypeHolderExample */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; @@ -37,6 +46,10 @@ public class TypeHolderExample { @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + private Float floatItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; @@ -89,6 +102,26 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @JsonProperty("float_item") + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -166,6 +199,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -173,7 +207,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @@ -184,6 +218,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java index 5df67fece765..23b9f6e3cee4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java @@ -18,12 +18,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * User */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java index b00981431881..fa69d67a9e68 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java @@ -21,12 +21,44 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import javax.validation.constraints.*; import javax.validation.Valid; /** * XmlItem */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index ad1d5f118e21..99af04a85b5b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -92,6 +92,11 @@ public Response testJsonFormData(String param, String param2, SecurityContext se return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.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/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index b0c381f68a70..0cf33dd3eaf3 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 4.1.1-SNAPSHOT. +Generated by OpenAPI Generator 4.1.3-SNAPSHOT. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.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/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.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/kotlin/vertx/.openapi-generator-ignore b/samples/server/petstore/kotlin/vertx/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/.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/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION new file mode 100644 index 000000000000..0e97bd19efbf --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/README.md b/samples/server/petstore/kotlin/vertx/README.md new file mode 100644 index 000000000000..4e9992d66cbf --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/README.md @@ -0,0 +1,81 @@ +# org.openapitools - Kotlin Server library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.10 +* Maven 3.3 + +## Build + +``` +mvn clean package +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs 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. + + + ## 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.server.api.model.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.server.api.model.Category](docs/Category.md) + - [org.openapitools.server.api.model.Order](docs/Order.md) + - [org.openapitools.server.api.model.Pet](docs/Pet.md) + - [org.openapitools.server.api.model.Tag](docs/Tag.md) + - [org.openapitools.server.api.model.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/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml new file mode 100644 index 000000000000..c6f2cbff3e30 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -0,0 +1,190 @@ + + 4.0.0 + + org.openapitools + openapi-kotlin-vertx-server + 1.0.0-SNAPSHOT + jar + + OpenAPI Petstore + + + UTF-8 + 1.8 + 1.3.10 + true + 4.12 + 3.4.1 + 3.8.1 + 1.0.2 + 2.3 + 2.7.4 + 3.6.0 + + + + + junit + junit + ${junit.version} + test + + + + io.vertx + vertx-unit + ${vertx.version} + test + + + + com.github.wooyme + vertx-openapi-router + ${vertx-openapi-router.version} + + + + com.google.code.gson + gson + 2.8.5 + + + + javax.annotation + javax.annotation-api + 1.2 + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlinx + kotlinx-coroutines-core + RELEASE + + + + io.vertx + vertx-core + ${vertx.version} + + + io.vertx + vertx-web + ${vertx.version} + + + + io.vertx + vertx-lang-kotlin + ${vertx.version} + + + + io.vertx + vertx-lang-kotlin-coroutines + ${vertx.version} + + + + io.swagger.parser.v3 + swagger-parser + 2.0.5 + + + + io.vertx + vertx-web-api-contract + ${vertx.version} + + + + io.vertx + vertx-service-proxy + ${vertx.version} + + + + io.vertx + vertx-web-api-service + ${vertx.version} + + + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + compile + + compile + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + 1.8 + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + ${project.basedir}/src/test/java + + 1.8 + + + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + package + + shade + + + + + + org.openapitools.server.api.verticle.DefaultApiVerticleKt + + + + + ${project.build.directory}/${project.artifactId}-${project.version}-fat.jar + + + + + + + \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt new file mode 100644 index 000000000000..223e80919ac3 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt @@ -0,0 +1,34 @@ +/** +* 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.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class ApiResponse ( + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt new file mode 100644 index 000000000000..29aaa19c2c2f --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt @@ -0,0 +1,32 @@ +/** +* 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.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * A category for a pet + * @param id + * @param name + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class Category ( + var id: kotlin.Long? = null, + var name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt new file mode 100644 index 000000000000..2d806e9e2fc0 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/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.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class Order ( + var id: kotlin.Long? = null, + var petId: kotlin.Long? = null, + var quantity: kotlin.Int? = null, + var shipDate: java.time.LocalDateTime? = null, + /* Order Status */ + var status: Order.Status? = null, + var complete: kotlin.Boolean? = null +) { + + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String){ + + placed("placed"), + + approved("approved"), + + delivered("delivered"); + + } + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt new file mode 100644 index 000000000000..b96a3dde895e --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/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.server.api.model + +import org.openapitools.server.api.model.Category +import org.openapitools.server.api.model.Tag + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * 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 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class Pet ( + @SerializedName("name") private var _name: kotlin.String?, + @SerializedName("photoUrls") private var _photoUrls: kotlin.Array?, + var id: kotlin.Long? = null, + var category: Category? = null, + var tags: kotlin.Array? = null, + /* pet status in the store */ + var status: Pet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String){ + + available("available"), + + pending("pending"), + + sold("sold"); + + } + + var name get() = _name ?: throw IllegalArgumentException("name is required") + set(value){ _name = value } + var photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") + set(value){ _photoUrls = value } +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt new file mode 100644 index 000000000000..359a53af6091 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt @@ -0,0 +1,32 @@ +/** +* 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.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * A tag for a pet + * @param id + * @param name + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class Tag ( + var id: kotlin.Long? = null, + var name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt new file mode 100644 index 000000000000..791d0b882333 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt @@ -0,0 +1,45 @@ +/** +* 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.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * 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 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class User ( + var id: kotlin.Long? = null, + var username: kotlin.String? = null, + var firstName: kotlin.String? = null, + var lastName: kotlin.String? = null, + var email: kotlin.String? = null, + var password: kotlin.String? = null, + var phone: kotlin.String? = null, + /* User Status */ + var userStatus: kotlin.Int? = null +) { + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt new file mode 100644 index 000000000000..07f92471774c --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt @@ -0,0 +1,70 @@ +package org.openapitools.server.api.verticle + +import org.openapitools.server.api.model.ApiResponse +import org.openapitools.server.api.model.Pet +import io.vertx.core.Vertx +import io.vertx.core.json.JsonObject +import io.vertx.core.json.JsonArray +import com.github.wooyme.openapi.Response +import io.vertx.ext.web.api.OperationRequest +import io.vertx.kotlin.ext.web.api.contract.openapi3.OpenAPI3RouterFactory +import io.vertx.serviceproxy.ServiceBinder +import io.vertx.ext.web.handler.CookieHandler +import io.vertx.ext.web.handler.SessionHandler +import io.vertx.ext.web.sstore.LocalSessionStore +import java.util.List +import java.util.Map + + +interface PetApi { + fun init(vertx:Vertx,config:JsonObject) + /* addPet + * Add a new pet to the store */ + suspend fun addPet(body:Pet?,context:OperationRequest):Response + /* deletePet + * Deletes a pet */ + suspend fun deletePet(petId:kotlin.Long?,apiKey:kotlin.String?,context:OperationRequest):Response + /* findPetsByStatus + * Finds Pets by status */ + suspend fun findPetsByStatus(status:kotlin.Array?,context:OperationRequest):Response> + /* findPetsByTags + * Finds Pets by tags */ + suspend fun findPetsByTags(tags:kotlin.Array?,context:OperationRequest):Response> + /* getPetById + * Find pet by ID */ + suspend fun getPetById(petId:kotlin.Long?,context:OperationRequest):Response + /* updatePet + * Update an existing pet */ + suspend fun updatePet(body:Pet?,context:OperationRequest):Response + /* updatePetWithForm + * Updates a pet in the store with form data */ + suspend fun updatePetWithForm(petId:kotlin.Long?,name:kotlin.String?,status:kotlin.String?,context:OperationRequest):Response + /* uploadFile + * uploads an image */ + suspend fun uploadFile(petId:kotlin.Long?,additionalMetadata:kotlin.String?,file:kotlin.collections.List?,context:OperationRequest):Response + companion object { + const val address = "PetApi-service" + suspend fun createRouterFactory(vertx: Vertx,path:String): io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory { + val routerFactory = OpenAPI3RouterFactory.createAwait(vertx,path) + routerFactory.addGlobalHandler(CookieHandler.create()) + routerFactory.addGlobalHandler(SessionHandler.create(LocalSessionStore.create(vertx))) + routerFactory.setExtraOperationContextPayloadMapper{ + JsonObject().put("files",JsonArray(it.fileUploads().map { it.uploadedFileName() })) + } + val opf = routerFactory::class.java.getDeclaredField("operations") + opf.isAccessible = true + val operations = opf.get(routerFactory) as Map + for (m in PetApi::class.java.methods) { + val methodName = m.name + val op = operations[methodName] + if (op != null) { + val method = op::class.java.getDeclaredMethod("mountRouteToService",String::class.java,String::class.java) + method.isAccessible = true + method.invoke(op,address,methodName) + } + } + routerFactory.mountServiceInterface(PetApi::class.java, address) + return routerFactory + } + } +} diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVerticle.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVerticle.kt new file mode 100644 index 000000000000..ea5e7b5f4f1e --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVerticle.kt @@ -0,0 +1,19 @@ +package org.openapitools.server.api.verticle +import io.vertx.core.Vertx +import io.vertx.core.AbstractVerticle +import io.vertx.serviceproxy.ServiceBinder + +fun main(){ + Vertx.vertx().deployVerticle(PetApiVerticle()) +} + +class PetApiVerticle:AbstractVerticle() { + + override fun start() { + val instance = (javaClass.classLoader.loadClass("org.openapitools.server.api.verticle.PetApiImpl").newInstance() as PetApi) + instance.init(vertx,config()) + ServiceBinder(vertx) + .setAddress(PetApi.address) + .register(PetApi::class.java,instance) + } +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt new file mode 100644 index 000000000000..6d4fcafa98bc --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt @@ -0,0 +1,214 @@ +package org.openapitools.server.api.verticle + +import io.vertx.core.Vertx +import io.vertx.core.eventbus.Message +import io.vertx.core.json.JsonObject +import io.vertx.ext.web.api.OperationRequest +import io.vertx.ext.web.api.OperationResponse +import io.vertx.ext.web.api.generator.ApiHandlerUtils +import io.vertx.serviceproxy.ProxyHandler +import io.vertx.serviceproxy.ServiceException +import io.vertx.serviceproxy.ServiceExceptionMessageCodec +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.vertx.kotlin.coroutines.dispatcher +import io.vertx.core.json.Json +import io.vertx.core.json.JsonArray +import com.google.gson.reflect.TypeToken +import com.google.gson.Gson +import org.openapitools.server.api.model.ApiResponse +import org.openapitools.server.api.model.Pet + +class PetApiVertxProxyHandler(private val vertx: Vertx, private val service: PetApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { + private val timerID: Long + private var lastAccessed: Long = 0 + init { + try { + this.vertx.eventBus().registerDefaultCodec(ServiceException::class.java, + ServiceExceptionMessageCodec()) + } catch (ex: IllegalStateException) {} + + if (timeoutSeconds != (-1).toLong() && !topLevel) { + var period = timeoutSeconds * 1000 / 2 + if (period > 10000) { + period = 10000 + } + this.timerID = vertx.setPeriodic(period) { this.checkTimedOut(it) } + } else { + this.timerID = -1 + } + accessed() + } + private fun checkTimedOut(id: Long) { + val now = System.nanoTime() + if (now - lastAccessed > timeoutSeconds * 1000000000) { + close() + } + } + + override fun close() { + if (timerID != (-1).toLong()) { + vertx.cancelTimer(timerID) + } + super.close() + } + + private fun accessed() { + this.lastAccessed = System.nanoTime() + } + override fun handle(msg: Message) { + try { + val json = msg.body() + val action = msg.headers().get("action") ?: throw IllegalStateException("action not specified") + accessed() + val contextSerialized = json.getJsonObject("context") ?: throw IllegalStateException("Received action $action without OperationRequest \"context\"") + val context = OperationRequest(contextSerialized) + when (action) { + + "addPet" -> { + val params = context.params + val bodyParam = ApiHandlerUtils.searchJsonObjectInJson(params,"body") + if (bodyParam == null) { + throw IllegalArgumentException("body is required") + } + val body = Gson().fromJson(bodyParam.encode(), Pet::class.java) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.addPet(body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "deletePet" -> { + val params = context.params + val petId = ApiHandlerUtils.searchLongInJson(params,"petId") + if(petId == null){ + throw IllegalArgumentException("petId is required") + } + val apiKey = ApiHandlerUtils.searchStringInJson(params,"api_key") + GlobalScope.launch(vertx.dispatcher()){ + val result = service.deletePet(petId,apiKey,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "findPetsByStatus" -> { + val params = context.params + val statusParam = ApiHandlerUtils.searchJsonArrayInJson(params,"status") + if(statusParam == null){ + throw IllegalArgumentException("status is required") + } + val status:kotlin.Array = Gson().fromJson(statusParam.encode() + , object : TypeToken>(){}.type) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.findPetsByStatus(status,context) + val payload = JsonArray(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "findPetsByTags" -> { + val params = context.params + val tagsParam = ApiHandlerUtils.searchJsonArrayInJson(params,"tags") + if(tagsParam == null){ + throw IllegalArgumentException("tags is required") + } + val tags:kotlin.Array = Gson().fromJson(tagsParam.encode() + , object : TypeToken>(){}.type) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.findPetsByTags(tags,context) + val payload = JsonArray(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "getPetById" -> { + val params = context.params + val petId = ApiHandlerUtils.searchLongInJson(params,"petId") + if(petId == null){ + throw IllegalArgumentException("petId is required") + } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.getPetById(petId,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "updatePet" -> { + val params = context.params + val bodyParam = ApiHandlerUtils.searchJsonObjectInJson(params,"body") + if (bodyParam == null) { + throw IllegalArgumentException("body is required") + } + val body = Gson().fromJson(bodyParam.encode(), Pet::class.java) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.updatePet(body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "updatePetWithForm" -> { + val params = context.params + val petId = ApiHandlerUtils.searchLongInJson(params,"petId") + if(petId == null){ + throw IllegalArgumentException("petId is required") + } + val name = ApiHandlerUtils.searchStringInJson(params,"name") + val status = ApiHandlerUtils.searchStringInJson(params,"status") + GlobalScope.launch(vertx.dispatcher()){ + val result = service.updatePetWithForm(petId,name,status,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "uploadFile" -> { + val params = context.params + val petId = ApiHandlerUtils.searchLongInJson(params,"petId") + if(petId == null){ + throw IllegalArgumentException("petId is required") + } + val additionalMetadata = ApiHandlerUtils.searchStringInJson(params,"additionalMetadata") + val fileParam = context.extra.getJsonArray("files") + val file = fileParam?.map{ java.io.File(it as String) } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.uploadFile(petId,additionalMetadata,file,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + } + }catch (t: Throwable) { + msg.reply(ServiceException(500, t.message)) + throw t + } + } +} diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt new file mode 100644 index 000000000000..ac40c5a45272 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt @@ -0,0 +1,57 @@ +package org.openapitools.server.api.verticle + +import org.openapitools.server.api.model.Order +import io.vertx.core.Vertx +import io.vertx.core.json.JsonObject +import io.vertx.core.json.JsonArray +import com.github.wooyme.openapi.Response +import io.vertx.ext.web.api.OperationRequest +import io.vertx.kotlin.ext.web.api.contract.openapi3.OpenAPI3RouterFactory +import io.vertx.serviceproxy.ServiceBinder +import io.vertx.ext.web.handler.CookieHandler +import io.vertx.ext.web.handler.SessionHandler +import io.vertx.ext.web.sstore.LocalSessionStore +import java.util.List +import java.util.Map + + +interface StoreApi { + fun init(vertx:Vertx,config:JsonObject) + /* deleteOrder + * Delete purchase order by ID */ + suspend fun deleteOrder(orderId:kotlin.String?,context:OperationRequest):Response + /* getInventory + * Returns pet inventories by status */ + suspend fun getInventory(context:OperationRequest):Response> + /* getOrderById + * Find purchase order by ID */ + suspend fun getOrderById(orderId:kotlin.Long?,context:OperationRequest):Response + /* placeOrder + * Place an order for a pet */ + suspend fun placeOrder(body:Order?,context:OperationRequest):Response + companion object { + const val address = "StoreApi-service" + suspend fun createRouterFactory(vertx: Vertx,path:String): io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory { + val routerFactory = OpenAPI3RouterFactory.createAwait(vertx,path) + routerFactory.addGlobalHandler(CookieHandler.create()) + routerFactory.addGlobalHandler(SessionHandler.create(LocalSessionStore.create(vertx))) + routerFactory.setExtraOperationContextPayloadMapper{ + JsonObject().put("files",JsonArray(it.fileUploads().map { it.uploadedFileName() })) + } + val opf = routerFactory::class.java.getDeclaredField("operations") + opf.isAccessible = true + val operations = opf.get(routerFactory) as Map + for (m in StoreApi::class.java.methods) { + val methodName = m.name + val op = operations[methodName] + if (op != null) { + val method = op::class.java.getDeclaredMethod("mountRouteToService",String::class.java,String::class.java) + method.isAccessible = true + method.invoke(op,address,methodName) + } + } + routerFactory.mountServiceInterface(StoreApi::class.java, address) + return routerFactory + } + } +} diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVerticle.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVerticle.kt new file mode 100644 index 000000000000..dd885532237f --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVerticle.kt @@ -0,0 +1,19 @@ +package org.openapitools.server.api.verticle +import io.vertx.core.Vertx +import io.vertx.core.AbstractVerticle +import io.vertx.serviceproxy.ServiceBinder + +fun main(){ + Vertx.vertx().deployVerticle(StoreApiVerticle()) +} + +class StoreApiVerticle:AbstractVerticle() { + + override fun start() { + val instance = (javaClass.classLoader.loadClass("org.openapitools.server.api.verticle.StoreApiImpl").newInstance() as StoreApi) + instance.init(vertx,config()) + ServiceBinder(vertx) + .setAddress(StoreApi.address) + .register(StoreApi::class.java,instance) + } +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt new file mode 100644 index 000000000000..985b9249f56d --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt @@ -0,0 +1,125 @@ +package org.openapitools.server.api.verticle + +import io.vertx.core.Vertx +import io.vertx.core.eventbus.Message +import io.vertx.core.json.JsonObject +import io.vertx.ext.web.api.OperationRequest +import io.vertx.ext.web.api.OperationResponse +import io.vertx.ext.web.api.generator.ApiHandlerUtils +import io.vertx.serviceproxy.ProxyHandler +import io.vertx.serviceproxy.ServiceException +import io.vertx.serviceproxy.ServiceExceptionMessageCodec +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.vertx.kotlin.coroutines.dispatcher +import io.vertx.core.json.Json +import io.vertx.core.json.JsonArray +import com.google.gson.reflect.TypeToken +import com.google.gson.Gson +import org.openapitools.server.api.model.Order + +class StoreApiVertxProxyHandler(private val vertx: Vertx, private val service: StoreApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { + private val timerID: Long + private var lastAccessed: Long = 0 + init { + try { + this.vertx.eventBus().registerDefaultCodec(ServiceException::class.java, + ServiceExceptionMessageCodec()) + } catch (ex: IllegalStateException) {} + + if (timeoutSeconds != (-1).toLong() && !topLevel) { + var period = timeoutSeconds * 1000 / 2 + if (period > 10000) { + period = 10000 + } + this.timerID = vertx.setPeriodic(period) { this.checkTimedOut(it) } + } else { + this.timerID = -1 + } + accessed() + } + private fun checkTimedOut(id: Long) { + val now = System.nanoTime() + if (now - lastAccessed > timeoutSeconds * 1000000000) { + close() + } + } + + override fun close() { + if (timerID != (-1).toLong()) { + vertx.cancelTimer(timerID) + } + super.close() + } + + private fun accessed() { + this.lastAccessed = System.nanoTime() + } + override fun handle(msg: Message) { + try { + val json = msg.body() + val action = msg.headers().get("action") ?: throw IllegalStateException("action not specified") + accessed() + val contextSerialized = json.getJsonObject("context") ?: throw IllegalStateException("Received action $action without OperationRequest \"context\"") + val context = OperationRequest(contextSerialized) + when (action) { + + "deleteOrder" -> { + val params = context.params + val orderId = ApiHandlerUtils.searchStringInJson(params,"orderId") + if(orderId == null){ + throw IllegalArgumentException("orderId is required") + } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.deleteOrder(orderId,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "getInventory" -> { + } + + "getOrderById" -> { + val params = context.params + val orderId = ApiHandlerUtils.searchLongInJson(params,"orderId") + if(orderId == null){ + throw IllegalArgumentException("orderId is required") + } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.getOrderById(orderId,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "placeOrder" -> { + val params = context.params + val bodyParam = ApiHandlerUtils.searchJsonObjectInJson(params,"body") + if (bodyParam == null) { + throw IllegalArgumentException("body is required") + } + val body = Gson().fromJson(bodyParam.encode(), Order::class.java) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.placeOrder(body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + } + }catch (t: Throwable) { + msg.reply(ServiceException(500, t.message)) + throw t + } + } +} diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt new file mode 100644 index 000000000000..e48a7273b2a8 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt @@ -0,0 +1,69 @@ +package org.openapitools.server.api.verticle + +import org.openapitools.server.api.model.User +import io.vertx.core.Vertx +import io.vertx.core.json.JsonObject +import io.vertx.core.json.JsonArray +import com.github.wooyme.openapi.Response +import io.vertx.ext.web.api.OperationRequest +import io.vertx.kotlin.ext.web.api.contract.openapi3.OpenAPI3RouterFactory +import io.vertx.serviceproxy.ServiceBinder +import io.vertx.ext.web.handler.CookieHandler +import io.vertx.ext.web.handler.SessionHandler +import io.vertx.ext.web.sstore.LocalSessionStore +import java.util.List +import java.util.Map + + +interface UserApi { + fun init(vertx:Vertx,config:JsonObject) + /* createUser + * Create user */ + suspend fun createUser(body:User?,context:OperationRequest):Response + /* createUsersWithArrayInput + * Creates list of users with given input array */ + suspend fun createUsersWithArrayInput(body:kotlin.Array?,context:OperationRequest):Response + /* createUsersWithListInput + * Creates list of users with given input array */ + suspend fun createUsersWithListInput(body:kotlin.Array?,context:OperationRequest):Response + /* deleteUser + * Delete user */ + suspend fun deleteUser(username:kotlin.String?,context:OperationRequest):Response + /* getUserByName + * Get user by user name */ + suspend fun getUserByName(username:kotlin.String?,context:OperationRequest):Response + /* loginUser + * Logs user into the system */ + suspend fun loginUser(username:kotlin.String?,password:kotlin.String?,context:OperationRequest):Response + /* logoutUser + * Logs out current logged in user session */ + suspend fun logoutUser(context:OperationRequest):Response + /* updateUser + * Updated user */ + suspend fun updateUser(username:kotlin.String?,body:User?,context:OperationRequest):Response + companion object { + const val address = "UserApi-service" + suspend fun createRouterFactory(vertx: Vertx,path:String): io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory { + val routerFactory = OpenAPI3RouterFactory.createAwait(vertx,path) + routerFactory.addGlobalHandler(CookieHandler.create()) + routerFactory.addGlobalHandler(SessionHandler.create(LocalSessionStore.create(vertx))) + routerFactory.setExtraOperationContextPayloadMapper{ + JsonObject().put("files",JsonArray(it.fileUploads().map { it.uploadedFileName() })) + } + val opf = routerFactory::class.java.getDeclaredField("operations") + opf.isAccessible = true + val operations = opf.get(routerFactory) as Map + for (m in UserApi::class.java.methods) { + val methodName = m.name + val op = operations[methodName] + if (op != null) { + val method = op::class.java.getDeclaredMethod("mountRouteToService",String::class.java,String::class.java) + method.isAccessible = true + method.invoke(op,address,methodName) + } + } + routerFactory.mountServiceInterface(UserApi::class.java, address) + return routerFactory + } + } +} diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVerticle.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVerticle.kt new file mode 100644 index 000000000000..2b121c28bb18 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVerticle.kt @@ -0,0 +1,19 @@ +package org.openapitools.server.api.verticle +import io.vertx.core.Vertx +import io.vertx.core.AbstractVerticle +import io.vertx.serviceproxy.ServiceBinder + +fun main(){ + Vertx.vertx().deployVerticle(UserApiVerticle()) +} + +class UserApiVerticle:AbstractVerticle() { + + override fun start() { + val instance = (javaClass.classLoader.loadClass("org.openapitools.server.api.verticle.UserApiImpl").newInstance() as UserApi) + instance.init(vertx,config()) + ServiceBinder(vertx) + .setAddress(UserApi.address) + .register(UserApi::class.java,instance) + } +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt new file mode 100644 index 000000000000..beee4405bee1 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt @@ -0,0 +1,202 @@ +package org.openapitools.server.api.verticle + +import io.vertx.core.Vertx +import io.vertx.core.eventbus.Message +import io.vertx.core.json.JsonObject +import io.vertx.ext.web.api.OperationRequest +import io.vertx.ext.web.api.OperationResponse +import io.vertx.ext.web.api.generator.ApiHandlerUtils +import io.vertx.serviceproxy.ProxyHandler +import io.vertx.serviceproxy.ServiceException +import io.vertx.serviceproxy.ServiceExceptionMessageCodec +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.vertx.kotlin.coroutines.dispatcher +import io.vertx.core.json.Json +import io.vertx.core.json.JsonArray +import com.google.gson.reflect.TypeToken +import com.google.gson.Gson +import org.openapitools.server.api.model.User + +class UserApiVertxProxyHandler(private val vertx: Vertx, private val service: UserApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { + private val timerID: Long + private var lastAccessed: Long = 0 + init { + try { + this.vertx.eventBus().registerDefaultCodec(ServiceException::class.java, + ServiceExceptionMessageCodec()) + } catch (ex: IllegalStateException) {} + + if (timeoutSeconds != (-1).toLong() && !topLevel) { + var period = timeoutSeconds * 1000 / 2 + if (period > 10000) { + period = 10000 + } + this.timerID = vertx.setPeriodic(period) { this.checkTimedOut(it) } + } else { + this.timerID = -1 + } + accessed() + } + private fun checkTimedOut(id: Long) { + val now = System.nanoTime() + if (now - lastAccessed > timeoutSeconds * 1000000000) { + close() + } + } + + override fun close() { + if (timerID != (-1).toLong()) { + vertx.cancelTimer(timerID) + } + super.close() + } + + private fun accessed() { + this.lastAccessed = System.nanoTime() + } + override fun handle(msg: Message) { + try { + val json = msg.body() + val action = msg.headers().get("action") ?: throw IllegalStateException("action not specified") + accessed() + val contextSerialized = json.getJsonObject("context") ?: throw IllegalStateException("Received action $action without OperationRequest \"context\"") + val context = OperationRequest(contextSerialized) + when (action) { + + "createUser" -> { + val params = context.params + val bodyParam = ApiHandlerUtils.searchJsonObjectInJson(params,"body") + if (bodyParam == null) { + throw IllegalArgumentException("body is required") + } + val body = Gson().fromJson(bodyParam.encode(), User::class.java) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.createUser(body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "createUsersWithArrayInput" -> { + val params = context.params + val bodyParam = ApiHandlerUtils.searchJsonArrayInJson(params,"body") + if(bodyParam == null){ + throw IllegalArgumentException("body is required") + } + val body:kotlin.Array = Gson().fromJson(bodyParam.encode() + , object : TypeToken>(){}.type) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.createUsersWithArrayInput(body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "createUsersWithListInput" -> { + val params = context.params + val bodyParam = ApiHandlerUtils.searchJsonArrayInJson(params,"body") + if(bodyParam == null){ + throw IllegalArgumentException("body is required") + } + val body:kotlin.Array = Gson().fromJson(bodyParam.encode() + , object : TypeToken>(){}.type) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.createUsersWithListInput(body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "deleteUser" -> { + val params = context.params + val username = ApiHandlerUtils.searchStringInJson(params,"username") + if(username == null){ + throw IllegalArgumentException("username is required") + } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.deleteUser(username,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "getUserByName" -> { + val params = context.params + val username = ApiHandlerUtils.searchStringInJson(params,"username") + if(username == null){ + throw IllegalArgumentException("username is required") + } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.getUserByName(username,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "loginUser" -> { + val params = context.params + val username = ApiHandlerUtils.searchStringInJson(params,"username") + if(username == null){ + throw IllegalArgumentException("username is required") + } + val password = ApiHandlerUtils.searchStringInJson(params,"password") + if(password == null){ + throw IllegalArgumentException("password is required") + } + GlobalScope.launch(vertx.dispatcher()){ + val result = service.loginUser(username,password,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + "logoutUser" -> { + } + + "updateUser" -> { + val params = context.params + val username = ApiHandlerUtils.searchStringInJson(params,"username") + if(username == null){ + throw IllegalArgumentException("username is required") + } + val bodyParam = ApiHandlerUtils.searchJsonObjectInJson(params,"body") + if (bodyParam == null) { + throw IllegalArgumentException("body is required") + } + val body = Gson().fromJson(bodyParam.encode(), User::class.java) + GlobalScope.launch(vertx.dispatcher()){ + val result = service.updateUser(username,body,context) + val payload = JsonObject(Json.encode(result.payload)).toBuffer() + val res = OperationResponse(result.statusCode,result.statusMessage,payload,result.headers) + msg.reply(res.toJson()) + }.invokeOnCompletion{ + it?.let{ throw it } + } + } + + } + }catch (t: Throwable) { + msg.reply(ServiceException(500, t.message)) + throw t + } + } +} diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.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/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index d65f0ce9d580..58e4a46be9b3 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -437,4 +437,48 @@ public function fakeOuterStringSerialize() return response('How about implementing fakeOuterStringSerialize as a post method ?'); } + /** + * Operation testQueryParameterCollectionFormat + * + * . + * + * + * @return Http response + */ + public function testQueryParameterCollectionFormat() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pipe'])) { + throw new \InvalidArgumentException('Missing the required parameter $pipe when calling testQueryParameterCollectionFormat'); + } + $pipe = $input['pipe']; + + if (!isset($input['ioutil'])) { + throw new \InvalidArgumentException('Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat'); + } + $ioutil = $input['ioutil']; + + if (!isset($input['http'])) { + throw new \InvalidArgumentException('Missing the required parameter $http when calling testQueryParameterCollectionFormat'); + } + $http = $input['http']; + + if (!isset($input['url'])) { + throw new \InvalidArgumentException('Missing the required parameter $url when calling testQueryParameterCollectionFormat'); + } + $url = $input['url']; + + if (!isset($input['context'])) { + throw new \InvalidArgumentException('Missing the required parameter $context when calling testQueryParameterCollectionFormat'); + } + $context = $input['context']; + + + return response('How about implementing testQueryParameterCollectionFormat as a put method ?'); + } } diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index f694f4c48d9d..e4e6201b5133 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -105,6 +105,12 @@ * Notes: Test serialization of outer string types */ $router->post('/v2/fake/outer/string', 'FakeApi@fakeOuterStringSerialize'); +/** + * put testQueryParameterCollectionFormat + * Summary: + * Notes: To test the collection format in query parameters + */ +$router->put('/v2/fake/test-query-paramters', 'FakeApi@testQueryParameterCollectionFormat'); /** * patch testClassname * Summary: To test class name in snake case diff --git a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION +++ b/samples/server/petstore/php-silex/OpenAPIServer/.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/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim/.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/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 3df90ccbeda4..0d639b32a11c 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -133,6 +133,7 @@ Class | Method | HTTP request | Description *AbstractFakeApi* | **testGroupParameters** | **DELETE** /fake | Fake endpoint to test group parameters (optional) *AbstractFakeApi* | **testInlineAdditionalProperties** | **POST** /fake/inline-additionalProperties | test inline additionalProperties *AbstractFakeApi* | **testJsonFormData** | **GET** /fake/jsonFormData | test json serialization of form data +*AbstractFakeApi* | **testQueryParameterCollectionFormat** | **PUT** /fake/test-query-paramters | *AbstractFakeClassnameTags123Api* | **testClassname** | **PATCH** /fake_classname_test | To test class name in snake case *AbstractPetApi* | **addPet** | **POST** /pet | Add a new pet to the store *AbstractPetApi* | **findPetsByStatus** | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php b/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php index 9197121d006e..a226169c69e1 100644 --- a/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php +++ b/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php @@ -355,4 +355,29 @@ public function testJsonFormData(ServerRequestInterface $request, ResponseInterf return $response->write($message)->withStatus(501); } + + /** + * PUT testQueryParameterCollectionFormat + * Notes: To test the collection format in query parameters + * + * @param ServerRequestInterface $request Request + * @param ResponseInterface $response Response + * @param array|null $args Path arguments + * + * @return ResponseInterface + * @throws Exception to force implementation class to override this method + */ + public function testQueryParameterCollectionFormat(ServerRequestInterface $request, ResponseInterface $response, array $args) + { + $queryParams = $request->getQueryParams(); + $pipe = $request->getQueryParam('pipe'); + $ioutil = $request->getQueryParam('ioutil'); + $http = $request->getQueryParam('http'); + $url = $request->getQueryParam('url'); + $context = $request->getQueryParam('context'); + $message = "How about implementing testQueryParameterCollectionFormat as a PUT method in OpenAPIServer\Api\FakeApi class?"; + throw new Exception($message); + + return $response->write($message)->withStatus(501); + } } diff --git a/samples/server/petstore/php-slim/lib/Model/TypeHolderExample.php b/samples/server/petstore/php-slim/lib/Model/TypeHolderExample.php index 21456e3d2985..cee3f04691da 100644 --- a/samples/server/petstore/php-slim/lib/Model/TypeHolderExample.php +++ b/samples/server/petstore/php-slim/lib/Model/TypeHolderExample.php @@ -31,6 +31,9 @@ class TypeHolderExample /** @var float $numberItem */ private $numberItem; + /** @var float $floatItem */ + private $floatItem; + /** @var int $integerItem */ private $integerItem; diff --git a/samples/server/petstore/php-slim/lib/SlimRouter.php b/samples/server/petstore/php-slim/lib/SlimRouter.php index ebccb6d6f44a..7d084c80b57a 100644 --- a/samples/server/petstore/php-slim/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim/lib/SlimRouter.php @@ -160,6 +160,7 @@ class SlimRouter [ 'type' => 'http', 'isBasic' => true, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => false, ], @@ -209,6 +210,17 @@ class SlimRouter 'authMethods' => [ ], ], + [ + 'httpMethod' => 'PUT', + 'basePathWithoutHost' => '/v2', + 'path' => '/fake/test-query-paramters', + 'apiPackage' => 'OpenAPIServer\Api', + 'classname' => 'AbstractFakeApi', + 'userClassname' => 'FakeApi', + 'operationId' => 'testQueryParameterCollectionFormat', + 'authMethods' => [ + ], + ], [ 'httpMethod' => 'PATCH', 'basePathWithoutHost' => '/v2', @@ -222,6 +234,7 @@ class SlimRouter [ 'type' => 'apiKey', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => true, 'isOAuth' => false, 'keyParamName' => 'api_key_query', @@ -244,6 +257,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -266,6 +280,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -288,6 +303,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -310,6 +326,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -332,6 +349,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -354,6 +372,7 @@ class SlimRouter [ 'type' => 'apiKey', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => true, 'isOAuth' => false, 'keyParamName' => 'api_key', @@ -376,6 +395,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -398,6 +418,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -420,6 +441,7 @@ class SlimRouter [ 'type' => 'oauth2', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ @@ -442,6 +464,7 @@ class SlimRouter [ 'type' => 'apiKey', 'isBasic' => false, + 'isBearer' => false, 'isApiKey' => true, 'isOAuth' => false, 'keyParamName' => 'api_key', @@ -625,7 +648,7 @@ public function __construct($settings = []) $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ 'authenticator' => $basicAuthenticator, - 'regex' => '/Basic\s+(.*)$/i', + 'regex' => $authMethod['isBearer'] ? '/Bearer\s+(.*)$/i' : '/Basic\s+(.*)$/i', 'header' => 'Authorization', 'parameter' => null, 'cookie' => null, 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 2f81801b7943..0e97bd19efbf 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 @@ -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/php-symfony/SymfonyBundle-php/Controller/StoreController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php index 8fbf32d50cb5..a7c17cae0b4b 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php @@ -224,7 +224,7 @@ public function getOrderByIdAction(Request $request, $orderId) $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("int"); $asserts[] = new Assert\GreaterThanOrEqual(1); - $asserts[] = new Assert\LessThanOrEqual(1); + $asserts[] = new Assert\LessThanOrEqual(5); $response = $this->validate($orderId, $asserts); if ($response instanceof Response) { return $response; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh index 4d22bfef4d71..ced3be2b0c7b 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh @@ -1,11 +1,17 @@ #!/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-petstore-perl "minor update" +# 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" @@ -37,9 +43,9 @@ 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/server/petstore/php-ze-ph/.openapi-generator/VERSION b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-ze-ph/.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/php-ze-ph/application/config/path_handler.yml b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml index 33daffd998c2..786a0330ced8 100644 --- a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml +++ b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml @@ -12,6 +12,7 @@ Articus\PathHandler\RouteInjection\Factory: - App\Handler\FakeOuterComposite - App\Handler\FakeOuterNumber - App\Handler\FakeOuterString + - App\Handler\FakeTestQueryParamters - App\Handler\FakePetIdUploadImageWithRequiredFile - App\Handler\FakeClassnameTest - App\Handler\Pet @@ -53,6 +54,7 @@ Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory: App\Handler\FakeOuterComposite: [] App\Handler\FakeOuterNumber: [] App\Handler\FakeOuterString: [] + App\Handler\FakeTestQueryParamters: [] App\Handler\FakePetIdUploadImageWithRequiredFile: [] App\Handler\FakeClassnameTest: [] App\Handler\Pet: [] diff --git a/samples/server/petstore/php-ze-ph/src/App/DTO/TypeHolderExample.php b/samples/server/petstore/php-ze-ph/src/App/DTO/TypeHolderExample.php index 610a83421a75..3b400acfabd6 100644 --- a/samples/server/petstore/php-ze-ph/src/App/DTO/TypeHolderExample.php +++ b/samples/server/petstore/php-ze-ph/src/App/DTO/TypeHolderExample.php @@ -21,6 +21,12 @@ class TypeHolderExample * @var float */ public $number_item; + /** + * @DTA\Data(field="float_item") + * @DTA\Validator(name="Type", options={"type":"float"}) + * @var float + */ + public $float_item; /** * @DTA\Data(field="integer_item") * @DTA\Validator(name="Type", options={"type":"int"}) diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php new file mode 100644 index 000000000000..0648ce97f2da --- /dev/null +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php @@ -0,0 +1,29 @@ + String () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, + +[[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) + # **** > uuid::Uuid () 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 35aec947f481..6b4bbb646334 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 @@ -7,9 +7,9 @@ extern crate futures; #[macro_use] extern crate swagger; #[allow(unused_extern_crates)] -extern crate uuid; extern crate clap; extern crate tokio_core; +extern crate uuid; use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; @@ -20,6 +20,7 @@ use tokio_core::reactor; use openapi_v3::{ApiNoContext, ContextWrapperExt, ApiError, RequiredOctetStreamPutResponse, + ResponsesWithHeadersGetResponse, UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, @@ -35,6 +36,7 @@ fn main() { .help("Sets the operation to run") .possible_values(&[ "RequiredOctetStreamPut", + "ResponsesWithHeadersGet", "UuidGet", "XmlExtraPost", "XmlOtherPost", @@ -86,6 +88,11 @@ fn main() { println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); }, + Some("ResponsesWithHeadersGet") => { + let result = core.run(client.responses_with_headers_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + Some("UuidGet") => { let result = core.run(client.uuid_get()); println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server.rs index a13062a00f43..679eb81c84ee 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server.rs @@ -20,7 +20,7 @@ extern crate futures; extern crate chrono; #[macro_use] extern crate error_chain; - +extern crate uuid; use openssl::x509::X509_FILETYPE_PEM; use openssl::ssl::{SslAcceptorBuilder, SslMethod}; 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 ed9633e9c036..a66ac4e58d77 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 @@ -6,12 +6,13 @@ use futures::{self, Future}; use chrono; use std::collections::HashMap; use std::marker::PhantomData; - use swagger; use swagger::{Has, XSpanIdString}; +use uuid; use openapi_v3::{Api, ApiError, RequiredOctetStreamPutResponse, + ResponsesWithHeadersGetResponse, UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, @@ -42,6 +43,13 @@ impl Api for Server where C: Has{ } + fn responses_with_headers_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("responses_with_headers_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + fn uuid_get(&self, context: &C) -> Box> { let context = context.clone(); println!("uuid_get() - X-Span-ID: {:?}", 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 55d94240ebfc..3537ffbd9085 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 @@ -6,6 +6,7 @@ extern crate openssl; extern crate mime; extern crate chrono; extern crate url; +extern crate uuid; use hyper; use hyper::header::{Headers, ContentType}; @@ -37,6 +38,7 @@ use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; use {Api, RequiredOctetStreamPutResponse, + ResponsesWithHeadersGetResponse, UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, @@ -314,6 +316,108 @@ impl Api for Client where } + fn responses_with_headers_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/responses_with_headers", + 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())); + 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 => { + header! { (ResponseSuccessInfo, "Success-Info") => [String] } + let response_success_info = match response.headers().get::() { + Some(response_success_info) => response_success_info.0.clone(), + None => return Box::new(future::err(ApiError(String::from("Required response header Success-Info for response 200 was not found.")))) as Box>, + }; + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + + ) + .map(move |body| { + ResponsesWithHeadersGetResponse::Success{ body: body, success_info: response_success_info } + }) + ) as Box> + }, + 412 => { + header! { (ResponseFurtherInfo, "Further-Info") => [String] } + let response_further_info = match response.headers().get::() { + Some(response_further_info) => response_further_info.0.clone(), + None => return Box::new(future::err(ApiError(String::from("Required response header Further-Info for response 412 was not found.")))) as Box>, + }; + header! { (ResponseFailureInfo, "Failure-Info") => [String] } + let response_failure_info = match response.headers().get::() { + Some(response_failure_info) => response_failure_info.0.clone(), + None => return Box::new(future::err(ApiError(String::from("Required response header Failure-Info for response 412 was not found.")))) as Box>, + }; + let body = response.body(); + Box::new( + + future::ok( + ResponsesWithHeadersGetResponse::PreconditionFailed + { + further_info: response_further_info, + failure_info: response_failure_info, + } + ) + ) 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 uuid_get(&self, context: &C) -> Box> { let mut uri = format!( "{}/uuid", 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 8b28ecdfc736..0ccacdce2fcd 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 @@ -1,40 +1,51 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -extern crate serde; -#[macro_use] -extern crate serde_derive; -extern crate serde_json; -extern crate serde_xml_rs; -extern crate futures; -extern crate chrono; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; -extern crate mime; +#[macro_use] +extern crate serde_derive; -// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate hyper; - -extern crate swagger; - +#[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate url; +// Crates for conversion support +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_derives; +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_enum_derive; +#[cfg(feature = "conversion")] +extern crate frunk_core; + +extern crate mime; +extern crate serde; +extern crate serde_json; +extern crate serde_xml_rs; +extern crate futures; +extern crate chrono; +extern crate swagger; +extern crate uuid; + use futures::Stream; use std::io::Error; #[allow(unused_imports)] use std::collections::HashMap; -pub use futures::Future; - #[cfg(any(feature = "client", feature = "server"))] mod mimetypes; +#[deprecated(note = "Import swagger-rs directly")] pub use swagger::{ApiError, ContextWrapper}; +#[deprecated(note = "Import futures directly")] +pub use futures::Future; pub const BASE_PATH: &'static str = ""; pub const API_VERSION: &'static str = "1.0.7"; @@ -43,53 +54,76 @@ pub const API_VERSION: &'static str = "1.0.7"; #[derive(Debug, PartialEq)] pub enum RequiredOctetStreamPutResponse { /// OK - OK , + OK +} + +#[derive(Debug, PartialEq)] +pub enum ResponsesWithHeadersGetResponse { + /// Success + Success + { + body: String, + success_info: String, + } + , + /// Precondition Failed + PreconditionFailed + { + further_info: String, + failure_info: String, + } } #[derive(Debug, PartialEq)] pub enum UuidGetResponse { /// Duplicate Response long text. One. - DuplicateResponseLongText ( uuid::Uuid ) , + DuplicateResponseLongText + (uuid::Uuid) } #[derive(Debug, PartialEq)] pub enum XmlExtraPostResponse { /// OK - OK , + OK + , /// Bad Request - BadRequest , + BadRequest } #[derive(Debug, PartialEq)] pub enum XmlOtherPostResponse { /// OK - OK , + OK + , /// Bad Request - BadRequest , + BadRequest } #[derive(Debug, PartialEq)] pub enum XmlOtherPutResponse { /// OK - OK , + OK + , /// Bad Request - BadRequest , + BadRequest } #[derive(Debug, PartialEq)] pub enum XmlPostResponse { /// OK - OK , + OK + , /// Bad Request - BadRequest , + BadRequest } #[derive(Debug, PartialEq)] pub enum XmlPutResponse { /// OK - OK , + OK + , /// Bad Request - BadRequest , + BadRequest } @@ -100,6 +134,9 @@ pub trait Api { fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box>; + fn responses_with_headers_get(&self, context: &C) -> Box>; + + fn uuid_get(&self, context: &C) -> Box>; @@ -126,6 +163,9 @@ pub trait ApiNoContext { fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box>; + fn responses_with_headers_get(&self) -> Box>; + + fn uuid_get(&self) -> Box>; @@ -165,6 +205,11 @@ impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { } + fn responses_with_headers_get(&self) -> Box> { + self.api().responses_with_headers_get(&self.context()) + } + + fn uuid_get(&self) -> Box> { self.api().uuid_get(&self.context()) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs index aabb888501ae..3f70e612d016 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs @@ -5,6 +5,11 @@ pub mod responses { // The macro is called per-operation to beat the recursion limit + lazy_static! { + /// Create Mime objects for the response content types for ResponsesWithHeadersGet + pub static ref RESPONSES_WITH_HEADERS_GET_SUCCESS: Mime = "application/json".parse().unwrap(); + } + lazy_static! { /// Create Mime objects for the response content types for UuidGet pub static ref UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT: Mime = "application/json".parse().unwrap(); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs index 303637592d40..081175d56fbd 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs @@ -1,6 +1,5 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; use serde_xml_rs; use serde::ser::Serializer; @@ -9,7 +8,7 @@ use std::collections::{HashMap, BTreeMap}; use models; use swagger; use std::string::ParseError; - +use uuid; // Utility function for wrapping list elements when serializing xml @@ -22,6 +21,7 @@ where } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct AnotherXmlArray(#[serde(serialize_with = "wrap_in_snake_another_xml_inner")]Vec); impl ::std::convert::From> for AnotherXmlArray { @@ -93,6 +93,7 @@ impl AnotherXmlArray { } #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "snake_another_xml_inner")] pub struct AnotherXmlInner(String); @@ -140,6 +141,7 @@ impl AnotherXmlInner { /// An XML object #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "snake_another_xml_object")] pub struct AnotherXmlObject { #[serde(rename = "inner_string")] @@ -176,6 +178,7 @@ impl AnotherXmlObject { /// An XML object #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "camelDuplicateXmlObject")] pub struct DuplicateXmlObject { #[serde(rename = "inner_string")] @@ -217,7 +220,7 @@ impl DuplicateXmlObject { /// Test a model containing a UUID #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] - +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct UuidObject(uuid::Uuid); impl ::std::convert::From for UuidObject { @@ -266,6 +269,7 @@ where } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct XmlArray(#[serde(serialize_with = "wrap_in_camelXmlInner")]Vec); impl ::std::convert::From> for XmlArray { @@ -337,6 +341,7 @@ impl XmlArray { } #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "camelXmlInner")] pub struct XmlInner(String); @@ -384,6 +389,7 @@ impl XmlInner { /// An XML object #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "camelXmlObject")] pub struct XmlObject { #[serde(rename = "innerString")] 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 8a49d9bcaf27..72923bf8ee8c 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 @@ -36,6 +36,7 @@ use swagger::auth::Scopes; use {Api, RequiredOctetStreamPutResponse, + ResponsesWithHeadersGetResponse, UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, @@ -56,6 +57,7 @@ mod paths { lazy_static! { pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ r"^/required_octet_stream$", + r"^/responses_with_headers$", r"^/uuid$", r"^/xml$", r"^/xml_extra$", @@ -63,10 +65,11 @@ mod paths { ]).unwrap(); } pub static ID_REQUIRED_OCTET_STREAM: usize = 0; - pub static ID_UUID: usize = 1; - pub static ID_XML: usize = 2; - pub static ID_XML_EXTRA: usize = 3; - pub static ID_XML_OTHER: usize = 4; + 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 struct NewService { @@ -183,6 +186,69 @@ where ) as Box> }, + // ResponsesWithHeadersGet - GET /responses_with_headers + &hyper::Method::Get if path.matched(paths::ID_RESPONSES_WITH_HEADERS) => { + Box::new({ + {{ + Box::new(api_impl.responses_with_headers_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 { + ResponsesWithHeadersGetResponse::Success + + { + body, + success_info + } + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + header! { (ResponseSuccessInfo, "Success-Info") => [String] } + response.headers_mut().set(ResponseSuccessInfo(success_info)); + + response.headers_mut().set(ContentType(mimetypes::responses::RESPONSES_WITH_HEADERS_GET_SUCCESS.clone())); + + + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + response.set_body(body); + }, + ResponsesWithHeadersGetResponse::PreconditionFailed + + + { + further_info, + failure_info + } + + => { + response.set_status(StatusCode::try_from(412).unwrap()); + header! { (ResponseFurtherInfo, "Further-Info") => [String] } + response.headers_mut().set(ResponseFurtherInfo(further_info)); + header! { (ResponseFailureInfo, "Failure-Info") => [String] } + response.headers_mut().set(ResponseFailureInfo(failure_info)); + + }, + }, + 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> + }, + // UuidGet - GET /uuid &hyper::Method::Get if path.matched(paths::ID_UUID) => { Box::new({ @@ -581,6 +647,9 @@ impl RequestParser for ApiRequestParser { // RequiredOctetStreamPut - PUT /required_octet_stream &hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => Ok("RequiredOctetStreamPut"), + // ResponsesWithHeadersGet - GET /responses_with_headers + &hyper::Method::Get if path.matched(paths::ID_RESPONSES_WITH_HEADERS) => Ok("ResponsesWithHeadersGet"), + // UuidGet - GET /uuid &hyper::Method::Get if path.matched(paths::ID_UUID) => Ok("UuidGet"), 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 2f81801b7943..0e97bd19efbf 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 @@ -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/rust-server/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml index 31607737856c..aa2e7ac6abe7 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -7,42 +7,59 @@ license = "Unlicense" [features] default = ["client", "server"] -client = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] -server = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] +client = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url"] +server = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url"] +conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"] [dependencies] -# Required by example server. -# +# Common chrono = { version = "0.4", features = ["serde"] } futures = "0.1" -hyper = {version = "0.11", optional = true} -hyper-tls = {version = "0.1.2", optional = true} swagger = "2" - -# Not required by example server. -# lazy_static = "0.2" log = "0.3.0" mime = "0.2.6" -multipart = {version = "0.13.3"} -native-tls = {version = "0.1.4", optional = true} -openssl = {version = "0.9.14", optional = true} -percent-encoding = {version = "1.0.0", optional = true} -regex = {version = "0.2", optional = true} +multipart = "0.13.3" serde = "1.0" serde_derive = "1.0" +serde_json = "1.0" + +# Crates included if required by the API definition + +# Common between server and client features +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} serde_ignored = {version = "0.0.4", optional = true} -serde_json = {version = "1.0", optional = true} -serde_urlencoded = {version = "0.5.1", optional = true} tokio-core = {version = "0.1.6", optional = true} +url = {version = "1.5", optional = true} + +# Client-specific + + +# Server-specific +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} tokio-proto = {version = "0.1.1", optional = true} tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} -url = {version = "1.5", optional = true} -uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} -# ToDo: this should be updated to point at the official crate once -# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +# Other optional crates +frunk = { version = "0.3.0", optional = true } +frunk_derives = { version = "0.3.0", optional = true } +frunk_core = { version = "0.3.0", optional = true } +frunk-enum-derive = { version = "0.2.0", optional = true } +frunk-enum-core = { version = "0.2.0", optional = true } [dev-dependencies] clap = "2.25" error-chain = "0.12" +uuid = {version = "0.5", features = ["serde", "v4"]} + +[[example]] +name = "client" +required-features = ["client"] + +[[example]] +name = "server" +required-features = ["server"] diff --git a/samples/server/petstore/rust-server/output/ops-v3/README.md b/samples/server/petstore/rust-server/output/ops-v3/README.md index 68b5984c610b..c38c48a1648c 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/README.md +++ b/samples/server/petstore/rust-server/output/ops-v3/README.md @@ -3,10 +3,11 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) ## Overview + This client/server 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 a server stub. -- +(https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote +server, you can easily generate a server stub. To see how to make this your own, look here: @@ -14,6 +15,9 @@ To see how to make this your own, look here: - API version: 0.0.1 + + + This autogenerated project defines an API crate `ops-v3` which contains: * An `Api` trait defining the API in Rust. * Data types representing the underlying data model. @@ -21,15 +25,17 @@ This autogenerated project defines an API crate `ops-v3` which contains: * A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. It also contains an example server and client which make use of `ops-v3`: -* The example server starts up a web server using the `ops-v3` router, - and supplies a trivial implementation of `Api` which returns failure for every operation. -* The example client provides a CLI which lets you invoke any single operation on the - `ops-v3` client by passing appropriate arguments on the command line. + +* The example server starts up a web server using the `ops-v3` + router, and supplies a trivial implementation of `Api` which returns failure + for every operation. +* The example client provides a CLI which lets you invoke + any single operation on the `ops-v3` client by passing appropriate + arguments on the command line. You can use the example server and client as a basis for your own code. See below for [more detail on implementing a server](#writing-a-server). - ## Examples Run examples with: @@ -44,14 +50,14 @@ To pass in arguments to the examples, put them after `--`, for example: cargo run --example client -- --help ``` -### Running the server +### Running the example server To run the server, follow these simple steps: ``` cargo run --example server ``` -### Running a client +### Running the example client To run a client, follow one of the following simple steps: ``` @@ -101,43 +107,23 @@ The examples can be run in HTTPS mode by passing in the flag `--https`, for exam cargo run --example server -- --https ``` -This will use the keys/certificates from the examples directory. Note that the server chain is signed with -`CN=localhost`. - - -## Writing a server - -The server example is designed to form the basis for implementing your own server. Simply follow these steps. - -* Set up a new Rust project, e.g., with `cargo init --bin`. -* Insert `ops-v3` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "ops-v3" ]`. -* Add `ops-v3 = {version = "0.0.1", path = "ops-v3"}` under `[dependencies]` in the root `Cargo.toml`. -* Copy the `[dependencies]` and `[dev-dependencies]` from `ops-v3/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. - * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. - * Remove `"optional = true"` from each of these lines if present. - -Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: -``` -cp ops-v3/examples/server.rs src/main.rs -cp ops-v3/examples/server_lib/mod.rs src/lib.rs -cp ops-v3/examples/server_lib/server.rs src/server.rs -``` - -Now +This will use the keys/certificates from the examples directory. Note that the +server chain is signed with `CN=localhost`. -* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. -* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. -* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. -* Run `cargo build` to check it builds. -* Run `cargo fmt` to reformat the code. -* Commit the result before making any further changes (lest format changes get confused with your own updates). +## Using the generated library -Now replace the implementations in `src/server.rs` with your own code as required. +The generated library has a few optional features that can be activated through Cargo. -## Updating your server to track API changes +* `server` + * This defaults to enabled and creates the basic skeleton of a server implementation based on hyper + * To create the server stack you'll need to provide an implementation of the API trait to provide the server function. +* `client` + * This defaults to enabled and creates the basic skeleton of a client implementation based on hyper + * The constructed client implements the API trait by making remote API call. +* `conversions` + * This defaults to disabled and creates extra derives on models to allow "transmogrification" between objects of structurally similar types. -Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. -Alternatively, implement the now-missing methods based on the compiler's error messages. +See https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section for how to use features in your `Cargo.toml`. ## Documentation for API Endpoints diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs index 1f440afafba3..2cfb02dad288 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs @@ -7,9 +7,9 @@ extern crate futures; #[macro_use] extern crate swagger; #[allow(unused_extern_crates)] -extern crate uuid; extern crate clap; extern crate tokio_core; +extern crate uuid; use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs index d17f981ccf0b..c3b37229176f 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs @@ -21,7 +21,6 @@ extern crate chrono; #[macro_use] extern crate error_chain; - use openssl::x509::X509_FILETYPE_PEM; use openssl::ssl::{SslAcceptorBuilder, SslMethod}; use openssl::error::ErrorStack; diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs index b4bae26a2ce6..1d493838629d 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs @@ -6,7 +6,6 @@ use futures::{self, Future}; use chrono; use std::collections::HashMap; use std::marker::PhantomData; - use swagger; use swagger::{Has, XSpanIdString}; diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs index 44f00e73b1ca..8ec590c42ab1 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs @@ -1,40 +1,50 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -extern crate serde; -#[macro_use] -extern crate serde_derive; -extern crate serde_json; - -extern crate futures; -extern crate chrono; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; -extern crate mime; +#[macro_use] +extern crate serde_derive; -// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate hyper; - -extern crate swagger; - +#[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate url; +// Crates for conversion support +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_derives; +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_enum_derive; +#[cfg(feature = "conversion")] +extern crate frunk_core; + +extern crate mime; +extern crate serde; +extern crate serde_json; + +extern crate futures; +extern crate chrono; +extern crate swagger; + use futures::Stream; use std::io::Error; #[allow(unused_imports)] use std::collections::HashMap; -pub use futures::Future; - #[cfg(any(feature = "client", feature = "server"))] mod mimetypes; +#[deprecated(note = "Import swagger-rs directly")] pub use swagger::{ApiError, ContextWrapper}; +#[deprecated(note = "Import futures directly")] +pub use futures::Future; pub const BASE_PATH: &'static str = ""; pub const API_VERSION: &'static str = "0.0.1"; @@ -43,223 +53,223 @@ pub const API_VERSION: &'static str = "0.0.1"; #[derive(Debug, PartialEq)] pub enum Op10GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op11GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op12GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op13GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op14GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op15GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op16GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op17GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op18GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op19GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op1GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op20GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op21GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op22GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op23GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op24GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op25GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op26GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op27GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op28GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op29GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op2GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op30GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op31GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op32GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op33GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op34GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op35GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op36GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op37GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op3GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op4GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op5GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op6GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op7GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op8GetResponse { /// OK - OK , + OK } #[derive(Debug, PartialEq)] pub enum Op9GetResponse { /// OK - OK , + OK } diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/models.rs b/samples/server/petstore/rust-server/output/ops-v3/src/models.rs index a9cf8c096c9e..222455062958 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/models.rs @@ -1,6 +1,5 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; use serde::ser::Serializer; @@ -9,4 +8,3 @@ use models; use swagger; use std::string::ParseError; - diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs index e21eeae61657..267efa7a2172 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs @@ -8,7 +8,6 @@ extern crate mime; extern crate chrono; extern crate percent_encoding; extern crate url; -extern crate uuid; use std::sync::Arc; use std::marker::PhantomData; 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 2f81801b7943..0e97bd19efbf 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 @@ -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/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index ced1aff24603..eacf8e96ff48 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -7,42 +7,62 @@ license = "Unlicense" [features] default = ["client", "server"] -client = ["serde_json", "serde_urlencoded", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] -server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] +client = ["serde_urlencoded", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url"] +server = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url"] +conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"] [dependencies] -# Required by example server. -# +# Common chrono = { version = "0.4", features = ["serde"] } futures = "0.1" -hyper = {version = "0.11", optional = true} -hyper-tls = {version = "0.1.2", optional = true} swagger = "2" - -# Not required by example server. -# lazy_static = "0.2" log = "0.3.0" mime = "0.2.6" -multipart = {version = "0.13.3"} -native-tls = {version = "0.1.4", optional = true} -openssl = {version = "0.9.14", optional = true} -percent-encoding = {version = "1.0.0", optional = true} -regex = {version = "0.2", optional = true} +multipart = "0.13.3" serde = "1.0" serde_derive = "1.0" +serde_json = "1.0" + +# Crates included if required by the API definition +uuid = {version = "0.5", features = ["serde", "v4"]} +# TODO: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} + +# Common between server and client features +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} serde_ignored = {version = "0.0.4", optional = true} -serde_json = {version = "1.0", optional = true} -serde_urlencoded = {version = "0.5.1", optional = true} tokio-core = {version = "0.1.6", optional = true} +url = {version = "1.5", optional = true} + +# Client-specific +serde_urlencoded = {version = "0.5.1", optional = true} + +# Server-specific +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} tokio-proto = {version = "0.1.1", optional = true} tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} -url = {version = "1.5", optional = true} -uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} -# ToDo: this should be updated to point at the official crate once -# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master", optional = true} + +# Other optional crates +frunk = { version = "0.3.0", optional = true } +frunk_derives = { version = "0.3.0", optional = true } +frunk_core = { version = "0.3.0", optional = true } +frunk-enum-derive = { version = "0.2.0", optional = true } +frunk-enum-core = { version = "0.2.0", optional = true } [dev-dependencies] clap = "2.25" error-chain = "0.12" + +[[example]] +name = "client" +required-features = ["client"] + +[[example]] +name = "server" +required-features = ["server"] diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md index 16e356dd0861..66807d943201 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md @@ -3,10 +3,11 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview + This client/server 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 a server stub. -- +(https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote +server, you can easily generate a server stub. To see how to make this your own, look here: @@ -14,6 +15,9 @@ To see how to make this your own, look here: - API version: 1.0.0 + + + This autogenerated project defines an API crate `petstore-with-fake-endpoints-models-for-testing` which contains: * An `Api` trait defining the API in Rust. * Data types representing the underlying data model. @@ -21,15 +25,17 @@ This autogenerated project defines an API crate `petstore-with-fake-endpoints-mo * A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. It also contains an example server and client which make use of `petstore-with-fake-endpoints-models-for-testing`: -* The example server starts up a web server using the `petstore-with-fake-endpoints-models-for-testing` router, - and supplies a trivial implementation of `Api` which returns failure for every operation. -* The example client provides a CLI which lets you invoke any single operation on the - `petstore-with-fake-endpoints-models-for-testing` client by passing appropriate arguments on the command line. + +* The example server starts up a web server using the `petstore-with-fake-endpoints-models-for-testing` + router, and supplies a trivial implementation of `Api` which returns failure + for every operation. +* The example client provides a CLI which lets you invoke + any single operation on the `petstore-with-fake-endpoints-models-for-testing` client by passing appropriate + arguments on the command line. You can use the example server and client as a basis for your own code. See below for [more detail on implementing a server](#writing-a-server). - ## Examples Run examples with: @@ -44,14 +50,14 @@ To pass in arguments to the examples, put them after `--`, for example: cargo run --example client -- --help ``` -### Running the server +### Running the example server To run the server, follow these simple steps: ``` cargo run --example server ``` -### Running a client +### Running the example client To run a client, follow one of the following simple steps: ``` @@ -96,43 +102,23 @@ The examples can be run in HTTPS mode by passing in the flag `--https`, for exam cargo run --example server -- --https ``` -This will use the keys/certificates from the examples directory. Note that the server chain is signed with -`CN=localhost`. - - -## Writing a server - -The server example is designed to form the basis for implementing your own server. Simply follow these steps. - -* Set up a new Rust project, e.g., with `cargo init --bin`. -* Insert `petstore-with-fake-endpoints-models-for-testing` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "petstore-with-fake-endpoints-models-for-testing" ]`. -* Add `petstore-with-fake-endpoints-models-for-testing = {version = "1.0.0", path = "petstore-with-fake-endpoints-models-for-testing"}` under `[dependencies]` in the root `Cargo.toml`. -* Copy the `[dependencies]` and `[dev-dependencies]` from `petstore-with-fake-endpoints-models-for-testing/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. - * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. - * Remove `"optional = true"` from each of these lines if present. - -Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: -``` -cp petstore-with-fake-endpoints-models-for-testing/examples/server.rs src/main.rs -cp petstore-with-fake-endpoints-models-for-testing/examples/server_lib/mod.rs src/lib.rs -cp petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs src/server.rs -``` - -Now +This will use the keys/certificates from the examples directory. Note that the +server chain is signed with `CN=localhost`. -* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. -* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. -* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. -* Run `cargo build` to check it builds. -* Run `cargo fmt` to reformat the code. -* Commit the result before making any further changes (lest format changes get confused with your own updates). +## Using the generated library -Now replace the implementations in `src/server.rs` with your own code as required. +The generated library has a few optional features that can be activated through Cargo. -## Updating your server to track API changes +* `server` + * This defaults to enabled and creates the basic skeleton of a server implementation based on hyper + * To create the server stack you'll need to provide an implementation of the API trait to provide the server function. +* `client` + * This defaults to enabled and creates the basic skeleton of a client implementation based on hyper + * The constructed client implements the API trait by making remote API call. +* `conversions` + * This defaults to disabled and creates extra derives on models to allow "transmogrification" between objects of structurally similar types. -Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. -Alternatively, implement the now-missing methods based on the compiler's error messages. +See https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section for how to use features in your `Cargo.toml`. ## Documentation for API Endpoints diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml index 927d553f2ce0..bb8b8bf926c6 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml @@ -726,6 +726,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs index b5803ba34c39..bcf3e0d67d3c 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client.rs @@ -7,9 +7,9 @@ extern crate futures; #[macro_use] extern crate swagger; #[allow(unused_extern_crates)] -extern crate uuid; extern crate clap; extern crate tokio_core; +extern crate uuid; use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs index 0f2aba9655b2..5703909c2172 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server.rs @@ -20,7 +20,7 @@ extern crate futures; extern crate chrono; #[macro_use] extern crate error_chain; - +extern crate uuid; use openssl::x509::X509_FILETYPE_PEM; use openssl::ssl::{SslAcceptorBuilder, SslMethod}; diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs index f0ee591cf95a..f76a7dfa8759 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server_lib/server.rs @@ -6,9 +6,9 @@ use futures::{self, Future}; use chrono; use std::collections::HashMap; use std::marker::PhantomData; - use swagger; use swagger::{Has, XSpanIdString}; +use uuid; use petstore_with_fake_endpoints_models_for_testing::{Api, ApiError, TestSpecialTagsResponse, diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index 1f8c143d76af..d7a48cd205ab 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -8,6 +8,7 @@ extern crate chrono; extern crate url; extern crate serde_urlencoded; extern crate multipart; +extern crate uuid; use hyper; use hyper::header::{Headers, ContentType}; @@ -878,13 +879,18 @@ impl Api for Client where request.set_body(body.into_bytes()); request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - if let Some(auth_data) = (context as &Has>).get().as_ref() { - if let AuthData::Basic(ref basic_header) = *auth_data { - request.headers_mut().set(hyper::header::Authorization( - basic_header.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::Basic(ref basic_header) => { + request.headers_mut().set(hyper::header::Authorization( + basic_header.clone(), + )) + }, + _ => {} } - } + }); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -974,6 +980,7 @@ impl Api for Client where request.set_body(body.into_bytes()); request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + // Header parameters header! { (RequestEnumHeaderStringArray, "enum_header_string_array") => (String)* } param_enum_header_string_array.map(|header| request.headers_mut().set(RequestEnumHeaderStringArray(header.clone()))); @@ -1271,6 +1278,18 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::ADD_PET.clone())); 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| { @@ -1332,6 +1351,19 @@ impl Api for Client where 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(), + )) + }, + _ => {} + } + }); + // Header parameters header! { (RequestApiKey, "api_key") => [String] } param_api_key.map(|header| request.headers_mut().set(RequestApiKey(header))); @@ -1397,6 +1429,18 @@ impl Api for Client where 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| { @@ -1482,6 +1526,18 @@ impl Api for Client where 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| { @@ -1566,12 +1622,19 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - header! { (ApiKey, "api_key") => [String] } - if let Some(auth_data) = (context as &Has>).get().as_ref() { - if let AuthData::ApiKey(ref api_key) = *auth_data { - request.headers_mut().set(ApiKey(api_key.to_string())); + + (context as &Has>).get().as_ref().map(|auth_data| { + // Currently only authentication with Basic, API Key, and Bearer are supported + match auth_data { + &AuthData::ApiKey(ref api_key) => { + header! { (ApiKey, "api_key") => [String] } + request.headers_mut().set( + ApiKey(api_key.to_string()) + ) + }, + _ => {} } - } + }); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1669,6 +1732,18 @@ impl Api for Client where request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_PET.clone())); 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| { @@ -1756,6 +1831,18 @@ impl Api for Client where request.set_body(body.into_bytes()); 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| { @@ -1866,6 +1953,18 @@ impl Api for Client where 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| { @@ -2010,12 +2109,19 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - header! { (ApiKey, "api_key") => [String] } - if let Some(auth_data) = (context as &Has>).get().as_ref() { - if let AuthData::ApiKey(ref api_key) = *auth_data { - request.headers_mut().set(ApiKey(api_key.to_string())); + + (context as &Has>).get().as_ref().map(|auth_data| { + // Currently only authentication with Basic, API Key, and Bearer are supported + match auth_data { + &AuthData::ApiKey(ref api_key) => { + header! { (ApiKey, "api_key") => [String] } + request.headers_mut().set( + ApiKey(api_key.to_string()) + ) + }, + _ => {} } - } + }); Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 479be7ad6524..301819683582 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -1,40 +1,51 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -extern crate serde; -#[macro_use] -extern crate serde_derive; -extern crate serde_json; -extern crate serde_xml_rs; -extern crate futures; -extern crate chrono; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; -extern crate mime; +#[macro_use] +extern crate serde_derive; -// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate hyper; - -extern crate swagger; - +#[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate url; +// Crates for conversion support +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_derives; +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_enum_derive; +#[cfg(feature = "conversion")] +extern crate frunk_core; + +extern crate mime; +extern crate serde; +extern crate serde_json; +extern crate serde_xml_rs; +extern crate futures; +extern crate chrono; +extern crate swagger; +extern crate uuid; + use futures::Stream; use std::io::Error; #[allow(unused_imports)] use std::collections::HashMap; -pub use futures::Future; - #[cfg(any(feature = "client", feature = "server"))] mod mimetypes; +#[deprecated(note = "Import swagger-rs directly")] pub use swagger::{ApiError, ContextWrapper}; +#[deprecated(note = "Import futures directly")] +pub use futures::Future; pub const BASE_PATH: &'static str = "/v2"; pub const API_VERSION: &'static str = "1.0.0"; @@ -43,227 +54,264 @@ pub const API_VERSION: &'static str = "1.0.0"; #[derive(Debug, PartialEq)] pub enum TestSpecialTagsResponse { /// successful operation - SuccessfulOperation ( models::Client ) , + SuccessfulOperation + (models::Client) } #[derive(Debug, PartialEq)] pub enum FakeOuterBooleanSerializeResponse { /// Output boolean - OutputBoolean ( bool ) , + OutputBoolean + (bool) } #[derive(Debug, PartialEq)] pub enum FakeOuterCompositeSerializeResponse { /// Output composite - OutputComposite ( models::OuterComposite ) , + OutputComposite + (models::OuterComposite) } #[derive(Debug, PartialEq)] pub enum FakeOuterNumberSerializeResponse { /// Output number - OutputNumber ( f64 ) , + OutputNumber + (f64) } #[derive(Debug, PartialEq)] pub enum FakeOuterStringSerializeResponse { /// Output string - OutputString ( String ) , + OutputString + (String) } #[derive(Debug, PartialEq)] pub enum TestBodyWithQueryParamsResponse { /// Success - Success , + Success } #[derive(Debug, PartialEq)] pub enum TestClientModelResponse { /// successful operation - SuccessfulOperation ( models::Client ) , + SuccessfulOperation + (models::Client) } #[derive(Debug, PartialEq)] pub enum TestEndpointParametersResponse { /// Invalid username supplied - InvalidUsernameSupplied , + InvalidUsernameSupplied + , /// User not found - UserNotFound , + UserNotFound } #[derive(Debug, PartialEq)] pub enum TestEnumParametersResponse { /// Invalid request - InvalidRequest , + InvalidRequest + , /// Not found - NotFound , + NotFound } #[derive(Debug, PartialEq)] pub enum TestInlineAdditionalPropertiesResponse { /// successful operation - SuccessfulOperation , + SuccessfulOperation } #[derive(Debug, PartialEq)] pub enum TestJsonFormDataResponse { /// successful operation - SuccessfulOperation , + SuccessfulOperation } #[derive(Debug, PartialEq)] pub enum TestClassnameResponse { /// successful operation - SuccessfulOperation ( models::Client ) , + SuccessfulOperation + (models::Client) } #[derive(Debug, PartialEq)] pub enum AddPetResponse { /// Invalid input - InvalidInput , + InvalidInput } #[derive(Debug, PartialEq)] pub enum DeletePetResponse { /// Invalid pet value - InvalidPetValue , + InvalidPetValue } #[derive(Debug, PartialEq)] pub enum FindPetsByStatusResponse { /// successful operation - SuccessfulOperation ( Vec ) , + SuccessfulOperation + (Vec) + , /// Invalid status value - InvalidStatusValue , + InvalidStatusValue } #[derive(Debug, PartialEq)] pub enum FindPetsByTagsResponse { /// successful operation - SuccessfulOperation ( Vec ) , + SuccessfulOperation + (Vec) + , /// Invalid tag value - InvalidTagValue , + InvalidTagValue } #[derive(Debug, PartialEq)] pub enum GetPetByIdResponse { /// successful operation - SuccessfulOperation ( models::Pet ) , + SuccessfulOperation + (models::Pet) + , /// Invalid ID supplied - InvalidIDSupplied , + InvalidIDSupplied + , /// Pet not found - PetNotFound , + PetNotFound } #[derive(Debug, PartialEq)] pub enum UpdatePetResponse { /// Invalid ID supplied - InvalidIDSupplied , + InvalidIDSupplied + , /// Pet not found - PetNotFound , + PetNotFound + , /// Validation exception - ValidationException , + ValidationException } #[derive(Debug, PartialEq)] pub enum UpdatePetWithFormResponse { /// Invalid input - InvalidInput , + InvalidInput } #[derive(Debug, PartialEq)] pub enum UploadFileResponse { /// successful operation - SuccessfulOperation ( models::ApiResponse ) , + SuccessfulOperation + (models::ApiResponse) } #[derive(Debug, PartialEq)] pub enum DeleteOrderResponse { /// Invalid ID supplied - InvalidIDSupplied , + InvalidIDSupplied + , /// Order not found - OrderNotFound , + OrderNotFound } #[derive(Debug, PartialEq)] pub enum GetInventoryResponse { /// successful operation - SuccessfulOperation ( HashMap ) , + SuccessfulOperation + (HashMap) } #[derive(Debug, PartialEq)] pub enum GetOrderByIdResponse { /// successful operation - SuccessfulOperation ( models::Order ) , + SuccessfulOperation + (models::Order) + , /// Invalid ID supplied - InvalidIDSupplied , + InvalidIDSupplied + , /// Order not found - OrderNotFound , + OrderNotFound } #[derive(Debug, PartialEq)] pub enum PlaceOrderResponse { /// successful operation - SuccessfulOperation ( models::Order ) , + SuccessfulOperation + (models::Order) + , /// Invalid Order - InvalidOrder , + InvalidOrder } #[derive(Debug, PartialEq)] pub enum CreateUserResponse { /// successful operation - SuccessfulOperation , + SuccessfulOperation } #[derive(Debug, PartialEq)] pub enum CreateUsersWithArrayInputResponse { /// successful operation - SuccessfulOperation , + SuccessfulOperation } #[derive(Debug, PartialEq)] pub enum CreateUsersWithListInputResponse { /// successful operation - SuccessfulOperation , + SuccessfulOperation } #[derive(Debug, PartialEq)] pub enum DeleteUserResponse { /// Invalid username supplied - InvalidUsernameSupplied , + InvalidUsernameSupplied + , /// User not found - UserNotFound , + UserNotFound } #[derive(Debug, PartialEq)] pub enum GetUserByNameResponse { /// successful operation - SuccessfulOperation ( models::User ) , + SuccessfulOperation + (models::User) + , /// Invalid username supplied - InvalidUsernameSupplied , + InvalidUsernameSupplied + , /// User not found - UserNotFound , + UserNotFound } #[derive(Debug, PartialEq)] pub enum LoginUserResponse { /// successful operation - SuccessfulOperation { body: String, x_rate_limit: i32, x_expires_after: chrono::DateTime } , + SuccessfulOperation + { + body: String, + x_rate_limit: i32, + x_expires_after: chrono::DateTime, + } + , /// Invalid username/password supplied - InvalidUsername , + InvalidUsername } #[derive(Debug, PartialEq)] pub enum LogoutUserResponse { /// successful operation - SuccessfulOperation , + SuccessfulOperation } #[derive(Debug, PartialEq)] pub enum UpdateUserResponse { /// Invalid user supplied - InvalidUserSupplied , + InvalidUserSupplied + , /// User not found - UserNotFound , + UserNotFound } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index e915e0d11148..7ae01fe09935 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -1,6 +1,5 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; use serde_xml_rs; use serde::ser::Serializer; @@ -9,10 +8,11 @@ use std::collections::{HashMap, BTreeMap}; use models; use swagger; use std::string::ParseError; - +use uuid; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct AdditionalPropertiesClass { #[serde(rename = "map_property")] #[serde(skip_serializing_if="Option::is_none")] @@ -43,6 +43,7 @@ impl AdditionalPropertiesClass { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct Animal { #[serde(rename = "className")] pub class_name: String, @@ -72,6 +73,7 @@ impl Animal { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct AnimalFarm(Vec); impl ::std::convert::From> for AnimalFarm { @@ -143,6 +145,7 @@ impl AnimalFarm { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ApiResponse { #[serde(rename = "code")] #[serde(skip_serializing_if="Option::is_none")] @@ -178,6 +181,7 @@ impl ApiResponse { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ArrayOfArrayOfNumberOnly { #[serde(rename = "ArrayArrayNumber")] #[serde(skip_serializing_if="Option::is_none")] @@ -203,6 +207,7 @@ impl ArrayOfArrayOfNumberOnly { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ArrayOfNumberOnly { #[serde(rename = "ArrayNumber")] #[serde(skip_serializing_if="Option::is_none")] @@ -228,6 +233,7 @@ impl ArrayOfNumberOnly { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ArrayTest { #[serde(rename = "array_of_string")] #[serde(skip_serializing_if="Option::is_none")] @@ -269,6 +275,7 @@ impl ArrayTest { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct Capitalization { #[serde(rename = "smallCamel")] #[serde(skip_serializing_if="Option::is_none")] @@ -320,6 +327,7 @@ impl Capitalization { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct Cat { #[serde(rename = "className")] pub class_name: String, @@ -354,6 +362,7 @@ impl Cat { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct CatAllOf { #[serde(rename = "declawed")] #[serde(skip_serializing_if="Option::is_none")] @@ -379,6 +388,7 @@ impl CatAllOf { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Category")] pub struct Category { #[serde(rename = "id")] @@ -411,6 +421,7 @@ impl Category { /// Model for testing model with \"_class\" property #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ClassModel { #[serde(rename = "_class")] #[serde(skip_serializing_if="Option::is_none")] @@ -436,6 +447,7 @@ impl ClassModel { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct Client { #[serde(rename = "client")] #[serde(skip_serializing_if="Option::is_none")] @@ -461,6 +473,7 @@ impl Client { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct Dog { #[serde(rename = "className")] pub class_name: String, @@ -495,6 +508,7 @@ impl Dog { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct DogAllOf { #[serde(rename = "breed")] #[serde(skip_serializing_if="Option::is_none")] @@ -520,6 +534,7 @@ impl DogAllOf { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct EnumArrays { // Note: inline enums are not fully supported by openapi-generator #[serde(rename = "just_symbol")] @@ -562,7 +577,8 @@ impl EnumArrays { /// which helps with FFI. #[allow(non_camel_case_types)] #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGenericEnum))] pub enum EnumClass { #[serde(rename = "_abc")] _ABC, @@ -604,6 +620,7 @@ impl EnumClass { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct EnumTest { // Note: inline enums are not fully supported by openapi-generator #[serde(rename = "enum_string")] @@ -652,6 +669,7 @@ impl EnumTest { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct FormatTest { #[serde(rename = "integer")] #[serde(skip_serializing_if="Option::is_none")] @@ -733,6 +751,7 @@ impl FormatTest { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct HasOnlyReadOnly { #[serde(rename = "bar")] #[serde(skip_serializing_if="Option::is_none")] @@ -763,6 +782,7 @@ impl HasOnlyReadOnly { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct List { #[serde(rename = "123-list")] #[serde(skip_serializing_if="Option::is_none")] @@ -788,6 +808,7 @@ impl List { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct MapTest { #[serde(rename = "map_map_of_string")] #[serde(skip_serializing_if="Option::is_none")] @@ -825,6 +846,7 @@ impl MapTest { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct MixedPropertiesAndAdditionalPropertiesClass { #[serde(rename = "uuid")] #[serde(skip_serializing_if="Option::is_none")] @@ -861,6 +883,7 @@ impl MixedPropertiesAndAdditionalPropertiesClass { /// Model for testing model name starting with number #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Name")] pub struct Model200Response { #[serde(rename = "name")] @@ -893,6 +916,7 @@ impl Model200Response { /// Model for testing reserved words #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Return")] pub struct ModelReturn { #[serde(rename = "return")] @@ -920,6 +944,7 @@ impl ModelReturn { /// Model for testing model name same as property name #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Name")] pub struct Name { #[serde(rename = "name")] @@ -960,6 +985,7 @@ impl Name { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct NumberOnly { #[serde(rename = "JustNumber")] #[serde(skip_serializing_if="Option::is_none")] @@ -985,6 +1011,7 @@ impl NumberOnly { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Order")] pub struct Order { #[serde(rename = "id")] @@ -1038,7 +1065,7 @@ impl Order { } #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] - +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct OuterBoolean(bool); impl ::std::convert::From for OuterBoolean { @@ -1078,6 +1105,7 @@ impl OuterBoolean { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct OuterComposite { #[serde(rename = "my_number")] #[serde(skip_serializing_if="Option::is_none")] @@ -1117,7 +1145,8 @@ impl OuterComposite { /// which helps with FFI. #[allow(non_camel_case_types)] #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Eq, Ord)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGenericEnum))] pub enum OuterEnum { #[serde(rename = "placed")] PLACED, @@ -1159,7 +1188,7 @@ impl OuterEnum { } #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] - +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct OuterNumber(f64); impl ::std::convert::From for OuterNumber { @@ -1199,7 +1228,7 @@ impl OuterNumber { } #[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] - +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct OuterString(String); impl ::std::convert::From for OuterString { @@ -1245,6 +1274,7 @@ impl OuterString { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Pet")] pub struct Pet { #[serde(rename = "id")] @@ -1296,6 +1326,7 @@ impl Pet { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ReadOnlyFirst { #[serde(rename = "bar")] #[serde(skip_serializing_if="Option::is_none")] @@ -1326,6 +1357,7 @@ impl ReadOnlyFirst { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "$special[model.name]")] pub struct SpecialModelName { #[serde(rename = "$special[property.name]")] @@ -1352,6 +1384,7 @@ impl SpecialModelName { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "Tag")] pub struct Tag { #[serde(rename = "id")] @@ -1383,6 +1416,7 @@ impl Tag { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] #[serde(rename = "User")] pub struct User { #[serde(rename = "id")] 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 2f81801b7943..0e97bd19efbf 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 @@ -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/rust-server/output/rust-server-test/Cargo.toml b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml index bfae24310b9e..ebdcacacf1b6 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml +++ b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml @@ -7,42 +7,59 @@ license = "Unlicense" [features] default = ["client", "server"] -client = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] -server = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] +client = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url"] +server = ["serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url"] +conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"] [dependencies] -# Required by example server. -# +# Common chrono = { version = "0.4", features = ["serde"] } futures = "0.1" -hyper = {version = "0.11", optional = true} -hyper-tls = {version = "0.1.2", optional = true} swagger = "2" - -# Not required by example server. -# lazy_static = "0.2" log = "0.3.0" mime = "0.2.6" -multipart = {version = "0.13.3"} -native-tls = {version = "0.1.4", optional = true} -openssl = {version = "0.9.14", optional = true} -percent-encoding = {version = "1.0.0", optional = true} -regex = {version = "0.2", optional = true} +multipart = "0.13.3" serde = "1.0" serde_derive = "1.0" +serde_json = "1.0" + +# Crates included if required by the API definition + +# Common between server and client features +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} serde_ignored = {version = "0.0.4", optional = true} -serde_json = {version = "1.0", optional = true} -serde_urlencoded = {version = "0.5.1", optional = true} tokio-core = {version = "0.1.6", optional = true} +url = {version = "1.5", optional = true} + +# Client-specific + + +# Server-specific +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} tokio-proto = {version = "0.1.1", optional = true} tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} -url = {version = "1.5", optional = true} -uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} -# ToDo: this should be updated to point at the official crate once -# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +# Other optional crates +frunk = { version = "0.3.0", optional = true } +frunk_derives = { version = "0.3.0", optional = true } +frunk_core = { version = "0.3.0", optional = true } +frunk-enum-derive = { version = "0.2.0", optional = true } +frunk-enum-core = { version = "0.2.0", optional = true } [dev-dependencies] clap = "2.25" error-chain = "0.12" +uuid = {version = "0.5", features = ["serde", "v4"]} + +[[example]] +name = "client" +required-features = ["client"] + +[[example]] +name = "server" +required-features = ["server"] diff --git a/samples/server/petstore/rust-server/output/rust-server-test/README.md b/samples/server/petstore/rust-server/output/rust-server-test/README.md index 7a1e577f2e49..3b00be8fb08c 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/README.md +++ b/samples/server/petstore/rust-server/output/rust-server-test/README.md @@ -3,10 +3,11 @@ This spec is for testing rust-server-specific things ## Overview + This client/server 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 a server stub. -- +(https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote +server, you can easily generate a server stub. To see how to make this your own, look here: @@ -14,6 +15,9 @@ To see how to make this your own, look here: - API version: 2.3.4 + + + This autogenerated project defines an API crate `rust-server-test` which contains: * An `Api` trait defining the API in Rust. * Data types representing the underlying data model. @@ -21,15 +25,17 @@ This autogenerated project defines an API crate `rust-server-test` which contain * A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. It also contains an example server and client which make use of `rust-server-test`: -* The example server starts up a web server using the `rust-server-test` router, - and supplies a trivial implementation of `Api` which returns failure for every operation. -* The example client provides a CLI which lets you invoke any single operation on the - `rust-server-test` client by passing appropriate arguments on the command line. + +* The example server starts up a web server using the `rust-server-test` + router, and supplies a trivial implementation of `Api` which returns failure + for every operation. +* The example client provides a CLI which lets you invoke + any single operation on the `rust-server-test` client by passing appropriate + arguments on the command line. You can use the example server and client as a basis for your own code. See below for [more detail on implementing a server](#writing-a-server). - ## Examples Run examples with: @@ -44,14 +50,14 @@ To pass in arguments to the examples, put them after `--`, for example: cargo run --example client -- --help ``` -### Running the server +### Running the example server To run the server, follow these simple steps: ``` cargo run --example server ``` -### Running a client +### Running the example client To run a client, follow one of the following simple steps: ``` @@ -69,43 +75,23 @@ The examples can be run in HTTPS mode by passing in the flag `--https`, for exam cargo run --example server -- --https ``` -This will use the keys/certificates from the examples directory. Note that the server chain is signed with -`CN=localhost`. - - -## Writing a server - -The server example is designed to form the basis for implementing your own server. Simply follow these steps. - -* Set up a new Rust project, e.g., with `cargo init --bin`. -* Insert `rust-server-test` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "rust-server-test" ]`. -* Add `rust-server-test = {version = "2.3.4", path = "rust-server-test"}` under `[dependencies]` in the root `Cargo.toml`. -* Copy the `[dependencies]` and `[dev-dependencies]` from `rust-server-test/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. - * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. - * Remove `"optional = true"` from each of these lines if present. - -Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: -``` -cp rust-server-test/examples/server.rs src/main.rs -cp rust-server-test/examples/server_lib/mod.rs src/lib.rs -cp rust-server-test/examples/server_lib/server.rs src/server.rs -``` - -Now +This will use the keys/certificates from the examples directory. Note that the +server chain is signed with `CN=localhost`. -* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. -* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. -* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. -* Run `cargo build` to check it builds. -* Run `cargo fmt` to reformat the code. -* Commit the result before making any further changes (lest format changes get confused with your own updates). +## Using the generated library -Now replace the implementations in `src/server.rs` with your own code as required. +The generated library has a few optional features that can be activated through Cargo. -## Updating your server to track API changes +* `server` + * This defaults to enabled and creates the basic skeleton of a server implementation based on hyper + * To create the server stack you'll need to provide an implementation of the API trait to provide the server function. +* `client` + * This defaults to enabled and creates the basic skeleton of a client implementation based on hyper + * The constructed client implements the API trait by making remote API call. +* `conversions` + * This defaults to disabled and creates extra derives on models to allow "transmogrification" between objects of structurally similar types. -Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. -Alternatively, implement the now-missing methods based on the compiler's error messages. +See https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section for how to use features in your `Cargo.toml`. ## Documentation for API Endpoints diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs index d43e0fea7f93..8df0e5e5ebe4 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/client.rs @@ -7,9 +7,9 @@ extern crate futures; #[macro_use] extern crate swagger; #[allow(unused_extern_crates)] -extern crate uuid; extern crate clap; extern crate tokio_core; +extern crate uuid; use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs index ab9887d7ef01..54954f202693 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server.rs @@ -21,7 +21,6 @@ extern crate chrono; #[macro_use] extern crate error_chain; - use openssl::x509::X509_FILETYPE_PEM; use openssl::ssl::{SslAcceptorBuilder, SslMethod}; use openssl::error::ErrorStack; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs index 38aa0d05c4e0..4e7c5e59254f 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server_lib/server.rs @@ -6,7 +6,6 @@ use futures::{self, Future}; use chrono; use std::collections::HashMap; use std::marker::PhantomData; - use swagger; use swagger::{Has, XSpanIdString}; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs index b8d7ed225b3d..d6e3acc1da78 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -1,40 +1,50 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -extern crate serde; -#[macro_use] -extern crate serde_derive; -extern crate serde_json; - -extern crate futures; -extern crate chrono; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; -extern crate mime; +#[macro_use] +extern crate serde_derive; -// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate hyper; - -extern crate swagger; - +#[cfg(any(feature = "client", feature = "server"))] #[macro_use] extern crate url; +// Crates for conversion support +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_derives; +#[cfg(feature = "conversion")] +#[macro_use] +extern crate frunk_enum_derive; +#[cfg(feature = "conversion")] +extern crate frunk_core; + +extern crate mime; +extern crate serde; +extern crate serde_json; + +extern crate futures; +extern crate chrono; +extern crate swagger; + use futures::Stream; use std::io::Error; #[allow(unused_imports)] use std::collections::HashMap; -pub use futures::Future; - #[cfg(any(feature = "client", feature = "server"))] mod mimetypes; +#[deprecated(note = "Import swagger-rs directly")] pub use swagger::{ApiError, ContextWrapper}; +#[deprecated(note = "Import futures directly")] +pub use futures::Future; pub const BASE_PATH: &'static str = ""; pub const API_VERSION: &'static str = "2.3.4"; @@ -43,31 +53,34 @@ pub const API_VERSION: &'static str = "2.3.4"; #[derive(Debug, PartialEq)] pub enum DummyGetResponse { /// Success - Success , + Success } #[derive(Debug, PartialEq)] pub enum DummyPutResponse { /// Success - Success , + Success } #[derive(Debug, PartialEq)] pub enum FileResponseGetResponse { /// Success - Success ( swagger::ByteArray ) , + Success + (swagger::ByteArray) } #[derive(Debug, PartialEq)] pub enum HtmlPostResponse { /// Success - Success ( String ) , + Success + (String) } #[derive(Debug, PartialEq)] pub enum RawJsonGetResponse { /// Success - Success ( serde_json::Value ) , + Success + (serde_json::Value) } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs index ee9a16a375f7..ec298e7fb2ab 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs @@ -1,6 +1,5 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; use serde::ser::Serializer; @@ -10,8 +9,8 @@ use swagger; use std::string::ParseError; - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ANullableContainer { #[serde(rename = "NullableThing")] #[serde(deserialize_with = "swagger::nullable_format::deserialize_optional_nullable")] @@ -36,18 +35,39 @@ impl ANullableContainer { /// An additionalPropertiesObject #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct AdditionalPropertiesObject { +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] +pub struct AdditionalPropertiesObject(HashMap); + +impl ::std::convert::From> for AdditionalPropertiesObject { + fn from(x: HashMap) -> Self { + AdditionalPropertiesObject(x) + } } -impl AdditionalPropertiesObject { - pub fn new() -> AdditionalPropertiesObject { - AdditionalPropertiesObject { - } + +impl ::std::convert::From for HashMap { + fn from(x: AdditionalPropertiesObject) -> Self { + x.0 + } +} + +impl ::std::ops::Deref for AdditionalPropertiesObject { + type Target = HashMap; + fn deref(&self) -> &HashMap { + &self.0 + } +} + +impl ::std::ops::DerefMut for AdditionalPropertiesObject { + fn deref_mut(&mut self) -> &mut HashMap { + &mut self.0 } } + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct InlineObject { #[serde(rename = "id")] pub id: String, @@ -70,6 +90,7 @@ impl InlineObject { /// An object of objects #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ObjectOfObjects { #[serde(rename = "inner")] #[serde(skip_serializing_if="Option::is_none")] @@ -87,6 +108,7 @@ impl ObjectOfObjects { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[cfg_attr(feature = "conversion", derive(LabelledGeneric))] pub struct ObjectOfObjectsInner { #[serde(rename = "required_thing")] pub required_thing: String, diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index 0d20d4c81032..eae8b97db411 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -8,7 +8,6 @@ extern crate mime; extern crate chrono; extern crate percent_encoding; extern crate url; -extern crate uuid; use std::sync::Arc; use std::marker::PhantomData; 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 2f81801b7943..0e97bd19efbf 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 @@ -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/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 9e2703747a3e..ddc15116ef8d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 a78582583228..f9b66778575d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -226,6 +226,17 @@ default CompletableFuture> testJsonFormData(@ApiParam(value } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default CompletableFuture> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 831a3ef70169..c1558801a737 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 d4bdba6d8d1e..881576657a56 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b4ec8f4ed00f..c176d833db22 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 59364abcfbc0..d82462c52b6d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); 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 2f81801b7943..0e97bd19efbf 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 @@ -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/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 01e92d3abec0..fb06ce5e3469 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 3773cff1b62e..b6a596273af4 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -221,6 +221,17 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 1ba2000a46b5..cb0c1a14833f 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f9def84ffc9a..43687340a438 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 88c0d12e9b61..6037bce92203 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5c0e0aff2a82..73779f19c16d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.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/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 ae56d42d508b..a48ff44310f4 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 318dd09fa7e9..fc8216c030db 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -158,6 +158,14 @@ public interface FakeApi { ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2); + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 651f4147e8e0..dc60b7280558 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 @@ -118,6 +118,11 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require } + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + 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"))) { 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 9e44a58698b7..f30bd69acbfe 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 1d3c60abb941..0b88d3317c65 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b052ab392c0c..da0aed9fcfca 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ece84b50e5ca..d3b8a8a1ed62 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index d3354fa81c89..b9d1c52f961a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java index edc5d19f57ea..ab7b747bf2fa 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java index c7478568ba58..1fab3a2e1238 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java index 90886467ceb8..85694fed2185 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.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/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 ae56d42d508b..a48ff44310f4 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 318dd09fa7e9..fc8216c030db 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -158,6 +158,14 @@ public interface FakeApi { ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2); + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 4249e8e14615..d03f6b39ba5b 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 @@ -118,6 +118,11 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require } + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + 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"))) { 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 9e44a58698b7..f30bd69acbfe 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 1d3c60abb941..0b88d3317c65 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b052ab392c0c..da0aed9fcfca 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 ece84b50e5ca..d3b8a8a1ed62 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index d3354fa81c89..b9d1c52f961a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index edc5d19f57ea..ab7b747bf2fa 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index c7478568ba58..1fab3a2e1238 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 90886467ceb8..85694fed2185 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.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/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 eb024c9ea0fa..8b73038ff902 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 9a0eed03978d..ec19bda30c1c 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -188,6 +188,16 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 8bd986cceb1d..03441e760eb4 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 @@ -180,6 +180,18 @@ default ResponseEntity testJsonFormData(String param, } + /** + * @see FakeApi#testQueryParameterCollectionFormat + */ + default ResponseEntity testQueryParameterCollectionFormat(List pipe, + List ioutil, + List http, + List url, + List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * @see FakeApi#uploadFileWithRequiredFile */ 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 fd2741a860b9..67e55fc28fdc 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 572b10c93115..55f682ac9e57 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 8942a0faf2b6..d242b6006dd2 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 39eb0d9a6c02..b7149f2fe36b 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.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/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 ae56d42d508b..a48ff44310f4 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 318dd09fa7e9..fc8216c030db 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -158,6 +158,14 @@ public interface FakeApi { ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2); + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index fd956bffb89f..dcfb5423b515 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -91,6 +91,10 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require return delegate.testJsonFormData(param, param2); } + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + 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) { return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 54b6a75569e8..fea1038544c1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -117,6 +117,15 @@ ResponseEntity testGroupParameters(Integer requiredStringGroup, ResponseEntity testJsonFormData(String param, String param2); + /** + * @see FakeApi#testQueryParameterCollectionFormat + */ + ResponseEntity testQueryParameterCollectionFormat(List pipe, + List ioutil, + List http, + List url, + List context); + /** * @see FakeApi#uploadFileWithRequiredFile */ 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 9e44a58698b7..f30bd69acbfe 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 1d3c60abb941..0b88d3317c65 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 b052ab392c0c..da0aed9fcfca 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * 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 ece84b50e5ca..d3b8a8a1ed62 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index d3354fa81c89..b9d1c52f961a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index edc5d19f57ea..ab7b747bf2fa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index c7478568ba58..1fab3a2e1238 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 90886467ceb8..85694fed2185 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.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/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 c7a9cad5f896..39136ebddda2 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5be814af9b40..0a2724826ab1 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -251,6 +251,19 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @ApiImplicitParams({ + }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 a65c7cbac749..7a332cf0b605 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 eb29a6c04e82..e3834d78e44e 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 2d7dcf179f7a..18d4e461e2d0 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 63961ea1188f..8d4abe945d4e 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.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/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 7f97ef68a9da..1f9215aca110 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 07695c6ec818..43f998942015 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -191,6 +191,16 @@ default Mono> testJsonFormData(@ApiParam(value = "field1", } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, ServerWebExchange exchange) { + return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 6ab9d3e32d87..2c23dcd502b4 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 @@ -218,6 +218,21 @@ default Mono> testJsonFormData(String param, } + /** + * @see FakeApi#testQueryParameterCollectionFormat + */ + default Mono> testQueryParameterCollectionFormat(List pipe, + List ioutil, + List http, + List url, + List context, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + /** * @see FakeApi#uploadFileWithRequiredFile */ 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 826924b76555..bf086f4abd08 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 495d10273983..8c948ff5aaf0 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5fac0dddba57..7dbb2daa7772 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 6ead7c75e2f8..cbbdb7502cbe 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 67ecc530a56d..4482ec16b70b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -875,6 +875,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -1228,6 +1229,62 @@ paths: x-accepts: application/json x-tags: - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1947,6 +2004,10 @@ components: number_item: example: 1.234 type: number + float_item: + example: 1.234 + format: float + type: number integer_item: example: -2 type: integer @@ -1965,6 +2026,7 @@ components: required: - array_item - bool_item + - float_item - integer_item - number_item - string_item diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.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/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 01e92d3abec0..fb06ce5e3469 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 eaa3162bec98..f422936e724a 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -221,6 +221,17 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 1ba2000a46b5..cb0c1a14833f 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 487002c0e1e2..15fa59c99298 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 88c0d12e9b61..6037bce92203 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5c0e0aff2a82..73779f19c16d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.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/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 87185f50d1b7..1a41a45a95c2 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 73ae14b09006..fc50b6202906 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -237,6 +237,18 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + @ApiVirtual + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiVirtual @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { 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 46c60a1d1189..e90b3d9649af 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 b5804d2e0661..e81d8083bb54 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 d224f1ffef2d..41f538fe6f2e 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 8545012843cc..5f3d83e1f2f9 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index 844aa0f0e416..c74b4c4dc8d9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java index 9940cdc7798c..a3eb0b9febc7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index b08639c80d4c..78398cd43a9f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -23,7 +23,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/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index 4ab72c740079..484e8f018b95 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 2f81801b7943..0e97bd19efbf 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.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/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 01e92d3abec0..fb06ce5e3469 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 57721a746fe7..705eb4b7f8c1 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -221,6 +221,17 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), 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 1ba2000a46b5..cb0c1a14833f 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 f9def84ffc9a..43687340a438 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 88c0d12e9b61..6037bce92203 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ 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 5c0e0aff2a82..73779f19c16d 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,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index f250cd5d2547..b7f58b90fa6b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -51,13 +51,13 @@ public class AdditionalPropertiesClass { private Map> mapMapAnytype = null; @JsonProperty("anytype_1") - private Object anytype1 = null; + private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2 = null; + private Object anytype2; @JsonProperty("anytype_3") - private Object anytype3 = null; + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java index cb144d259aef..2e88258ce75c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -17,7 +17,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 640c157bbdbf..5bea5f27a195 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -23,7 +23,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/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java index 01d66d0242d1..c1f4cbd00a72 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -23,6 +23,9 @@ public class TypeHolderExample { @JsonProperty("number_item") private BigDecimal numberItem; + @JsonProperty("float_item") + private Float floatItem; + @JsonProperty("integer_item") private Integer integerItem; @@ -76,6 +79,27 @@ public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @ApiModelProperty(example = "1.234", required = true, value = "") + @NotNull + + + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; return this; @@ -156,6 +180,7 @@ public boolean equals(java.lang.Object o) { TypeHolderExample typeHolderExample = (TypeHolderExample) o; return Objects.equals(this.stringItem, typeHolderExample.stringItem) && Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && Objects.equals(this.integerItem, typeHolderExample.integerItem) && Objects.equals(this.boolItem, typeHolderExample.boolItem) && Objects.equals(this.arrayItem, typeHolderExample.arrayItem); @@ -163,7 +188,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } @Override @@ -173,6 +198,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/website/core/Footer.js b/website/core/Footer.js index 14a67c4727a3..87013fc63c26 100755 --- a/website/core/Footer.js +++ b/website/core/Footer.js @@ -55,7 +55,7 @@ class Footer extends React.Component { rel="noreferrer noopener"> Stack Overflow - Chat Room + Chat Room